1 / 26

System To Generate Test Data: The Analysis Program

System To Generate Test Data: The Analysis Program. Syed Nabeel. Phases of the Analysis Program. Symbolic Execution. Constraint Simplification. Symbolic Representation. Inequality Solver. Generated Test Case. Symbolic Execution. Constraint Simplification. Symbolic Representation.

leander
Download Presentation

System To Generate Test Data: The Analysis Program

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. System To Generate Test Data:The Analysis Program Syed Nabeel

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

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

  4. Symbolic Execution • 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

  5. Structures Used in Symbolic Execution • Computation Table • Symbol Table • Evolution Graph

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

  7. Example 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

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

  9. Example Assigned Value Numbers BX1 CX2 DX3 Read (UINT) B,C,D A=B+C*D C=A+5 WRITE C Symbol Table

  10. Example Assigned Value Numbers BX1 CX2 DX3 Read (UINT) B,C,D A=B+C*D C=A+5 WRITE C Symbol Table

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

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

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

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

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

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

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

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

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

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

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

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

  23. 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 • On each addition it is checked whether new constraint is consistent with previous solution • If consistent new constraints are added • 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

  24. Algorithm for Inequality Solving Linear programming algorithm MAX O(X) Subject to AX<=B and X>=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

  25. To Sum it up…. • symbolic execution of a path • 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 • Using path constraints • Test data is generated for a particular path • Determined that a particular path is infeasible • Linear Programming technique used for equation solving hence is limited to linear constraints

  26. Discussion • Limitations • Program Correctness vs Program Validation • Any other topic brought up

More Related