Software tests are divided into black-box and white-box tests. We have basically tested these two types of methods on the program we just completed, according to the class tolerance in the book.
Black box test: The equivalence class partitioning method is used to test, the specific operation is as follows:
1) dividing the equivalence class and numbering it
Input equivalence class |
Valid equivalence classes |
Invalid equivalence class |
Number of topics |
1) between 1~300 |
2) less than 1 3) greater than 300 |
Generate a range of numbers |
4) between -100~100 |
5) less than-100 6) Greater than 100 |
Whether there are decimals |
7) have 8) No |
|
Decimal Precision Range |
9) between 0~6 |
10) less than 0 11) Greater than 6 |
2) Design test cases, overwriting all valid equivalence classes in the table listing 3 valid equivalence classes, numbered 1) 4) 7)
The design is as follows:
test data |
Expected result |
Valid equivalence class for overrides |
Test result |
100 10 is 3 |
Enter valid |
1), 4), 7), 9) |
input valid |
100 10 No |
Input valid |
1), 4), 8) |
Input valid |
3) Weak robust equivalence class test
use case ID |
|
Generate a number range |
Decimal Precision Range |
Expected output |
|
WR1 |
|
|
|
|
decimal precision to be between 0~6 |
WR2 |
100 |
10 |
7 |
decimal precision between 0~6 |
decimal precision between 0~6 |
WR3 |
100 |
200 |
3 |
range of values to be between -100~100 |
range of values to be between -100~100 |
WR4 |
100 |
-200 |
3 |
range of values to be between -100~100 |
range of values to be between -100~100 |
WR5 |
-1 |
10 |
3 |
The number of topics to be in the 1~300 range |
The number of topics to be in the 1~300 range |
WR5 |
400 |
10 |
3 |
Number of topics to be in 1~300 range |
Number of topics to be in 1~300 range |
White box test: White box Test tool with plug-in version of Parasoft C + + Test
1) automatically generate test cases
Configuring in VS2010
2) Execute the test case
3) Partial test results
Statement coverage:
Path Coverage:
Final Result:
Coverage:
For C + + Test Plug-in version: HTTP://DOWNLOAD.CSDN.NET/USER/LIFUHUA6/UPLOADS/3
Installation method:
1) Enter, will cpptest_9.0.0155_win_vs2005_2008_2010.part1,2,3,4,5 these five resources together download and then unzip and install
2) Unzip the plugins-c++test+for+visual+studio.7z in, and you will see a plugins folder that overwrites all the files in this file to
C:\Program Files (x86) \parasoft\c++test for Visual Studio\9.0\plugins
3) plugins-test+for+visual+studio.part1,2 The two parts of the download together, there will also be a plugins folder, all the files in this file to overwrite the
C:\Program Files (x86) \parasoft\Test for Visual Studio\9.0\plugins.
This will enable the plugin to be properly installed in the VS2010.
Software testing of Pair programming