170 likes | 294 Views
Testing Basics. Detection probability. 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.
E N D
Testing Basics Detection probability
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.
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;
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
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
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?
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?
TTYP – smaller subdomains • What might be better smaller subdomains?
TTYP - subdomains • Are paths the best subdomains? • Would a functional decomposition be better? • Should we re-define the term subdomain?
Solving this choice • What are the assumptions? • Analogy with dice?
TTYP – smaller subdomains • What might be better smaller subdomains? • Would MCC (multiple condition coverage) be better subdomains
TTYP2 – C0 and C1 coverage • How do we deal with C0 and C1 coverage since they are not subdomain testing methodologies?
TTYP3 • How could you estimate the det prob of C0 or C1 testing?
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
For Tuesday, Sep 4– study through section 2.3 Evaluating Testing Methods by Delivered Reliability Frankl, Hamlet, Littlewood, Strigini IEEE TOSE Aug98