1 / 26

MM Stroustrup Ch26

MM Stroustrup Ch26. Comments? Agree or disagree with his testing approach?. MM Stroustrup ch26. Additional topics?. L2asg C++. Good job – very interesting programs Common mistakes No failure set or not well labelled Easy fault = large failure set. Failure Set. Failure Sets.

foy
Download Presentation

MM Stroustrup Ch26

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MM Stroustrup Ch26 • Comments? • Agree or disagree with his testing approach?

  2. MM Stroustrup ch26 • Additional topics?

  3. L2asg C++ • Good job – very interesting programs • Common mistakes • No failure set or not well labelled • Easy fault = large failure set

  4. Failure Set

  5. Failure Sets What was the shape of your failure sets? How could test case selection criterion improve the probability of finding these faults?

  6. From last year’s 1-minute paper • How do we measure test adequacy? Or what is test adequacy?

  7. Test terms • Fault • Failure • Error

  8. Test terms • Test selection criterion – a methodology for selecting test cases • Test adequacy criterion – a methodology for deciding when to stop testing

  9. Testing Basics Detection probability

  10. Detection Probability The probability of detecting a specific fault using a specified testing strategy Or The probability that a randomly-generated test set that satisfies a specific criterion will detect a specified fault

  11. Operational Profile • The set of inputs from which operational data is chosen is called the operational profile • It usually includes a description of the probability of which points will be used • Is 7.99 more likely to be encountered at a WalMart POS terminal than at an exclusive store that only sells fur coats?

  12. Methodology to evaluate testing criterion • Pick sample program, sample faults, sample operational profile, two criteria. • For each criterion, randomly generate test suites that satisfy the criterion. • Calculate the percentage of the suites that detect each of the faults. • The criterion that has the higher percentage is better.

  13. Triangle Example cin >> a >> b >> c ; type = “scalene”; if (a == b || a == c || b == c) type= “isosceles”; if (a == b && a == c) type = “equilateral”; if (a >= b+c || b >= a+c || c >= a+b) type=“not a triangle”; if (a <= 0 || b <= 0 || c <= 0) type=“bad input”; cout<< type;

  14. Control Flow Graph Operational profile 3,3,3 abcdegi equi 3,3,4 abcegi isos 3,3,5 abcegi isos 3,3,6 abcefgi not 3,4,3 abcegi isos 3,4,4 abcegi isos 3,4,5 acegi scal 3,4,6 acegi scal All inputs are equally likely

  15. What are the failure probability for each color (separately)? cin >> a >> b >> c ; type = “scalene”; if (a == b || a == c && b == c) type= “isosceles”; if (a == b || a == c) type = “equilateral”; if (a >= b+c || b >= a+c || c> a+b) type=“not a triangle”; if (a <= 0 || b <= 0 || c <= 0) type=“bad input”; cout<< type; BlueGreen Red

  16. TTYP – probability of detection • What is the probability of detection with one randomly chosen test case? • What is the probability of detection with two randomly chosen test cases?

  17. TTYP – per path • What is the probability of detection with one randomly chosen test case per path? • What is the probability of detection with an equal number of randomly chosen test cases?

  18. TTYP – smaller subdomains • What might be better smaller subdomains?

  19. TTYP - subdomains • Are paths the best subdomains? • Would a functional decomposition be better? • Should we re-define the term subdomain?

  20. Comparing Criteria

  21. Solving this choice • What are the assumptions? • Analogy with dice?

  22. TTYP – smaller subdomains • What might be better smaller subdomains? • Would MCC (multiple condition coverage) be better subdomains

  23. TTYP2 – C0 and C1 coverage • How do we deal with C0 and C1 coverage since they are not subdomain testing methodologies?

  24. TTYP3 • How could you estimate the det prob of C0 or C1 testing?

  25. Marble Problem • Assume that there is a bag of marbles from which marbles are drawn with replacement. • What is the maximum likelihood estimate of p (the probability of drawing a purple) marble if you draw exactly n purple marbles in a row? • ? P such that (p)n(1-p) is max or • ? P such that (p)n = .5

  26. For Thursday, Aug 30 – study through section 2.3 Evaluating Testing Methods by Delivered Reliability Frankl, Hamlet, Littlewood, Strigini IEEE TOSE Aug98

More Related