Original article: http://www.infoq.com/cn/news/2009/11/uncle-bob-tdd-applicability
Has TDD replaced the architecture?
You cannot pass TDD
Get a complete architecture.
TDD
You can tell you some architectural decisions, but you cannot start a project without architecture design. Therefore, some pre-architecture is necessary. The most important thing is to determine which Architecture elements can be delayed or not.
Can TDD replace design?
No, you still need all design skills. You still need to understand the design principles and patterns. You should understand UML
. In addition, you should create a lightweight model for software design.
In fact, TDD
Yes
A design technology, but not a lonely design technology. All old design rules and skills still apply. TDD
They can be affected and enhanced.
Should TDD be applied to each line of code?
Some codes are not suitable for TDD
. For example,
Gui
. Of course, not just
Gui
It is just an example. The core is (
Fiddling
) Idea:
1,
You must put the code in place.
2,
You must play with some aspects to meet customer needs.
3,
If there are some new uncertainties, it must be solved through fast cycles (high iterations.
In several cases, it is not suitable for TDD only
Developed. Simply put, if you develop a product (or software module) that is highly customized for users, or a product that is a trial product, you need to solve the problem in the trial iteration, in this case, test-driven development is not suitable.
Test-driven development can improve each line of code and the probability of each decision being tested.
Highly automated test coverage increases your speed. The reason is:
First,
You don't have to spend too much time on debugging.
Second,
It will not inadvertently corrupt the code.
Third,
To some extent, test cases reflect the functions of the system.
Fourth,
Reduce maintenance costs later.