tailieunhanh - Lecture Software testing and analysis: Chapter 16 - Mauro Pezzè, Michal Young

A model of potential program faults is a valuable source of information for evaluating and designing test suites. In this chapter, you will: Understand the basic ideas of fault-based testing, understand mutation testing as one application of fault-based testing principles. | Fault-Based Testing (c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 1 Learning objectives • Understand the basic ideas of fault-based testing – How knowledge of a fault model can be used to create useful tests and judge the quality of test cases – Understand the rationale of fault-based testing well enough to distinguish between valid and invalid uses • Understand mutation testing as one application of fault-based testing principles (c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 2 Let’s count marbles . a lot of marbles • Suppose we have a big bowl of marbles. How can we estimate how many? Photo credit: (c) KaCey97007 on Flickr, Creative Commons license (c) 2007 Mauro Pezzè & Michal Young – I don’t want to count every marble individually – I have a bag of 100 other marbles of the same size, but a different color – What if I mix them? Ch 16, slide 3 Estimating marbles • I mix 100 black marbles into the bowl – Stir well . • I draw out 100 marbles at random • 20 of them are black • How many marbles were in the bowl to begin with? (c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 4 Estimating Test Suite Quality • Now, instead of a bowl of marbles, I have a program with bugs • I add 100 new bugs • Assume they are exactly like real bugs in every way • I make 100 copies of my program, each with one of my 100 new bugs • I run my test suite on the programs with seeded bugs . – . and the tests reveal 20 of the bugs – (the other 80 program copies do not fail) • What can I infer about my test suite? (c) 2007 Mauro Pezzè & Michal Young Ch 16, slide .