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