This essay was not included in the plan. It was caused by a small debate between me and the cold wind.
We start from the point of argument.
TestCodeInside or outside the class.
This is a seemingly simple problem, and it seems insignificant. So that I didn't take it as a matter too much at first.
However, it reflects a fundamental problem of TDD.
Test first or code first ??!!
A very important idea of test-driven development is testing first. If the test code appears inside the class, it becomes code first.
You think this is a bit of a dogma, but this is the real test-Driven Development !!!
Test-driven development is a software development methodology! Is extreme program a software development methodology? Yes. TDD is an important component of TDD, which directly leads to code generation. Other pair work, continue integration, work flesh and other technologies and TDD constitute the overall XP. So TDD's position in it can be imagined that it directly produces ourSource code.
Test-driven development does not write the source code before writing the test code.
Instead, we should first write the test code, and then write the source code to make the test pass, so all the code is produced by the test. Isn't this the methodology of software development?
If you use test-driven development as a plug-in, you misunderstand the intention of test-driven development. The driver here does not mean help, but relies entirely on it. Of course, you can write test code as a means to help you develop, which may have happened in our programming experience.
However, remember that this is not just a test-driven development! I should name it test-assisted development.
Some may doubt the ability to test the driver. I will try my best to explain it to you later.
How test-driven development is driven, and even how to generate a model under the guidance of testing (or the concept of a pattern has long been in your mind) are also my concerns about TDD, we hope that, under the guidance of everyone, we can deepen our understanding of test-driven development.