Notorious Bugs – BYTE, September byte

Slides:



Advertisements
Similar presentations
Java Control Statements
Advertisements

Control Structures.
Chapter 4: Control Structures I (Selection)
Control Flow Statements: Repetition/Looping
Nested if-else Statements.  Should be indented to make the logic clear.  Nested statement executed only when the branch it is in is executed. For example,
Sorting, Sets, and Selecting - Ed. 2. and 3.: Chapter 10 - Ed. 4.: Chapter 11.
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Fundamental Programming Structures in Java: Control Flow, Arrays and Vectors.
Control Flow Analysis. Construct representations for the structure of flow-of-control of programs Control flow graphs represent the structure of flow-of-control.
3. S/E with Control Structures 3.1 Relational Operators and Expressions 3.2 If and if-else Statements 3.3 The Type Double 3.4 Program Design with the While.
Introduction to Control Statements Presented by: Parminder Singh BCA 5 th Sem. [ Batch] PCTE, Ludhiana 5/12/ Control Statements.
CS-1010 Dr. Mark L. Hornick 1 Selection Statements and conditional expressions.
Testing & Debugging CSC 171 FALL 2004 LECTURE 13.
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
Algorithms and Pseudocode Bioinformatics. Formulating Problems Clarify input and output elements Requires modeling the problem in some concise form Example:
General Computer Science for Engineers CISC 106 Lecture 33 Dr. John Cavazos Computer and Information Sciences 05/11/2009.
Searching Arrays Linear search Binary search small arrays
Python Control of Flow.
CSCI 1730 March 27 th, Text System Programming with C and Unix by Hoover Ch 1: Introduction Ch 2: Bits, Bytes and Data Types Ch 3: Arrays and Strings.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 24.
CSC Java Programming, Fall, 2008 Week 2: Java Data Types, Control Constructs, and their C++ counterparts, September 4.
Perl Practical(?)‏ Extraction and Report Language.
Lecture 4 Control Structures MIT – AITI What are Control Structures? Control structures are a way to alter the natural sequence of execution in.
4.1 Object Operations operators Dot (. ) and new operate on objects The assignment operator ( = ) Arithmetic operators + - * / % Unary operators.
COMP Flow of Control: Branching 1 Yi Hong May 19, 2015.
COMP 6710 Course NotesSlide 7-0 Auburn University Computer Science and Software Engineering Course Notes Set 7: Review of Graphs Computer Science and Software.
CIS 3301 C# Lesson 3 Control Statements - Selection.
Conditionals-part21 Conditionals – part 2 Barb Ericson Georgia Institute of Technology Nov 2009.
Review TEST 2 Chapters 4,5,7. QUESTION For which type of operands does the == operator always work correctly: (a) int, (b) double, or (c) String?
Structured Programming The Basics. Control structures They control the order of execution What order statements will be done in, or whether they will.
Strings program. C Program to Check if a given String is Palindrome #include void main() { char string[25], reverse_string[25] = {'\0'}; int i, length.
Expressions and Control Flow. Expressions An expression is a combination of values, variables, operators, and functions that results in a value y = 3(abs(2x)
A: A: double “4” A: “34” 4.
CSI 3125, Preliminaries, page 1 Control Statements.
2-8 COURSE 2 LESSON 2-8 (For help, go to Lesson 1-6.) Compare. Use, or =. 1.0 – 22.| – 6| – – – 4 56.–17 – – |–10|9.5 –1 Graphing.
Expressions and Order of Operations Operators – There are the standard operators: add, subtract, divide, multiply – Note that * means multiply? (No times.
Hossain Shahriar Announcement and reminder! Tentative date for final exam shown below, please choose a time slot! December 19.
Cyclomatic Complexity Philippe CHARMAN Last update:
Chapter 6 Controlling Program Flow with Looping Structures.
Conditional Statements A conditional statement lets us choose which statement will be executed next Conditional statements give us the power to make basic.
White-Box Testing Statement coverage Branch coverage Path coverage
Formal Methods. Objectives To introduce formal methods including multiple logic based approaches for software modelling and reasoning 2.
for( 起始條件 ; 判斷式 ; 條件運算 ){ // 迴圈內容 } while( 判斷式 ){ // 迴圈內容 } do{ // 迴圈內容 } while( 判斷式 ) ;
Topics introduced today (these topics would be covered in more detail in later classes) – Primitive Data types Variables Methods “for” loop “if-else” statement.
Searching Arrays Linear search Binary search small arrays
Discussion 4 eecs 183 Hannah Westra.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Sequence, Selection, Iteration The IF Statement
The switch Statement, and Introduction to Looping
Unit-1 Introduction to Java
Dependence Analysis Important and difficult
C# and the .NET Framework
Expressions and Control Flow in JavaScript
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
Review Operation Bingo
.Net Programming with C#
محاضرة 1: مقدمة للمسـاق و مراجعـة للأساسيـات
Flow of Control.
Summary.
IF Statements.
Solution to problem 4. a) Control flow graph art Start k = i + 2 * j
Conditionals.
Console.WriteLine(“Good luck!”);
The Java switch Statement
Program Flow.
Whitebox Testing.
Random Variables A random variable is a rule that assigns exactly one value to each point in a sample space for an experiment. A random variable can be.
        Linear Search 線性搜尋: char names[100][10];
SEQUENCE Start Initial situation Step 1 Step 2 Step 3 End
Lesson 3. Controlling program flow. Loops. Methods. Arrays.
Presentation transcript:

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

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

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

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

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

Sequence

Selection – if statement

Selection – if-else statement

Selection – case statement

Loop

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

2N Paths