Software Testing--(6) Module test (unit test)

Source: Internet
Author: User

1. Unit Testing

is a test of the process of a single subroutine in a program, which is a test of the basic components of the software. is the smallest unit of the inspection program, that is, to check whether the module has errors, is the code must be done after the test work.

2. Issues to be concerned with:

1. Target

The function of the module and the definition of the functional specifications of the module or interface specifications of the glue, proving that the module and its specifications are contradictory.

2. Time

Coding--compiling--Unit testing

3. Test Cases

Two types of information are required: The specification of the module and the source code of the module.

Design process: Analyze the logical structure of a module using one or more white-box tests (multiple conditional coverage criteria) and then use the Black-box test method (boundary value analysis) to supplement the test case with the specification of the module.

4. Performer

Program developer or White box tester

Programmers should not test their own modules, but should exchange modules for testing

Programmers who write modules are always the best candidates for testing the module being called

Commissioning of the module is done by the programmer himself

5. Test process

The White box test method is the main, the static check whether the code conforms to the specification, and then dynamically run the code, check the results.

3. Main tasks of unit testing:

module interfaces, local data structures, boundary conditions, independent paths, and error handling

4. Environment for unit testing

By the test module, drive module and the pile module is composed.

When unit testing is not a standalone program, you need to set up some of the auxiliary test modules:

Drive module: Used to simulate the module of the previous level module, equivalent to the main program of the module under test. It is used to receive data, transmit relevant data to the module under test, activate the module under test, and print out the results of the module under test.

Pile module: Used to simulate the module that is called during the working process of the module under test. They typically only have very little data processing.

Software Testing--(6) Module test (unit test)

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.