Presentation is loading. Please wait.

Presentation is loading. Please wait.

White-Box Testing Techniques IV Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 10.

Similar presentations


Presentation on theme: "White-Box Testing Techniques IV Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 10."— Presentation transcript:

1 White-Box Testing Techniques IV Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 10

2 White-Box Testing Topics Logic coverage (lecture I) Dataflow coverage (lecture II) Path conditions and symbolic evaluation (lecture III) Other white-box testing strategies (e.g., “fault-based testing”) (lecture IV)

3 Other white-box testing strategies Program instrumentation Boundary value analysis (revisited) Fault-based testing –Mutation analysis –Error seeding

4 Program Instrumentation Allows for the measurement of white- box coverage during program execution. Code is inserted into a program to record the cumulative execution of statements, branches, du-paths, etc. Execution takes longer and program timing may be altered.

5 Program Instrumentation Allows for the measurement of white- box coverage during program execution. Code is inserted into a program to record the cumulative execution of statements, branches, du-paths, etc. Execution takes longer and program timing may be altered.

6 Program Instrumentation Allows for the measurement of white- box coverage during program execution. Code is inserted into a program to record the cumulative execution of statements, branches, du-paths, etc. Execution takes longer and program timing may be altered.

7 Boundary Value Analysis (1) if (X { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/3778810/13/slides/slide_6.jpg", "name": "Boundary Value Analysis (1) if (X

8 Boundary Value Analysis (1) if (X { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/3778810/13/slides/slide_7.jpg", "name": "Boundary Value Analysis (1) if (X

9 Fault-Based Testing Suppose a test case set reveals NO program errors – should you celebrate or mourn the event? Answer: it depends on whether you’re the developer or the tester... Serious answer: it depends on the error- revealing capability of your test set. Mutation Analysis attempts to measure test case set sufficiency.

10 Fault-Based Testing Suppose a test case set reveals NO program errors – should you celebrate or mourn the event? Answer: it depends on whether you’re the developer or the tester... Serious answer: it depends on the error- revealing capability of your test set. Mutation Analysis attempts to measure test case set sufficiency.

11 Fault-Based Testing Suppose a test case set reveals NO program errors – should you celebrate or mourn the event? Answer: it depends on whether you’re the developer or the tester... Serious answer: it depends on the error- revealing capability of your test set. Mutation Analysis attempts to measure test case set sufficiency.

12 Fault-Based Testing Suppose a test case set reveals NO program errors – should you celebrate or mourn the event? Answer: it depends on whether you’re the developer or the tester... Serious answer: it depends on the error- revealing capability of your test set. Mutation Analysis attempts to measure test case set sufficiency.

13 Mutation Analysis Procedure 1.Generate a large number of “mutant” programs by replicating the original program except for one small change (e.g., change the “+” in line 17 to a “-”, change the “<“ in line 132 to a “<=“, etc.). 2.Compile and run each mutant program against the test set. (cont’d)

14 Mutation Analysis Procedure 1.Generate a large number of “mutant” programs by replicating the original program except for one small change (e.g., change the “+” in line 17 to a “-”, change the “<“ in line 132 to a “<=“, etc.). 2.Compile and run each mutant program against the test set. (cont’d)

15 Mutation Analysis Procedure (cont’d) 3.Compare the ratio of mutants “killed” (i.e., revealed) by the test set to the number of “survivors.” --- The higher the “kill ratio” the better the test set. What are some of the potential draw- backs of this approach?

16 Mutation Analysis Procedure (cont’d) 3.Compare the ratio of mutants “killed” (i.e., revealed) by the test set to the number of “survivors.” --- The higher the “kill ratio” the better the test set. What are some of the potential draw- backs of this approach?

17 Mutation Analysis Procedure (cont’d) 3.Compare the ratio of mutants “killed” (i.e., revealed) by the test set to the number of “survivors.” --- The higher the “kill ratio” the better the test set. What are some of the potential draw- backs of this approach?

18 Error Seeding A similar approach, Error Seeding, has been used to estimate the “number of errors” remaining in a program. But such metrics are inherently problematic. For example, how many “errors” are in the following Quick Sort program?

19 Error Seeding A similar approach, Error Seeding, has been used to estimate the “number of errors” remaining in a program. But such metrics are inherently problematic. For example, how many “errors” are in the following Quick Sort program?

20 Error Seeding A similar approach, Error Seeding, has been used to estimate the “number of errors” remaining in a program. But such metrics are inherently problematic. For example, how many “errors” are in the following Quick Sort program? QSORT(X,N) Return(X) END

21 Error Seeding Procedure 1.Before testing, “seed” the program with a number of “typical errors,” keeping careful track of the changes made. 2.After a period of testing, compare the number of seeded and non-seeded errors detected. (cont’d)

22 Error Seeding Procedure 1.Before testing, “seed” the program with a number of “typical errors,” keeping careful track of the changes made. 2.After a period of testing, compare the number of seeded and non-seeded errors detected. (cont’d)

23 Error Seeding Procedure (cont’d) 3.If N is the total number of errors seeded, n is the number of seeded errors detected, and x is the number of non-seeded errors detected, the number of remaining (non-seeded) errors in the program is about x(N/n – 1) What assumptions underlie this formula? Consider its derivation…

24 Error Seeding Procedure (cont’d) 3.If N is the total number of errors seeded, n is the number of seeded errors detected, and x is the number of non-seeded errors detected, the number of remaining (non-seeded) errors in the program is about x(N/n – 1) What assumptions underlie this formula? Consider its derivation…

25 Error Seeding Procedure (cont’d) 3.If N is the total number of errors seeded, n is the number of seeded errors detected, and x is the number of non-seeded errors detected, the number of remaining (non-seeded) errors in the program is about x(N/n – 1) What assumptions underlie this formula? Consider its derivation…

26 Derivation of Error Seeding Formula Let X be the total number of NON- SEEDED errors in the program Assuming seeded and non-seeded errors are equally easy/hard to detect, after some period of testing, x:n  X:N. So, X  xN/n X – x  xN/n – x  x(N/n – 1) as claimed.

27 White-Box Testing Techniques IV Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 10


Download ppt "White-Box Testing Techniques IV Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 10."

Similar presentations


Ads by Google