TDD (test driven development, test-Driven Development)

Source: Internet
Author: User

Test-driven development is an important practice in agile methods. It is generally considered to be the father of extreme programming.Kent BeckCreated 《Test-driven development by exampleThe book has been elaborated in detail. However, as many software technologies and methods emerge,TDDIt can also be regarded as the crystallization of the wisdom of everyone. Among them, there is no lack of early andKentbeckActive togetherSmalltalkCommunityAnd now the most prestigious industry leaders, such:Erich Gamma,Ward cunnheim, AndMartin FowlerAnd others. There are so many senior personnel for support, presumablyTDDThe value is beyond doubt.

TypicalTDDThe steps are as follows:

LYou can quickly compile a test case as needed. At this time, even compilation fails.

LWrite as few features as possibleCodeTo pass the test case

LTest Cases are gradually supplemented as needed. At this time, the test cases still fail.

LModify the function code to pass the new test cases. At the same time, you must re-pass the previously passed and failed test cases.

LRefactor the code of the above functions (sometimes even test code) to eliminate duplicates.

Advantages of test-driven development:

LProviding effective assurance for System Improvement

LIt is very helpful for improving the design.

LProvides a good "document" for functional code"

LTo some extent, it can be replacedProgramDebugging

LIt can significantly increase developers' confidence and win others' trust.

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.