Software Verification and Validation Lecture No 22 Module


























- Slides: 26

Software Verification and Validation Lecture No. 22

Module 169: Software Testing Support for Java related IDE

Software Testing support in Java related IDEs § We have already seen unit test development using Microsoft Visual Studio § We now have a look at how to use Eclipse for the same purpose § We intend to see how we can make use of Java related environments for the same purpose

Software Testing support in Java related IDEs

Software Testing support in Java related IDEs § Right Click on Project Name -> Add -> New Item

Right Click on Package and Add Class Software Testing support in Java related IDEs

Software Testing support in Java related IDEs package src; public class My. BSearch { public int search(int key, int[] elem. Array) { int bottom = 0; int top = elem. Array. length - 1; int mid; int index = -1; boolean found = false; while (bottom <= top && found == false) { mid = (top + bottom) / 2; if (elem. Array[mid] == key) { index = mid; found = true; else { return index; if (elem. Array[mid] < key) bottom = mid + 1; else } } top = mid - 1; return index; }} }

Software Testing support in Java related IDEs § Rt. Click Project Name -> Other -> …

Software Testing support in Java related IDEs § Add reference to the SUT Project

Software Testing support in Java related IDEs

Software Testing support in Java related IDEs

Software Testing support in Java related IDEs

Code Analysis Software Testing support in Java related IDEs

Software Testing support in Java related IDEs

Software Testing support in Java related IDEs § We have seen § How can we use Eclipse for unit testing of code written in Java § We have used Eclemma project for generating coverage. END

Module 170: Miscellaneous Program Representations for Testing

Miscellaneous Program Representations for Testing § Static program representations § Abstract syntax tree; § Control flow graph; § Program dependence graph; § Call graph; § Points-to relations. § Dynamic program representations § Control flow trace, address trace and value trace; § Dynamic dependence graph; § Whole execution trace;

Miscellaneous Program Representations for Testing § Abstract Syntax Tree (AST): § is a finite, labeled, directed tree, where the internal nodes are labeled by operators, and the leaf nodes represent the operands of the operators.

Miscellaneous Program Representations for Testing § Program Dependence Graph: § S data depends T if there exists control flow path from T to S and variable is defined at T, used at S. 1 2 3 4 5 6 7 8 9 10

Miscellaneous Program Representations for Testing § Control Dependence graph: § Intuitively, Y is controldependent on X iff X directly determines whether Y executes (statements inside one branch of a predicate are usually control dependent on the predicate) § there exists a path from X to Y such that every node in path other than X and Y is post-dominated by Y § X is not strictly postdominated by Y

Miscellaneous Program Representations for Testing § Control Dependence graph: X Not post-dominated by Y Y Every node is postdominated by Y § Control flow trace captures complete path followed by a program during an execution. § Analysed to determine execution frequencies of shorter program paths

Miscellaneous Program Representations for Testing 1: sum=0 2: i=1 3: while ( i<N) do 4: i=i+1 5: sum=sum+i 6: print (sum) N=2: 11: sum=0 i=1 31: while ( i<N) do 41: i=i+1 sum=sum+i 32: while ( i<N) do 42: i=i+1 sum=sum+i 33: while ( i<N) do 61: print (sum) 11 21 31 41 51 32 42 52 33 6 1 A More Compact CFT: < T, T, F > 11 31 41 32 42 33 6 1

Miscellaneous Program Representations for Testing § We have seen a couple of program representations for testing. END

Module 171: Software Verification and Validation – Conclusion

Software Verification and Validation – Conclusion § We have covered basic definitions related to software verification and validation § We have covered verification activities § Now we know how to do inspections, walkthroughs and formal reviews § We have seen validation related activities § Now we can do testing a unit, integration and (sub-) system level testing

Software Verification and Validation – Conclusion END § We know difference between functional and nonfunctional aspects of testing § We can perform load, volume, stress testing § We know reliability testing § We can perform user acceptance testing § We can collect and analyse testing related metrics § We have good command over related testing tools