Slice Based Testing What’s Slice ?? A program slice is a subset of that program. Varsha Sharma
Origin Story of Slicing Techniques . . ! ! The Original definition was given by Mark Weiser, slicing was only static that time. Bogdan Korel and Janusz Laski introduced dynamic slicing. Varsha Sharma
Also known as Program Slicing Technique... In this we takes a slice of the program for testing particular test conditions or cases and that may affect a value at a particular point of interest . Varsha Sharma
How it Works?? Breaking your code into smaller pieces. Varsha Sharma
Varsha Sharma
Static Slicing Set of all statements that may affect the value of a variable at a program point. Uses static information i.e. a source program. Regression Testing. Varsha Sharma
Static Slicing For variable sum. int z = 10; int n; cin >> n; int sum = 0; if (n > 10) sum = sum + n; else sum = sum - n; cout << "Hey"; Let’s see an Example: Static Slice of the Program Varsha Sharma
Set of all statements that actually affect the value of a variable at a program point. Uses dynamic information i.e. an execution trace. Debugging. Dynamic Slicing Varsha Sharma
For variable sum when n=22 . int z = 10; int n; cin >> n; int sum = 0; if (n > 10) sum = sum + n; else sum = sum - n; cout << "Hey"; Let’s see an Example: Dynamic Slice of the Program Dynamic Slicing Varsha Sharma
int z = 10; int n; cin >> n; int sum = 0; if (n > 10) sum = sum + n; else sum = sum - n; cout << "Hey"; int n; cin >> n; int sum = 0; if (n > 10) sum = sum + n; int n; cin >> n; int sum = 0; if (n > 10) sum = sum + n; else sum = sum - n; Static Slicing VS Dynamic Slicing Varsha Sharma
Object Oriented Testing As information systems are becoming more complex, the object-oriented paradigm is gaining popularity because of its benefits in analysis, design, and coding. Varsha Sharma
Varsha Sharma
Levels/Techniques of Object Oriented Testing : Varsha Sharma
Class Testing Process class to be tested test cases results software engineer How to test? Varsha Sharma
Developing Test Cases Points to be noticed : Identify each test case uniquely State the purpose of the test All the states of object that is to be tested should be specified. External Conditions should be mentioned Automated unit testing tools facilitate these requirements Varsha Sharma
Issues in Object Oriented Testing ?? Additional testing techniques are required to test additional Dependencies in Object Oriented System. it is not possible to test the class dynamically the concept of inheritance & polymorphism opens various issues Encapsulation in class may create obstacles while testing. State of object is difficult to acquire. Varsha Sharma