Unit Test Software Engineering overview

Source: Internet
Author: User

In computer science, unit testing is a software detection and validation method that is suitable for individual units with programmer testing Source code. A unit is the smallest testable part of an application. A programmable unit on a program may be a separate function or procedure.

The goal of unit testing is to isolate the program into a number of small parts and verify that the individual components are correct. A unit

Interpretation: The ultimate goal: early detection of problems, unit testing in two major steps, 1. Isolate the program into a small part; 2. Verify that each widget is correct.

What is a good unit test?

I excerpt from the Art of code change. Good unit testing should have the quality: run fast, can help us locate the problem.

Unit tests cannot be fast if the unit tests interact with the database, communicate with the network, call the file system, and require you to make specific preparations for the environment, such as writing a configuration file.

Then, I add two points myself: it can be run at low cost and can be easily refactored with the official code.

Testing provides a rigorous, documented, code-block contract that must be met, so unit testing can bring many benefits. Unit tests can identify problems early in development.

Only run fast and low cost to run all unit tests before the programmer commits each commit code to verify that the code it modifies has affected existing functionality.

Unit Test Software Engineering overview

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.