1 / 16

Software Testing

Software Testing. Boundaries and C0,C1 Pressman pp437-476. Instrument Your Code. To achieve C0 or C1 coverage, generate good test cases until coverage has been reached. By hand, insert print statements with “a”, “b”, etc and sort output

cora-moses
Télécharger la présentation

Software Testing

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. Software Testing Boundaries and C0,C1 Pressman pp437-476

  2. Instrument Your Code • To achieve C0 or C1 coverage, generate good test cases until coverage has been reached. • By hand, insert print statements with “a”, “b”, etc and sort output • In Dec, I will expect teams to demonstrate that they have achieved C0 coverage of their code.

  3. Subdomain (not in Pressman) • 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. • Or a set of such subdomains

  4. Boundary Testing • A boundary test tries to establish that the boundary is in the correct spot. • Thus, test cases are chosen on the boundary and as close as possible on the open side. • “2-on, 1-off” means two on the boundary spread far apart and one just off the boundary in between the other two

  5. Payroll Problem • Wages must be greater than zero and less than 100 • Hours must be greater than zero and less than 80 • Time and a half is paid on hours over 40

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

  7. TTYP1 - boundary tests • Determine boundary tests for the boundary between “a” and “d” cin>>x>>y; output= “d”; if(y>x) output = “a”; if(x>5) output = “b”; if (y < 0) output = “c”; cout << output;

  8. Triangle Domain

  9. Triangle Domain : a = b plane

  10. Triangle Domain : a = .5b plane

  11. TTYP2 - the triangle program • Assume max length is 10 • In the a=b plane, what would be 2-on, 1-off tests for the boundary between isosceles and not-a-triangle?

  12. Independent Paths • The independent paths are? • A - {aceg, abcdefg} • B - {abc,cde,efg} • C - {aceg,abc,cde,efg}

  13. Basis Paths for testing • McCabe’s basis testing does not have a theoretical foundation • Pressman does not give a precise enough definition of basis set or independent path to be useful • Advice - use other criteria

  14. For Tuesday, Oct 15th • Read chapter 18 • pp 477-505

  15. Triangle Example cin >> a >> b >> c ; type = “scalene”; if (a == b || a == c || b == c) type= “isoscoles”; 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;

  16. Control Flow Graph TTYP1 – what are the paths through this code?

More Related