Presentation is loading. Please wait.

Presentation is loading. Please wait.

1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

Similar presentations


Presentation on theme: "1841f07subdomains2Aug23 Question u What is the main purpose of software testing?"— Presentation transcript:

1 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

2 2841f07subdomains2Aug23 Testing Basics Subdomains

3

4 4841f07subdomains2Aug23 Failure Set u The failure set for a fault is the set of points in the program domain that display the fault, that is, cause the output to be different from specified.

5 5841f07subdomains2Aug23 Programming task u Who had the smallest failure set? u Who had the largest failure set? u Who had a strange failure set?

6 6841f07subdomains2Aug23 Failure Set

7

8 8841f07subdomains2Aug23 Subdomain u A subdomain is a set of input points (data points, tests, etc) that are treated identically by the program. That is, they take the same path through the program and the same operations are applied to the values. u Or a set of such subdomains u Sometimes called a partition

9 9841f07subdomains2Aug23 Different uses in the literature u Much like mine – with mutual exclusion u Arbitrary division of the input domain u Any definable subset of the input domain u Other?

10 10841f07subdomains2Aug23 Example - Payroll Problem u Wages must be greater than zero and less than 100 u Hours must be greater than zero and less than 80 u Time and a half is paid on hours over 40

11 11841f07subdomains2Aug23 Subdomains of Example I II 0,0 0,100 40,0 80,0

12 12841f07subdomains2Aug23 TTYP – how do faults affect the subdomains? Pay = hours * wage If hours > 40 then pay = pay +.5*(hours-40)*wage u Consider some possible faults in the payroll program –Can you find faults that affect a whole subdomain? –Can you find faults that move the boundaries? –Can you find faults that make bigger changes?

13 13841f07subdomains2Aug23 Boundary Testing Example - 2on/1off V I II I-V : (0,100),(40,100),(20,99) II-V : (41,100),(79,100),(60,99) I-II : (40,1),(40,99),(41,50)

14 14841f07subdomains2Aug23 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;

15 15841f07subdomains2Aug23 Triangle Domain : a = b plane

16 16841f07subdomains2Aug23 Triangle Domain : a =.5b plane

17 17841f07subdomains2Aug23 Control Flow Graph

18 18841f07subdomains2Aug23 TTYP - subdomains u Are paths the best subdomains? u Would a functional decomposition be better? u Should we re-define the term subdomain?

19 19841f07subdomains2Aug23 For Tuesday, Aug 28 Read ch28 – Shrostrup’s chapter on testing


Download ppt "1841f07subdomains2Aug23 Question u What is the main purpose of software testing?"

Similar presentations


Ads by Google