创业管理李雪灵)part 2-whitebox.ppt

创业管理李雪灵)part 2-whitebox

Unit testing and integration testing There are two approaches to this incremental testing: bottom-up and top-down. An Example of Module Testing The C language function that performs this operation is atoi(), which stands for ASCII to Integer. If youre going to perform dynamic white-box testing on this module, what would you do? First, you would probably decide that this module looks like a bottom module in the program, and write a test driver to exercise the module independently from the rest of the program. This test driver can take on several forms. It could be a simple dialog box, as shown in Figure 7.7 Or it could be a standalone program that reads test strings and expected results from a file. Next, you would analyze the specification to decide what black-box test cases you should try and then apply some equivalence partitioning techniques to reduce the total set Lastly, you would look at the code to see how the function was implemented and use your white-box knowledge of the module to add or remove test cases. Unit and Integration Testing ?Unit and Integration Testing Unit and Integration Testing Testing that occurs at the lowest level is called unit testing or module testing. As the units are tested and the low-level bugs are found and fixed, they are integrated and integration testing is performed against groups of modules. This process of incremental testing continues, putting together more and more pieces of the software until the entire productor at least a major portion of it is tested at once in a process called system testing. With this testing strategy, its much easier to isolate bugs. A test driver can replace the real software and more efficiently test a low-level module In bottom-up testing , you write your own modules, called test drivers, that exercise the modules youre testing. A test stub sends test data up to the module being tested. In top-down testing, you could write a small piece of code called a stub that acts just like the

文档评论(0)

1亿VIP精品文档

相关文档