Historically true: test programming and development through testing mean the same thing with an improved name
In the context of XP (Extreme Programming), which is a software development process that made popular programming and development through testing popular, programming was first renamed development through testing, and then through testing-based design, after realizing that Writing tests primarily has an extremely positive impact on software architecture and software system design.
This influence on architecture and design is the result of more or less surprising synonyms:
- Testable
- disconnected
- reusable
- Independently deployable
- Independently developing
- Whatever Reasonable
Software objects can be easily reused, tested, deployed independently, developed independently or easily justified separately if they are not related. Writing tests before the actual implementation is a practically bulletproof method that provides continuous decoupling.
This influence on the design and architecture of the software has become so important, among other positive effects, that the creators considered it appropriate to rename it from Test-First Programming to Test-Driven Development.
The name Test-Driven Development also helps to advance the method better in terms of acceptance and understanding, because the name Test-Driven Development focuses on the holistic aspects of the method than Test-First Programming.
Not historically correct, but useful
Although historically not correct, I find the following difference very useful:
Testing at the beginning of programming ...
... Any method in which tests for the test code are written before the test code.
Development through testing ...
... It is a specific subset of the "test first" programs that follows the three laws of development through testing, as described by Robert C. Martin:
- You cannot write production code until you write a failed unit test.
- You cannot write more unit tests than enough to fail, and compilation failed.
- You cannot write more production code than enough to pass the currently failed unit test. - Robert C. Martin, Three Laws of Test Driven Development
Following these three rules, you fall into the Red-Green-Refactor cycle. 1. You write a failed test. 2. You make it go through. 3. Now that it has passed, you can mercilessly refactor before writing the next failed test.
Please note that refactoring safely requires testing. Refactoring means changing the structure of the source code without changing the essential behavior. But how do we know that we did not accidentally change the essential behavior? What determines significant behavior? This is one of many things tests are useful for.
By the way, if your tests interfere with refactoring, your tests are too low-level, too closely related, and you may have used too much ridicule.
Other interesting renaming in Extreme Programming
- Continuous Integration → Continuous Delivery → Continuous Deployment; Strictly speaking, they mean different things, however, in the spirit of XP, it meant “Continuous Deployment” from the very beginning, and when people jumped on the bandwagon, it became clear that the integration was taken too literally, and people stopped before they did it.
- Continuous refactoring → Continuous design improvement; Refactoring is not a means to an end, but it has a higher goal.
- 40 hours a week → Sustainable Pace (Urban legend: This renaming happened after the protests of French software developers.)