Wishnu Prasetya Software Testing URL:

Slides:



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

SSA and CPS CS153: Compilers Greg Morrisett. Monadic Form vs CFGs Consider CFG available exp. analysis: statement gen's kill's x:=v 1 p v 2 x:=v 1 p v.
White Box and Black Box Testing Tor Stålhane. What is White Box testing White box testing is testing where we use the info available from the code of.
Model Based Testing Course Software Testing & Verification 2013/14 Wishnu Prasetya.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Ch6: Software Verification. 1 White-box testing  Structural testing:  (In)adequacy criteria  Control flow coverage criteria.
CSE503: SOFTWARE ENGINEERING SYMBOLIC TESTING, AUTOMATED TEST GENERATION … AND MORE! David Notkin Spring 2011.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION TESTING II Autumn 2011.
Using Search in Problem Solving
White Box Testing and Symbolic Execution Written by Michael Beder.
SIM5102 SOFTWARE EVALUATION
White Box Testing and Symbolic Execution Written by Michael Beder.
White Box Testing Techniques Dynamic Testing. White box testing(1) Source code is known and used for test design While executing the test cases, the internal.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
Ch6: Software Verification. 1 Statement coverage criterion  Informally:  Formally:  Difficult to minimize the number of test cases and still ensure.
White Box Testing and Symbolic Execution Written by Michael Beder.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Data Dependence Based Testability Transformation in Automated Test Generation Presented by: Qi Zhang.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Chapter 7Louden, Programming Languages1 Chapter 7 - Control I: Expressions and Statements "Control" is the general study of the semantics of execution.
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
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.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Systems Verification and Validation Laboratory Assignment 3
System/Software Testing
CUTE: A Concolic Unit Testing Engine for C Technical Report Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
Coverage Literature of software testing is primarily concerned with various notions of coverage Four basic kinds of coverage: Graph coverage Logic coverage.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Wishnu Prasetya WLP for Automated Testing.
White-box Testing.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
Paul Ammann & Jeff Offutt
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke Presented by: Xia Cheng.
White Box Testing Arun Lakhotia University of Southwestern Louisiana P.O. Box Lafayette, LA 70504, USA
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Regression. We have talked about regression problems before, as the problem of estimating the mapping f(x) between an independent variable x and a dependent.
1 Implicant Expansion Methods Used in The BOOM Minimizer Petr Fišer, Jan Hlavička Czech Technical University, Karlovo nám. 13, Prague 2
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
CUTE: A Concolic Unit Testing Engine for C Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION SYMBOLIC TESTING Autumn 2011.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
CS223: Software Engineering Lecture 26: Software Testing.
Software Testing.
Software Testing.
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Software Engineering (CSI 321)
CompSci 230 Software Construction
About the Presentations
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Local Search Algorithms
Structural testing, Path Testing
White-Box Testing.
Paul Ammann & Jeff Offutt
Software Testing (Lecture 11-a)
White-Box Testing.
How Hard Can It Be?.
Paul Ammann & Jeff Offutt
Software Testing: A Research Travelogue
CUTE: A Concolic Unit Testing Engine for C
The Zoo of Software Security Techniques
Local Search Algorithms
CSE 1020:Software Development
Visual Algebra for Teachers
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Wishnu Prasetya Software Testing URL:

Content Chapter 1 of LN. Here I will just give you a summary of the chapter: Coverage White box testng Black box testing 2

Testing vs Verification Verification : show that all possible executions satisfy the given specification. Expensive Testing : show that at least few executions satisfy the specification. not trivial to determine which executions to choose not trivial to figure out how to trigger those executions (undecidable) 3 tax(income) { if (income  10000) return 0 ; income := income – ; if (income  10000) return 0.1 * income ; return * (income – 10000) ; }

Coverage 4 E.g. CFG-based coverage: Try to cover all nodes, or all edges Try to cover all paths, or all prime paths, or all linearly independent paths

Automated testing Consider a simplified case of a program f(x) that returns a value y. A specification of f is a predicate S(x,y). A test-case for f is just an instance of x. Automated testing here means: the generation of test- cases for f. S is a so-called “test-oracles”. While inputs can be generated, no algorithm can guess what’s in your mind. So, there is no way to “generate” S. Coverage problem: come up with an instance of x, such that the resulting execution covers some target c (undecidable). 5

From Unit Tetsing Tool Competition 2015 Benchmarking of automated unit testing tools for Java; “unit testing” at the class level. 63 classes from various open source projects Base lines: randoop (random testing tool), human testers. Tools  all exploit reflection T3 (random + pair-wise) GRT (guided random + light static analysis) JTexpert (guided random + light static analysis) Mosa (evolutionary algorithm + light static analysis) Evosuite (evolutionary algorithm + light static analysis + memetic) Commercial (secret) 6

From Unit Tetsing Tool Competition 2015 Rando op HumanT3GRTJTexpe rt MosaEvosuit e CT cov b cov m Tgen1.77h23h0.85h4.6h1.55h1.48h6.5h1.01h 7

Cov. problem as a search problem 8 Consider again the example program; is the target to cover. The program is extended with “instrumentation” ; for simplicity, fit is a global-var. The problem can be re-expressed to searching an input for tax, such that the value of “fit” is minimized. tax(income) { fit := max(0, income) if (income  10000) return 0 ; income := income – ; fit += min(0, income) if (income  10000) return 0.1 * income ; return * (income – 10000) ; }

Hill climbing (actually hill descent here) start with some input vector i adjust i, if this improves fit, repeat the process. stop if no improvement is obtained. you can get stuck in a local-minimum other search-algorithgms, e.g. genetic 9 income fit

Using “symbolic execution” Consider a path p in the program f(x) that pass a certain target node c. The linearized statement that corresponds to p, is the sequence of assignments and program calls along p. We convert all branching conditions along p to the corresponding assert, and in the “right orientation”. let’s ignore loop and exception for now. Suppose A is the wlp of this linearized statement over “true” as the post-condition. For any x satisfying A, executing f(x) will covers c  solving the coverage problem. 10

Example an LS covering assert income > ; tax := 0 ; income := income – ; assert income > ; wlp LS true = income > /\ income > Any solution of that wlp will cover 11 tax(income | tax) { if (income  10000) tax := 0 ; else{ income := income – ; if (income  10000) tax := 0.1* income ; else tax := * (income – 10000) ; }

Issues with the wlp-based approach What if there are multiple paths leading to the target c? choose one; catch: the chosen path turns out to be unfeasible. consider them all (the resulting wlp would be just a disjunction of each path’s wlp). Catch: can be wastful. What if the route to c has to pass a loop? you can do [loop] k unrolling, but again with the risk that the unrolled paths turn out to be unfeasible. 12

Combined concrete and symbolic execution We execute the program and collect conditions to satisfy. Suppose we start with f(0,0) goes the wrong way at the first guard. Generate the condition “y ≥ 100” suppose we solve the condition with y=100, then we try f(0,100). This goes the wrong way in the second guard. Generate the condition “y ≥ 200”. We now need to solve both “y ≥ 100” and “y ≥ 200”. The solution would now take us to 13 f(x,y) { while x<100 do x++ ; if (y<x) return ; while x<200 do x++ ; if (y<x) return ; }

T3 test against a Java class a test-case is a meta representation of a sequence of calls to the class’ methods and constructors a large number of these meta sequences can be generated, executed, and inspected can inspect/verify LTL, Hoare triples, algebraic equations has modules to “mine” specifications 14

Experimentation project and thesis projects within automated testing TP: will a combined random testing and wlp-based symbolic execution deliver better performance (coverage and time) than search-based variations? the whole Unit Testing Competition infrastructure is available for study EP: evolutionary and memetic improvements of T3’s meta sequences. 15