What is TDD in XP? Test driver development? Test driver design?

xiaoxiao2021-03-06  61

In the above figure, the 12 teams of XP are listed. Test-Driven Development is one of them.

Test drive development is detailed in the Test Driven Development of Kent Beck.

Testing in XP is a design, not simple to test if your function is implemented. Test a purpose

It can be written before the code is written, and the other purpose of these tests is the design interface.

Ensure that the interface can meet the test (design) during future modifications.

You must at the same time when you are interested or unintentionally modified

Modify test

When you change the interface, you should also modify the test before modify the code. Instead of modifying code waiting for an error and then modify

Test (design). (The test must be 100% by the next function) so that the test is also reminding you that the interface has changed.

In fact, the design has changed. When you modify the unit test, it may be complained. why? You modified the design

Other people's code is dependent on your modified test (design), then changes in new tests (design) may have to affect

The code already has something.

When you use TDD, you must explain whether to test drive development or test driver. Both are different. Test drive

Development is the interface of the function to be developed by testing, and then implements the development process of functionality. For test driver design, it seems in XP

It has disappeared, but is replaced by test drive development. In addition, it is useful in XP to describe design, SimpleDesign, Design Improvement.

Testing in XP is a design. After design, it is also developed, which is why it is tested first.

Test in XP is a document for description.

-------------------------------------------------- -------------------------------------------------- ---

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-94794.html

New Post(0)