System To Generate Test Data: The Analysis Program Syed Nabeel.

Slides:



Advertisements
Similar presentations
Chapter 6 Matrix Algebra.
Advertisements

The simplex algorithm The simplex algorithm is the classical method for solving linear programs. Its running time is not polynomial in the worst case.
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke September 1976.
Linear Programming, 1 Max c 1 *X 1 +…+ c n *X n = z s.t. a 11 *X 1 +…+ a 1n *X n  b 1 … a m1 *X 1 +…+ a mn *X n  b m X 1, X n  0 Standard form.
Linear Programming. Introduction: Linear Programming deals with the optimization (max. or min.) of a function of variables, known as ‘objective function’,
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
Chapter 4 Systems of Linear Equations; Matrices Section 2 Systems of Linear Equations and Augmented Matrics.
1 Systems of Linear Equations & Matrices Sections 4.2 & 4.3 After today’s lesson, you will be able to Use terms associated with matrices. Set up and solve.
Lecture 16 Symbolic Mathematics Symbolic mathematics: algebraezplotcalculus © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
1 Copyright © 2015, 2011, 2007 Pearson Education, Inc. Chapter 4-1 Systems of Equations and Inequalities Chapter 4.
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
 Symbolic manipulation with artificial applications …  With little or no connection to the real world…
Math 015 Section 6.1 Equations. Many students like to remember the process for solving linear equations as: any algebra expressions on each side variable.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
LINEAR EQUATIONS IN TWO VARIABLES. System of equations or simultaneous equations – System of equations or simultaneous equations – A pair of linear.
THE REAL NUMBERS College Algebra. Sets Set notation Union of sets Intersection of sets Subsets Combinations of three or more sets Applications.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
1 Chapter 2 Matrices Matrices provide an orderly way of arranging values or functions to enhance the analysis of systems in a systematic manner. Their.
5  Systems of Linear Equations: ✦ An Introduction ✦ Unique Solutions ✦ Underdetermined and Overdetermined Systems  Matrices  Multiplication of Matrices.
1 Systems of Linear Equations & Matrices Sections 4.2 & 4.3 After today’s lesson, you will be able to Use terms associated with matrices. Set up and solve.
Systems of Equations and Inequalities
Solve Systems of Equations By Graphing
Chapter 10 Review: Matrix Algebra
Systems and Matrices (Chapter5)
3.2 Solving Systems Algebraically
Equation --- An equation is a mathematical statement that asserts the equality of twomathematicalstatement expressions. An equation involves an unknown,
Chapter 3 Linear Programming Methods 高等作業研究 高等作業研究 ( 一 ) Chapter 3 Linear Programming Methods (II)
1.2 – Evaluate and Simplify Algebraic Expressions A numerical expression consists of numbers, operations, and grouping symbols. An expression formed by.
Simplex method (algebraic interpretation)
Array Dependence Analysis COMP 621 Special Topics By Nurudeen Lameed
Equations, Inequalities, and Mathematical Models 1.2 Linear Equations
Semester 1 Final Review Lesson 1.1 Variables in Algebra Evaluate the variable expression when x = x.
Systems of Equations and Inequalities Systems of Linear Equations: Substitution and Elimination Matrices Determinants Systems of Non-linear Equations Systems.
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke Presented by: Xia Cheng.
Do Now (3x + y) – (2x + y) 4(2x + 3y) – (8x – y)
Introducing block scheme programming March 17. Algorithm / Flow chart An algorithm or a flowchart is a step-by-step procedure for solving a particular.
1 Copyright © Cengage Learning. All rights reserved. 2. Equations and Inequalities 2.3 Quadratic Equations.
3.1 – Solve Linear Systems by Graphing A system of two linear equations in two variables x and y, also called a linear system, consists of two equations.
§ 6.6 Solving Quadratic Equations by Factoring. Martin-Gay, Beginning and Intermediate Algebra, 4ed 22 Zero Factor Theorem Quadratic Equations Can be.
RECOGNIZING INCONSISTENT LINEAR SYSTEMS. What is an Inconsistent Linear System?  An inconsistent linear system is a system of equations that has no solutions.
GUIDED PRACTICE for Example – – 2 12 – 4 – 6 A = Use a graphing calculator to find the inverse of the matrix A. Check the result by showing.
EXAMPLE 4 Solve linear systems with many or no solutions Solve the linear system. a.x – 2y = 4 3x – 6y = 8 b.4x – 10y = 8 – 14x + 35y = – 28 SOLUTION a.
Part 3 Chapter 9 Gauss Elimination PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies,
EXAMPLE 4 Solve linear systems with many or no solutions Solve the linear system. a.x – 2y = 4 3x – 6y = 8 b.4x – 10y = 8 – 14x + 35y = – 28 SOLUTION a.
Business Mathematics MTH-367 Lecture 14. Last Lecture Summary: Finished Sec and Sec.10.3 Alternative Optimal Solutions No Feasible Solution and.
Chapter 02 (Part II) Introduction to C++ Programming.
Copyright © Cengage Learning. All rights reserved. 7 Systems of Equations and Inequalities.
Lecture 1 Gunjeet kaur Dronacharya group of institutions.
Lecture 3: System Representation
An Introduction to Linear Programming
Algebra 1 Section 6.5 Graph linear inequalities in two variables.
Stat 261 Two phase method.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
5 Systems of Linear Equations and Matrices
Linear programming Simplex method.
Karnaugh Maps (K-Maps)
Solving Linear Inequalities
Algebra: Equations and Inequalities
Solve a system of linear equation in two variables
Chapter 3 The Simplex Method and Sensitivity Analysis
Optimization Algorithm
Introduction to Variables, Algebraic Expressions, and Equations
Linear Algebra Lecture 3.
Linear programming Simplex method.
Overview Part 2 – Circuit Optimization
LINEAR EQUATIONS.
Inequalities Some problems in algebra lead to inequalities instead of equations. An inequality looks just like an equation, except that in the place of.
LINEAR EQUATIONS.
More Properties of Logarithms
Presentation transcript:

System To Generate Test Data: The Analysis Program Syed Nabeel

Phases of the Analysis Program Symbolic Execution Constraint Simplification Inequality Solver Symbolic Representation Generated Test Case

Phase1: Symbolic Execution Symbolic Execution Constraint Simplification Inequality Solver Symbolic Representation Generated Test Case Path Description

Symbolic Execution Assigning expressions instead of values to variable while following a program path Assigning expressions instead of values to variable while following a program path Expression is the representation of the computation that would have evolved to associate value to a variable Expression is the representation of the computation that would have evolved to associate value to a variable

Structures Used in Symbolic Execution Computation Table Computation Table Symbol Table Symbol Table Evolution Graph Evolution Graph

Computation Table Value number: all unary and binary expressions are allocated value numbers Value number: all unary and binary expressions are allocated value numbers Components Of Computation Table Operator Operator Value Number for operands Value Number for operands Computation Value number for the computation Computation Value number for the computation

Example OperatorOp1Op2 Expression Value *X2X3T1 +X1T1T2 +T2C1T3 Assigned Value Numbers B  X1 C  X2 D  X3 Read (UINT) B,C,D A=B+C*D C=A+5 WRITE C Computation Table

Symbol Table Internal Data Structure that maps variables to value numbers generated Internal Data Structure that maps variables to value numbers generated Its values are updated as the program is symbolically executed Its values are updated as the program is symbolically executed

Example OperatorOp1Op2 Expression Value *X2X3T1 +X1T1T2 +T2C1T3 Read (UINT) B,C,D A=B+C*D C=A+5 WRITE C Assigned Value Numbers B  X1 C  X2 D  X3Name Value Number AT2 BX1 C? D? Symbol Table

Example OperatorOp1Op2 Expression Value *X2X3T1 +X1T1T2 +T2C1T3 Read (UINT) B,C,D A=B+C*D C=A+5 WRITE C Assigned Value Numbers B  X1 C  X2 D  X3Name Value Number AT2 BX1 CT3 DX3 Symbol Table

Evolution Graph A directed graph A directed graph Internal representation for expressions Internal representation for expressions Contains representations for several statements and variables Contains representations for several statements and variables

Example Read (UINT) B,C,D A=B+C*D C=A+5 WRITE C

Folding to simplify Evolution Graph Evaluation of constant expressions Evaluation of constant expressionsExampleA=2B=3C=A-B+1 Simplifies the evolution graph Simplifies the evolution graph Can be suppressed if causes a hindrance Can be suppressed if causes a hindrance

Constraint Construction Predicates from conditional statements are inserted into the computation table Predicates from conditional statements are inserted into the computation table Evolution Graph for constraints is extracted from the computation table Evolution Graph for constraints is extracted from the computation table

Additional Constraints Artificial constraints temporarily created to simulate error conditions Artificial constraints temporarily created to simulate error conditions Solution is evaluated for augmented set of constraints Solution is evaluated for augmented set of constraints If solution exists then error is possible If solution exists then error is possible Increases chances of detecting an error Increases chances of detecting an error

Subscript Example Consider an array of X of size 100 Consider an array of X of size 100 Allowable subscripts Allowable subscripts For an array access X(I) symbol S(I) is generated For an array access X(I) symbol S(I) is generated

Question Consider an array of X of size 100 Consider an array of X of size 100 Allowable subscripts Allowable subscripts For an array access X(I) symbol S(I) is generated For an array access X(I) symbol S(I) is generated Any constraints that can be added in this example ? Any constraints that can be added in this example ?

Additional Constraints Additional constraints: S(I)>100 and S(I) 100 and S(I)<1 If any of the above constraints is consistent with existing constraints an error is detected If any of the above constraints is consistent with existing constraints an error is detected

Phase2: Constraint Simplification Symbolic Execution Constraint Simplification Inequality Solver Symbolic Representation Generated Test Case Path Description

Constraint Simplification Before solving inequalities generated as constraints an attempt is made to simplify them if possible Before solving inequalities generated as constraints an attempt is made to simplify them if possible Example: Example: I1-I2<=3*I2 I1-I2<=3*I2 simplifies to simplifies to I1-4*I2<=0 I1-4*I2<=0

ALTRAN for simplification phase ALTRAN a language for algebraic manipulation used for the FORTRAN program constraints ALTRAN a language for algebraic manipulation used for the FORTRAN program constraints Recognize and flag non linear constraints Recognize and flag non linear constraints Manipulate expressions to obtain linear form. Manipulate expressions to obtain linear form. Example :I1/I2 <=7 is transformed to linear expression I1-7*I2<=0 Example :I1/I2 <=7 is transformed to linear expression I1-7*I2<=0

Phase3: Inequality Solver Symbolic Execution Constraint Simplification Inequality Solver Symbolic Representation Generated Test Case Path Description

Phase 3: Inequality Solver Solves the constraints that have been generated and simplified in the previous phases Procedure Each constraint is added one at a time Each constraint is added one at a time On each addition it is checked whether new constraint is consistent with previous solution On each addition it is checked whether new constraint is consistent with previous solution If consistent new constraints are added If consistent new constraints are added If not consistent a new solution is attempted If not consistent a new solution is attempted If all constraints are consistent then the final solution is a test data set that would cause execution of the path If all constraints are consistent then the final solution is a test data set that would cause execution of the path

Algorithm for Inequality Solving Linear programming algorithm Linear programming algorithm MAX O(X) Subject to AX =0 O  Objective Function (a linear function) X  N Vector of unknowns (input variables) B  M Vector of constants A  M*N matrix coefficient matrix for constraints Rules to convert all inequalities to this standard form

To Sum it up…. symbolic execution of a path symbolic execution of a path symbolic representation of the output variables and path constraints in terms of the program's input variables symbolic representation of the output variables and path constraints in terms of the program's input variables Subscript out of bound, division by zero also detected Subscript out of bound, division by zero also detected Using path constraints Using path constraints Test data is generated for a particular path Test data is generated for a particular path Determined that a particular path is infeasible Determined that a particular path is infeasible Linear Programming technique used for equation solving hence is limited to linear constraints Linear Programming technique used for equation solving hence is limited to linear constraints

Discussion Limitations Limitations Program Correctness vs Program Validation Program Correctness vs Program Validation Any other topic brought up Any other topic brought up