About TDD

xiaoxiao2021-03-06  39

The Unit Test is also called a unit test, which is a test for the most basic structural unit of the program. The process of TDD is such, write a test program, allowing it to run and reconstruct. When you write this test program, you should not think about what structure is based, but to consider what features that need to be completed. When implementing and reconstructing this unit, this function is still not you should consider. Do you think about it? Is it true that this function is really clear and work. The problem you consider is always around the specific function, not around a certain structure. When you write this test program, this structure does not exist, and it may not be present in the future (due to reconstruction, you have implemented this feature in other structural parts).

Understand this truth, you can understand that TDD is actually driven based on demand, or a forward-looking design means. Only TDD makes this demand more specific, allowing it to look forward to more prediction, and give you a variety of attempts in a variety of methods. And when you think this test is just a unit test, you will undoubtedly do a fixed earlier structure, which is based on structural rather than demand, and due to its structure-based one-on-faced design It's hard to guarantee, and it is possible to break a variety of attempts in fundamental. The forward-looking designed means that your design can bring forecast results. The software structure is dynamic, and as you must perform the reactance activities such as structural changes to the existence of daily. If your test is highly relying on a particular structure, in such a regular reconstruction environment, its critical chances will be greatly increased. Since uncertainty of its structure is not possible to reverse, the testing of structures is not possible to bring a structural predictability, and it will not be forward-looking.

This passage is a clear analysis of TDD, and TDD is not simply a test to drive code. We haven't practiced TDD yet, not everyone who recognizes TDD, and understands how to do it, this includes me. But one thing to emphasize - TDD is not simply prepared to test the code, but the driver of the entire development process.

转载请注明原文地址:https://www.9cbs.com/read-66156.html

New Post(0)