1 / 13

What is an “Error”?

What is an “Error”?. According to IEEE Standard Glossary: ________: The difference between a computed, observed, or measured value or condition and the true, specified, or theoretically correct value or condition

Download Presentation

What is an “Error”?

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. What is an “Error”? According to IEEE Standard Glossary: • ________: The difference between a computed, observed, or measured value or condition and the true, specified, or theoretically correct value or condition • For example, a difference of 30 meters between a computed result and the correct result Error Fault • ________: An incorrect step, process, or data definition • For example, an incorrect instruction in a computer program.

  2. What is an “Error”? Failure • ________: An incorrect result • For example, a computed result of 12 when the correct result is 10 Mistake • ________: A human action that produces an incorrect result • For example, an incorrect action on the part of a programmer or operator.

  3. Statement CoverageExample 1 if (a >= 0 && a <= 9) sum = list1[a]; if (b >= 0 && b <= 9) sum = sum + list2[b]; • Statement coverage may be achieved by 1 test case(s): • a = 9, b = 3.

  4. Branch CoverageSame Example 1 if (a >= 0 && a <= 9) sum = list1[a]; if (b >= 0 && b <= 9) sum = sum + list2[b]; • Branch coverage may be achieved by 2 test cases: • a = 9, b = 3 • a = 10, b = –1 sumis not defined.

  5. Branch CoverageExample 2 if (a >= 0 && a <= 9) sum = list1[a]; else sum = 0; if (b >= 0 && b <= 9) sum = sum + list2[b]; else sum = 0; • Branch coverage may be achieved by 2 test cases: • a = 9, b = 3 • a = 10, b = –1.

  6. Path CoverageSame Example 2 if (a >= 0 && a <= 9) sum = list1[a]; else sum = 0; if (b >= 0 && b <= 9) sum = sum + list2[b]; else sum = 0; • Path coverage may be achieved by 4 test cases: • a = 9, b = 3 • a = 10, b = –1 • a = 10, b = 3 • a = 9, b = –1 sumis not correct.

  7. Branch CoverageExample 3 if (a >= 0 && a <= 9) sum = list1[a]; else sum = 0; if (b >= 0 && b <= 9) sum = sum + list2[b]; else sum = 0; ... if (z >= 0 && z <= 9) sum = sum + list26[b]; else sum = 0; • Branch coverage may be achieved by 2 test cases.

  8. Path CoverageSame Example 3 if (a >= 0 && a <= 9) sum = list1[a]; else sum = 0; if (b >= 0 && b <= 9) sum = sum + list2[b]; else sum = 0; ... if (z >= 0 && z <= 9) sum = sum + list26[b]; else sum = 0; • Path coverage may be achieved by 226 test cases.

  9. Path CoverageSame Example 3 • Path coverage may be achieved by 226 test cases 67,108,864 • If the execution of a test case takes 1 second, this will take 2.13 years.

  10. Statement CoverageExample 4 sum = 0; while (a >= 0 && a <= 9) { sum = list1[a]; a = a + 1; }; if (b >= 0 && b <= 9) sum = list2[b]; else sum = 0; • Statement coverage may be achieved by 2 test cases: • a = 9, b = 3 • a = 9, b = 10.

  11. Branch CoverageSame Example 4 sum = 0; while (a >= 0 && a <= 9) { sum = list1[a]; a = a + 1; }; if (b >= 0 && b <= 9) sum = list2[b]; else sum = 0; • Branch coverage may be achieved by 2 test cases: • a = 3, b = 9 • a = 3, b = 10.

  12. Path CoverageSame Example 4 sum = 0; while (a >= 0 && a <= 9) { sum = list1[a]; a = a + 1; }; if (b >= 0 && b <= 9) sum = list2[b]; else sum = 0; Path coverage may be achieved by 22 test cases: Path coverage may take infinite number of test cases if the loop does not have fixed upper or lower bounds. • a = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and b = 9, 10.

  13. Loop CoverageSame Example 4 sum = 0; while (a >= 0 && a <= 9) { sum = list1[a]; a = a + 1; }; if (b >= 0 && b <= 9) sum = list2[b]; else sum = 0; • Loop coverage may be achieved by 6 test cases: Is this correct? • a = 10 • a = 9 • a = 8 sumis not correct. • a = 1 • a = 0 • a =–1

More Related