I read about unit testing, TDD, and SOLID principles, and I need some clarification. I understand that if you adhere to the open / closed principle, unit testing may become largely unnecessary because the code is closed for modification, so there is no need to repeat the check if the code is correctly isolated and decoupled. The long-term advantage of the added initial cost of unit testing is lost if, after passing the code, the unit tests are not changed. The code will always pass because it will never change, right? Inherited classes must be tested, but as soon as they pass the associated tests, they will also be closed for modification and do not need to be re-tested. Wikipedia article on OCPconfirms this idea in the first paragraph (I understand that this does not make it legal). The best explanation I have found for OCP and TDD living in harmony is here , although it seems that Arnon says that OCP welcomes TDD with the fact that the developer is not recommended to change the source code, because existing testing methods can become complicated if they are modified for testing new features.It's all? Keep in mind that I'm not looking for an argument, I'm new to this, and I'm looking for clarifications from those who have more experience with the subject than mine.
, , , ( ), , . , - unit test (s).
, , , . , , , . , , - ...
, , , , - . , O SOLID, , . , , , - , , .
- ,
, . , , , ?
, . IIRC, "". ( TDD test-first) , .
, . , , , . , - . .