Test Case Design - Triangle Problem
Test Case Design - Triangle Problem
Test Case Design - Triangle Problem
Lessons learned
Test execution
Input1 Input2 ... Input n
Executable software
Actual output The same ?
Specification
Expected output
Test passed
Test failed
The function returns the result in the form of the character string, e.g. Equilateral if the triangle is equilateral.
Class exercise
Suggest a set of test cases for testing the TriangleType function
Minimal test?
Test case 1 2 3
Input values 3, 3, 3 3, 3, 2 3, 4, 5
15 minutes
Automated test?
for i = minval to maxval by increment do for j = minval to maxval by increment do for k = minval to maxval by increment do enter { i, j, k } capture { result } if [ i = j = k ] and result = equilateral or if [ ( i = j ) and ( i not = k ) and result = isosceles ] or if [ ( j = k ) and ( j not = i ) and result = isosceles ] or if [ ( k = i ) and ( k not = j ) and result = isosceles ] or if [ ( i not = j ) and ( j not = k ) and ( k not = i ) and result = scalene ] then ok else write error_log [ i, j, k, result ] end end end
Homework
Next lecture