White box test instance-10 integration test concept

Source: Internet
Author: User

OriginalArticle, Copyright Hu Tian Fa (hutianfa@163.com) All, reprint please indicate the source:
Http://blog.csdn.net/aidisheng/archive/2008/09/06/2892771.aspx

 

I. Pile module and drive module (using C language as an example ):

Many people may be confused about the concepts of the pile module and the drive module. The following describes these two concepts:

Module structure instance diagram:

Assume that the project team has assigned seven members to implement a module. You are responsible for Module B. You are excellent. The first one completes coding. Now you need to perform unit testing. First, analyze the structure diagram:

1. Because Module B is not the top-level module, it must not contain the main function (module A contains the main function), so it cannot run independently.

2. Module B calls Module D and module E. At present, neither Module D nor module E is well developed, so it is impossible to compile Module B through the compiler.

So how can we test module B? You need:

1. Write two modules, SD and Se, respectively, to replace Module D and module E (the function name, return value, and transmitted parameters are the same), so that Module B can be compiled. The SD module and the se module arePile Module.

2. Write a module da to replace module A, which contains the main function. You can call Module B in the main function to run Module B. The DA module isDriver Module.

 

Knowledge point:

Pile ModuleIn addition to makingProgramIn addition to being able to compile and pass, you also need to simulate the various possible return values of the replaced module (when to return the value depends on the test case ).

Driver ModuleThe mission is to call the tested module according to the design of the test case, and determine whether the returned values of the tested module are consistent with the expected results of the test case.

 

Ii. Integration Test Strategy:

1. Non-incremental integration testing

After being tested, each unit module is assembled into a complete system at a time.

Advantage: the integration process is simple.

Disadvantage: When an integration problem occurs, it is troublesome to find the problem and the test is easy to miss out.

Example:

2. incremental integration testing

(1) Top-down

A. Vertical priority

To start testing from the top layer, write the module. Test sequence: From the heel node, add a node to the tested sub-system for each leaf node from the trunk to the trunk, and then add another trunk node, until all nodes are integrated into the system.

B. horizontal priority

The difference with vertical priority is that each time it does not follow the branches to the leaves, it is added to its direct subnodes one by one.

Example of vertical priority:

(2) Bottom-up

Each time the test starts from the leaf node, the tested node is removed, and the leaf node on the tree is removed and added to the tested subsystem. Advantage: write module is not required, but driver module is required.

Example:

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.