About Unit Testing

Source: Internet
Author: User

Unit test:

Why do we need to perform unit tests?

Introducing unit tests is simple because it is fun. However, during project delivery, we still provide products to customers and end users.CodeAnd does not contain unit test code. Therefore, we must have a full understanding of the purpose of unit test. First and foremost, unit testing is used to make your work-and the work of your teammates-easier.

 

Is it a waste of time to write unit tests that increase coding time?

If you still think that you still don't have time to write test code when writing product code, consider the following questions:

1. How much time have you spent on debugging the written code?

2. How much time have you spent reverifying the code that you thought was correct before, but in fact there are major bugs in the code?

3. How much time have you spent on finding the source code location of a bug reported by someone else?

 

Advantages of unit testing?

Promptly discover problems

In the long run, the cost of using the "test model now" is lower than that of the "test model later. When writing the implementation code, you can write independent test code at the same time to avoid useless problems at the end of the project.BugEven less, because you are dependent on code that has passed the test. Therefore, by spending more time writing unit tests during the development process, you can minimize the risk of spending a lot of time in the later stages of the project.

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.