Test-driven development essay-test-driven or test-assisted

Source: Internet
Author: User

This essay was not included in the plan. It was caused by a small debate between me and the cold wind.

We start from the point of argument.

TestCodeInside or outside the class.

This is a seemingly simple problem, and it seems insignificant. So that I didn't take it as a matter too much at first.

However, it reflects a fundamental problem of TDD.

Test first or code first ??!!

A very important idea of test-driven development is testing first. If the test code appears inside the class, it becomes code first.

You think this is a bit of a dogma, but this is the real test-Driven Development !!!

Test-driven development is a software development methodology! Is extreme program a software development methodology? Yes. TDD is an important component of TDD, which directly leads to code generation. Other pair work, continue integration, work flesh and other technologies and TDD constitute the overall XP. So TDD's position in it can be imagined that it directly produces ourSource code.

Test-driven development does not write the source code before writing the test code.

Instead, we should first write the test code, and then write the source code to make the test pass, so all the code is produced by the test. Isn't this the methodology of software development?

If you use test-driven development as a plug-in, you misunderstand the intention of test-driven development. The driver here does not mean help, but relies entirely on it. Of course, you can write test code as a means to help you develop, which may have happened in our programming experience.

However, remember that this is not just a test-driven development! I should name it test-assisted development.

Some may doubt the ability to test the driver. I will try my best to explain it to you later.

How test-driven development is driven, and even how to generate a model under the guidance of testing (or the concept of a pattern has long been in your mind) are also my concerns about TDD, we hope that, under the guidance of everyone, we can deepen our understanding of test-driven development.

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.