Concept and difference of drive module and pile module

Source: Internet
Author: User

Ext.: http://blog.csdn.net/xhf55555/article/details/6819010

Pile modules and drive modules (for example in C language):

Many people do not understand the concept of the pile module and the drive module, then the following describes the two concepts:

Module Structure Example diagram:

Let's say the project team has assigned the task to 7 people, and everyone is responsible for implementing a module. You are responsible for the B module, you are very good, the first to complete the coding work , now need to carry out unit testing work, the first analysis of the structure diagram:

1, because the B module is not the topmost module, it must not contain the main function (a module contains the main function), it can not run independently.

2, b module calls the D module and e module, and the current D module and E module has not been developed , so it is impossible to let the B module through the compiler compiler.

So how do you test the B module? Need to do:

1, write two modules SD and SE instead of D module and E module (function name, return value, pass the same parameters), so B module can be compiled. The SD module and SE module are the pile modules.

2, write a module da to replace a module, which contains the main function, you can call the B module in the main function, let the B module run up. The DA module is the drive module.

Knowledge Points:

The mission of the pile module, in addition to enabling the program to be compiled through, also needs to simulate the various possible return values that return the substituted modules (when to return what values need to be determined based on the case of the test case ).

The mission of the driver module is to invoke the tested module according to the design of the test case and determine if the return value of the tested module matches the expected result of the test case.

Concept and difference of drive module and pile module

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.