ECE355 Fall 2004Software Reliability1 ECE-355 Tutorial Jie Lian.

Slides:



Advertisements
Similar presentations
Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Advertisements

DATAFLOW TESTING DONE BY A.PRIYA, 08CSEE17, II- M.s.c [C.S].
Path Analysis Why path analysis for test case design?
Intermediate Code Generation
Course Outline Traditional Static Program Analysis Software Testing
Chapter 9 Code optimization Section 0 overview 1.Position of code optimizer 2.Purpose of code optimizer to get better efficiency –Run faster –Take less.
Chapter 10 Code Optimization. A main goal is to achieve a better performance Front End Code Gen Intermediate Code source Code target Code user Machine-
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
What is an Algorithm? (And how do we analyze one?)
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
1 Software Testing and Quality Assurance Lecture 36 – Software Quality Assurance.
CS 536 Spring Intermediate Code. Local Optimizations. Lecture 22.
1 Intermediate representation Goals: –encode knowledge about the program –facilitate analysis –facilitate retargeting –facilitate optimization scanning.
1 CS 201 Compiler Construction Lecture 1 Introduction.
Intermediate Code. Local Optimizations
BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp
Testing an individual module
Compiler Construction A Compulsory Module for Students in Computer Science Department Faculty of IT / Al – Al Bayt University Second Semester 2008/2009.
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
Software Testing and QA Theory and Practice (Chapter 15: Software Reliability) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Path testing Path testing is a “design structural testing” in that it is based on detailed design & the source code of the program to be tested. The methodology.
Overview Software Quality Assurance Reliability and Availability
Software faults & reliability Presented by: Presented by: Pooja Jain Pooja Jain.
Software Reliability Model Deterministic Models Probabilistic Models Halstead’s software metric McCabe’s cyclomatic complexity metrix Error seeding Failure.
ECE 355: Software Engineering
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Topic #10: Optimization EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 15 Software Reliability
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Presented By Dr. Shazzad Hosain Asst. Prof., EECS, NSU
CMSC 345 Fall 2000 Unit Testing. The testing process.
What is Three Address Code? A statement of the form x = y op z is a three address statement. x, y and z here are the three operands and op is any logical.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Software Reliability SEG3202 N. El Kadri.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
Lecture 4. RAM Model, Space and Time Complexity
Agenda Introduction Overview of White-box testing Basis path testing
Ch. 1.  High-profile failures ◦ Therac 25 ◦ Denver Intl Airport ◦ Also, Patriot Missle.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 14a: Software Testing Techniques Software Engineering: A Practitioner’s Approach, 6/e Chapter.
1 CS 201 Compiler Construction Introduction. 2 Instructor Information Rajiv Gupta Office: WCH Room Tel: (951) Office.
Compilers Modern Compiler Design
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
1 Control Flow Analysis Topic today Representation and Analysis Paper (Sections 1, 2) For next class: Read Representation and Analysis Paper (Section 3)
Theory and Practice of Software Testing
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Agent program is the one part(class)of Othello program. How many test cases do you have to test? Reversi [Othello]
CSC 395 – Software Engineering Lecture 27: White-Box Testing.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
High-level optimization Jakub Yaghob
Software Testing.
Software Engineering (CSI 321)
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
Software Reliability Models.
CS 201 Compiler Construction
Topic 4: Flow Analysis Some slides come from Prof. J. N. Amaral
Intermediate Code Generation
Taken largely from University of Delaware Compiler Notes
TARGET CODE GENERATION
Review: What is an activation record?
Intermediate Code Generating machine-independent intermediate form.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
CS 201 Compiler Construction
Presentation transcript:

ECE355 Fall 2004Software Reliability1 ECE-355 Tutorial Jie Lian

ECE355 Fall 2004Software Reliability2 Outline Part I: Software Reliability Model –Musa’s Basic Model –Musa/Okumoto Logarithmic Model Part II: Control Flow Graph

ECE355 Fall 2004Software Reliability3 Definition of Software Reliability Reliability is usually defined in terms of a statistical measure for the operation of a software system without a failure occurring Software reliability is a measure for the probability of a software failure occurring Two terms related to software reliability –Fault: a defect in the software, e.g. a bug in the code which may cause a failure –Failure: a derivation of the programs observed behavior from the required behavior

ECE355 Fall 2004Software Reliability4 Parameters of Software Reliability Average total number of failures  (t) Average refers to n independent instantiations of an identical software. Failure intensity (t) Number of failures per time unit, derivative of  (t). Mean Time To Failure (MTTF): t may denote elapsed execution calendar or machine clock time

ECE355 Fall 2004Software Reliability5 Importance of Software Reliability In safety-critical systems, certain failures are fatal. This requires pushing reliability to very high levels at very high costs (code redundancy, hardware redundancy, recovery blocks, n version programming…). In non-safety-critical systems a certain failure rate is usually tolerable. –This is a question of quality of service. –Which failure rate is tolerable is mainly a question of customer acceptance. (customer lifts receiver and receives neither fast busy nor dial tone one every 10/10000 calls?) We will only talk about non-safety-critical systems

ECE355 Fall 2004Software Reliability6 Software Reliability Growth Model (SRG) Purpose of SRG models SRGs rely on observation of failure occurrence and try to predict future failure behavior Two different SRG models (appr 40 models totally): –Musa linear model –Musa/Okomoto logarithmic model

ECE355 Fall 2004Software Reliability7 Basic Assumptions of Musa’s Model Faults are independent and distributed with constant rate of encounter. Well mixed types of instructions, execution time between failures is large compared to instruction execution time. Test space covers use space. (Tests selected from a complete set of use input sets). Set of inputs for each run selected randomly. All failures are observed, implied by definition. Fault causing failure is corrected immediately, otherwise reoccurrence of that failure is not counted.

ECE355 Fall 2004Software Reliability8 Musa’s Basic Model Assumption: decrement in failure intensity function is constant. Consequence: failure intensity is function of average number of failures experienced at any given point in time (= failure probability). – (  ): failure intensity. – 0 : initial failure intensity at start of execution. –  : average total number of failures at a given point in time. –v 0 : total number of failures over infinite time.

ECE355 Fall 2004Software Reliability9 Example 1 Assume that we are at some point of time t time units in the life cycle of a software system after it has been deployed. Assume the program will experience 100 failures over infinite execution time. During the last t time unit interval 50 failures have been observed (and counted). The initially failure intensity was 10 failures per CPU hour. Compute the current (at t) failure intensity:

ECE355 Fall 2004Software Reliability10 Musa/Okumoto Logarithmic Model Decrement per encountered failure decreases:  : failure intensity decay parameter. Example 2 – 0 = 10 failures per CPU hour. –  =0.02/failure. –50 failures have been experienced (  = 50). –Current failure intensity:

ECE355 Fall 2004Software Reliability11 Model Extension (1) Average total number of counted experienced failures (  ) as a function of the elapsed execution time (  ). For basic model For logarithmic model

ECE355 Fall 2004Software Reliability12 Example 3 (Basic Model) 0 = 10 [failures/CPU hour]. v 0 = 100 (number of failures over infinite execution time).  = 10 CPU hours:  = 100 CPU hours:

ECE355 Fall 2004Software Reliability13 Example 4 (Logarithmic Model) 0 = 10 [failures/CPU hour].  = 0.02 / failure.  = 10 CPU hours:  = 100 CPU hours: (63 in basic model) (100 in basic model)

ECE355 Fall 2004Software Reliability14 Model Extension (2) Failure intensity as a function of execution time. For basic model: For logarithmic Poisson model

ECE355 Fall 2004Software Reliability15 Example 5 (Basic Model) 0 = 10 [failures/CPU hour]. v 0 = 100 (number of failures over infinite execution time).  = 10 CPU hours:  = 100 CPU hours:

ECE355 Fall 2004Software Reliability16 Example 6 (Logarithmic Model) 0 = 10 [failures/CPU hour].  = 0.02 / failure.  = 10 CPU hours:  = 100 CPU hours: (3.68 in basic model) ( in basic model)

ECE355 Fall 2004Software Reliability17 Model Discussion Comparison of basic and logarithmic model: –Basic model assumes that there is a 0 failure intensity, logarithmic model assumes convergence to 0 failure intensity. –Basic model assumes a finite number of failures in the system, logarithmic model assumes infinite number. Parameter estimation is major problem: 0, , and v 0. Usually obtained from: –system test, –observation of operational system, –by comparison with values from similar projects.

ECE355 Fall 2004Software Reliability18 Part II: Control Flow Graph (CFG) A graph representation of a set of statements is called a flow graph or control flow graph. Nodes in the flow graph represent computations and the edges represent the flow of control. A basic block is a sequence of consecutive three- address statements in which flow of control enters at the beginning and leaves at the end without halt or possibility of branching except at the end. A CFG consists of a set of basic blocks.

ECE355 Fall 2004Software Reliability19 Three-Address Statements Assignment statements of the form x: = y op z or x: = op z, where op is a binary or unary arithmetic or logical operation. Copy statements x: = y where the value of y is assigned to x. Unconditional jump goto L. Execution jumps to the statement labeled by L. Conditional jump if x relop y goto L. Indexed assignments of the form x: = y[i] and x[i] := y. Address and pointer assignments of the form x := &y, x := *y, and *x := y. Param x and call p, n, and return y, where return value of y is optional. For a procedure call p(x 1, x 2, …, x n ), the transformed three-address statements are: param x 1 param x 2 … param x n, call p, n

ECE355 Fall 2004Software Reliability20 Partition into Basic Blocks Input: A sequence of three-address statements. Output: A list of basic blocks with each three-address statements in exactly one block. Method 1.Determining leaders (the first statement of basic blocks) by three rules: i.The first statement is a leader. ii.Any statement that is the target of a conditional or unconditional goto is a leader. iii.Any statement that immediately follows a goto or conditional goto statement is a leader. 2.For each leader, its basic block consists of the leader and all statements up to but not including the next leader or the end of the program.

ECE355 Fall 2004Software Reliability21 Example I = 1; TI = TV = 0; sum = 0; DO WHILE (v[I] <> –999 and TI = min and v[I] <= max) { TV++; sum = sum + v[I]; } I++; } IF TV >0 ) av = sum/TV; ELSE av = –999 ; … 1I = 1; TI = TV = 0; sum = 0; 2IF (v[I] == –999) GOTO 10 3IF (TI >= 1) GOTO 10 4TI++; 5IF (v[I] < min) GOTO 8 6IF (v[I] > max) GOTO 8 7TV++; sum = sum + v[I]; 8I++; 9GOTO 2 10IF (TV <= 0) GOTO 12 11av = sum/TV; goto 13 12av = –999; 13… While loop IF ELSE Basic Block We do not strictly follow the transformation from source code to three-address statements. Note that each statement with a label is a leader.

ECE355 Fall 2004Software Reliability22 Transformation from Basic Blocks to CFG R4R4 R1R1 R3R3 R5R5 R2R2 R 6 Outer region predicate node … 1I = 1; TI = TV = 0; sum = 0; 2IF (v[I] == –999) GOTO 10 3IF (TI >= 1) GOTO 10 4TI++; 5IF (v[I] < min) GOTO 8 6IF (v[I] > max) GOTO 8 7TV++; sum = sum + v[I]; 8I++; 9GOTO 2 10IF (TV <= 0) GOTO 12 11av = sum/TV; goto 13 12av = –999; 13…

ECE355 Fall 2004Software Reliability23 Cyclomatic Complexity McCabe’s cyclomatic complexity –V(G) = E – N + 2, E: number of edges, N: number of nodes. –V(G) = p + 1, p is a number of predicate (decision) nodes. –V(G) = number of regions (area surrounded by nodes/edges). V(G): upper bound on the number of independent paths –Independent path: A path with at least one new node/edge. Example (pp. 22) : –V(G) = E – N + 2 = 17 – = 6 –V(G) = p + 1 = = 6 –V(G) = 6 Advantage: # of test cases is proportional to the program size.

ECE355 Fall 2004Software Reliability24 References [1] Musa, JD, Iannino, A. and Okumoto, K., “Software Reliability: Measurement, Prediction, Application”, McGraw-Hill Book Company, NY, [2] A. V. Aho, R. Sethi, and J. Ullman, "Compilers: Principles, Techniques, and Tools", Addison-Wesley, Reading, MA, 1986.