Objective: To improve the effectiveness of software testing, you can do some minor modifications to the source code for faster, more efficient access to fully test information.
Two main program modification method:
· Program instrumentation: To obtain internal information program during execution, and can be related to inspection;
· Process variations: metric defect detection capability of the test, in order to perform forced to occur at specific conditions and test procedures tuning.
4.1 Program instrumentation
4.1.1 Overview of program instrumentation
· Add some additional statements to the source to detect changes in the status of the program;
It can be added to the output statement and assertion statements during the test, or procedure used to determine the value of the variable status is in line with expectations;
· Consideration of issues before instrumentation:
What is the need to obtain information ①;
Where ② instrumented program location;
③ instrumented program number is the number;
What type ④ instrumentation statement Yes.
4.1.2 Example instrumentation
4.1.3 program instrumentation tools
4.2 mutation test
4.2.1 Variability Test Overview
• one set of test data validity, adequacy of technical assessment, needs to carry out R & D design, unit testing, integration testing to provide effective assistance;
4.2.2 Test Method variation
· Process variations: modify the program based on the pre-defined mutation operation, thereby to obtain source variation program (variants) of the process;
• The program must be completed under the guidance of variation mutation operator;
· After generating variants, each running at the source and variants of test cases:
· The same results both indicate that the variant is alive (Alive);
· Two different results, indicating that the variant is killed (Killed);
· Equivalent variants: semantically consistent and original program, variants can not be killed.
· Variability score: Evaluation test suite effectiveness of error detection metrics
·SCORE(mutation) = NUM(killed) / (NUM(total) - NUM(equivalent));
· NUM (killed) represents the variation in the number of procedures to be killed;
· NUM (total) represents the number of all variations programs;
· NUM (equivalent) represents the number of equivalent mutation procedures;
· SCORE (mutation) represents a variation score between 0 and 1, with higher values indicate more of the variation program killed.
4.2.3 mutation testing tools