Software Testing Structural testing 540 f 07 testing

  • Slides: 14
Download presentation
Software Testing Structural testing 540 f 07 testing 17 oct 25 1

Software Testing Structural testing 540 f 07 testing 17 oct 25 1

Triangle Example cin >> a >> b >> c ; type = “scalene”; if

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;

Control Flow Graph TTYP 1 – what are the paths through this code?

Control Flow Graph TTYP 1 – what are the paths through this code?

Typical Structural Coverage u C 0 – every statement u C 1 – every

Typical Structural Coverage u C 0 – every statement u C 1 – every branch

Triangle Example Instrumented cin >> a >> b >> c ; type = “scalene”;

Triangle Example Instrumented cin >> a >> b >> c ; type = “scalene”; cout << “na”; if (a == b || a == c || b == c) {cout<<“nb”; type= “isoscoles”; } if (a == b && a == c) {cout<<“nc”; type = “equilateral”; } if (a >= b+c || b >= a+c || c >= a+b) {cout<<“nd”; type=“not a triangle”; } if (a <= 0 || b <= 0 || c <= 0) {cout<<“ne”; type=“bad input”; } cout<< type;

Recommended use of C 0 and C 1 u Select good test cases independent

Recommended use of C 0 and C 1 u Select good test cases independent of coverage u If Cx is not achieved, continue to select specific, but good test cases until Cx is achieved

TTYP u What is a set of test cases for the “path” subdomains for

TTYP u What is a set of test cases for the “path” subdomains for the triangle code?

Boundary Testing A boundary test tries to establish that the boundary is in the

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

Payroll Problem u Wages must be greater than zero and less than 100 u

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

Boundary Example - 2 on/1 off V I II

Boundary Example - 2 on/1 off V I II

Triangle Domain

Triangle Domain

TTYP - Boundaries in the triangle program u Assume u What max length is

TTYP - Boundaries in the triangle program u Assume u What max length is 10 would be 2 -on, 1 -off for the boundary between isosceles and not-a-triangle?

Next week u Tues, Oct 30 – Testing Plans – Read “Enhancing Software Testing

Next week u Tues, Oct 30 – Testing Plans – Read “Enhancing Software Testing by Judicious Use of Code Coverage Information” – Directed Journal upload due 11 am Tuesday, Oct 30 and bring a copy of directed journal to class on Tuesday » » u Summarize the purpose of the research described in the article Describe completely the process described in the article What were the answers to the four research quesionts Describe the 10 lessons learned in order of their importance (in your view) Wed, Nov 7 – HSPC – Union Ballroom

Muddiest Point u What is your muddiest point in software testing?

Muddiest Point u What is your muddiest point in software testing?