Presentation is loading. Please wait.

Presentation is loading. Please wait.

Notorious Bugs – BYTE, September byte

Similar presentations


Presentation on theme: "Notorious Bugs – BYTE, September byte"— Presentation transcript:

1 Notorious Bugs – BYTE, September 1995 http://www. byte
1987 : Therac-25 – The Bug that killed

2 Notorious Bugs – BYTE, September 1995 http://www. byte
1990: AT&T long distance break down

3 Notorious Bugs – BYTE, September 1995 http://www. byte
1991: Patriot Missile – Hitting own barracks, leaving 28 dead and 98 wounded.

4 Program to test for two equal strings Test cases:
isEqual (“cat”, “dog”) - expected false isEqual (“Testing”, “Testing”) - expected true isEqual (“house”, “home”) - expected false

5 equal = strlen(string1) == strlen(string2);
if (equal) for (i = 0; i < strlen(string1); i++) equal = string1[i] == string2[i]; return equal;

6 Sequence

7 Selection – if statement

8 Selection – if-else statement

9 Selection – case statement

10 Loop

11 Flow graph for bubble sort
1 sorted = false; // 1 while (!sorted) { // 2 sorted = true; for (int i = 0; i < SIZE-1; i++) { // 3 if (a[i] > a[i+1]) { // 4 swap(a[i], a[i+1]); // 5 sorted = false; } } //6 } //7 //8 2 3 4 5 6 7 8

12 2N Paths


Download ppt "Notorious Bugs – BYTE, September byte"

Similar presentations


Ads by Google