Understanding of the TDD principle

Source: Internet
Author: User

1, do not write any product code until the failed unit test is written.
If you do not write the test first, then the functions will be coupled together and eventually become unable to test
If you write a test, you may be able to test large chunks of code, but you cannot test each function
First write the test is offensive, after write test is defense
2, as long as a unit test failed, do not write the test code, compile failure is also a failure
a place leaks to repair, do not wait for a number of places leaking to repair, then you may not repair
3, the product code just can let the failed test cases pass, do not write more than one line
The Reliance inversion principle tells us that the lower layer is a high-level service, and the test driver tells us that the product code serves the test case
In contrast, test cases are located at the top, close to demand, representing demand

Understanding of the TDD principle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.