Andrea Calvagna – University of Catania - IT Angelo Gargantini – University of Bergamo – IT TAP 2009 – Zürich – 2nd July 2009 C OMBINING S ATISFIABILITY.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Modeling issues Book: chapters 4.12, 5.4, 8.4, 10.1.
Comp 122, Spring 2004 Order Statistics. order - 2 Lin / Devi Comp 122 Order Statistic i th order statistic: i th smallest element of a set of n elements.
© Telcordia Technologies 2004 – All Rights Reserved AETG Web Service Tutorial AETG is a service mark of Telcordia Technologies. Telcordia Technologies.
Testing Constrained Combinations Vera Pironska QA Engineer XAML Team 1 XAML Team 1 Telerik QA Academy Telerik QA Academy.
Proof of correctness; More reductions
Constraint Satisfaction Problems Russell and Norvig: Chapter
Complexity Classes: P and NP
Comparative Succinctness of KR Formalisms Paolo Liberatore.
Constraint Satisfaction Problems
Constraint Optimization We are interested in the general non-linear programming problem like the following Find x which optimizes f(x) subject to gi(x)
Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
Lecture 2 May 21, 2013 Software Testing Research Dr. Sergiy Vilkomir 2013 REU Program at ECU Software Testing - Foundations, Tools, and Applications.
Pairwise Testing. A case study (from Lee Copeland’ book) A web-based application has been written to work with eight different browsers – IE 5.0, 5.5,
Mining Compressed Frequent- Pattern Sets Dong Xin, Jiawei Han, Xifeng Yan, Hong Cheng Department of Computer Science University of Illinois at Urbana-Champaign.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
An Evaluation of MC/DC Coverage for Pair-wise Test Cases By David Anderson Software Testing Research Group (STRG)
IPOG: A General Strategy for T-Way Software Testing
RANJAN BHAMBROO Experimental Investigation of Effectiveness of Logical Expressions Using t-way Testing.
Constraint Models for the Covering Test Problems Authors: Brahim Hnich, Steven D. Prestwich, Evgeny Selensky, Barbara M. Smith Speaker: Pingyu Zhang CSE.
Today’s Agenda  HW #1 Due  Quick Review  Finish Input Space Partitioning  Combinatorial Testing Software Testing and Maintenance 1.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Sharing Aggregate Computation for Distributed Queries Ryan Huebsch, UC Berkeley Minos Garofalakis, Yahoo! Research † Joe Hellerstein, UC Berkeley Ion Stoica,
Rick Kuhn Computer Security Division
Dynamic lot sizing and tool management in automated manufacturing systems M. Selim Aktürk, Siraceddin Önen presented by Zümbül Bulut.
MAE 552 – Heuristic Optimization Lecture 5 February 1, 2002.
Triple Patterning Aware Detailed Placement With Constrained Pattern Assignment Haitong Tian, Yuelin Du, Hongbo Zhang, Zigang Xiao, Martin D.F. Wong.
Constraint Satisfaction Not all problems are solved by a sequential series of steps. How do we solve other types of problems?
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.
January 27, 2002 ECEN5033 University of Colorado -- Class Testing 1 Specifying interactions Remainder of slides assume Operations defined by a class are.
Flow Models and Optimal Routing. How can we evaluate the performance of a routing algorithm –quantify how well they do –use arrival rates at nodes and.
MIC’2011 1/58 IX Metaheuristics International Conference, July 2011 Restart strategies for GRASP+PR Talk given at the 10 th International Symposium on.
Advanced Algorithm Design and Analysis (Lecture 13) SW5 fall 2004 Simonas Šaltenis E1-215b
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 3 Logic Representations (Part 2)
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
© ETH Zürich Eric Lo ETH Zurich a joint work with Carsten Binnig (U of Heidelberg), Donald Kossmann (ETH Zurich), Tamer Ozsu (U of Waterloo) and Peter.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
© 2006 Pearson Education 1 More Operators  To round out our knowledge of Java operators, let's examine a few more  In particular, we will examine the.
1 Test Selection for Result Inspection via Mining Predicate Rules Wujie Zheng
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
Schreiber, Yevgeny. Value-Ordering Heuristics: Search Performance vs. Solution Diversity. In: D. Cohen (Ed.) CP 2010, LNCS 6308, pp Springer-
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 9: Test Generation from Models.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
HANGMAN OPTIMIZATION Kyle Anderson, Sean Barton and Brandyn Deffinbaugh.
CS162 Week 8 Kyle Dewey. Overview Example online going over fail03.not (from the test suite) in depth A type system for secure information flow Implementing.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
CSE280Stefano/Hossein Project: Primer design for cancer genomics.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
A PRELIMINARY EMPIRICAL ASSESSMENT OF SIMILARITY FOR COMBINATORIAL INTERACTION TESTING OF SOFTWARE PRODUCT LINES Stefan Fischer Roberto E. Lopez-Herrejon.
Wishnu Prasetya Software Testing URL:
Software Testing and Quality Assurance Practical Considerations (1) 1.
Wolfgang Runte Slide University of Osnabrueck, Software Engineering Research Group Wolfgang Runte Software Engineering Research Group Institute.
The NP class. NP-completeness
Combinatorial Interaction Testing for Automated Constraint Repair
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Outline of the Chapter Basic Idea Outline of Control Flow Testing
IPOG: A General Strategy for T-Way Software Testing
Overview Part 2 – Circuit Optimization
CSE 6408 Advanced Algorithms.
Sudoku.
Automatic Test Generation for N-way Combinatorial Testing
George Mason University
IPOG: A general strategy for t-way software testing by Lei, Yu, IEEE /2/2019 Mehra N Borazjany.
Area Coverage Problem Optimization by (local) Search
Presentation transcript:

Andrea Calvagna – University of Catania - IT Angelo Gargantini – University of Bergamo – IT TAP 2009 – Zürich – 2nd July 2009 C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

O UTLINE Background on Combinatorial Interaction Testing constraints logic approach to CIT [TAP 08] Test generation by satisfiability solving in the presence of constraints – by using Yices Heuristics - for ordering test predicates Experimental assessment C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

I NTERACTION TESTING IT : interaction testing identify independent features and representative values (the inputs) test the interaction between them highly configurable systems Software for families of products (like cell phones) Sw like gcc compiler > 1400 optional features … C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

H OW MUCH TO TEST ? 34 switches = 2 34 = 1.7 x possible inputs = 1.7 x tests? Every possible combination of inputs? Which interactions cause faults? C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

C OMBINATORIAL APPROACH Pairwise combination instead of exhaustive Generate combinations that efficiently cover all pairs of values Extended by t-wise: test all the combinations of t values Rationale: most failures are triggered by single values or combinations of a few values. Covering pairs (triples,…) reduces the number of test cases, but reveals most faults C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

E XAMPLE 3 variables with 3 values each: 3 3 = 27 possible combinations Combinatorial testing with much fewer tests Display ModeColorScreen size full-graphicsMonochromeHand-held Low resolution16-bitLaptop text-onlyTrue-colorFull-size C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

T EST S UITE TestColorDisplay Mode Screen Size 1MonochromeFull- graphics Hand-held 216-bitText-onlyLaptop 3True-colorFull- graphics Hand-held 4……… C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING One test covers many combinations: e.g. Test 1 covers 3 pairs: (Monochrome, Full-graphics) (Monochrome, Hand-held) (Full-graphics, Hand-held) pairwise testing can be achieved by only 9 tests combinations with 10 tests; tests; …

CIT EFFECTIVENESS Experiments show that CIT is effective finds faults that traditional testing may be not able to find efficient A low degree of interaction between inputs can already discover most faults Pairwise is the most used Never with interaction > 6 C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

M ETHODS FOR BUILDING CIT TEST SUITES Methods and tools IPO, AETG, PICT, TestCover, … Main goal: producing small test suites Because the problem of generating a minimum test suit for combinatorial testing is NP-complete, most methods and tools use a greedy approach C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

A DDING CONSTRAINTS Constraints express relations among inputs: a valid test must not violate the constraints E.g. if the display mode is in text-only, the color is monochrome Constrained CIT Only few test generation methods support constraints, all of them only as forbidden tuples Goal: supporting expressive constraints Easier to obtain from the requirements C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

L OGIC APPROACH TO CCIT [ TAP 08] formalize pairwise testing: express each pair as a corresponding logical expression, a test predicate p1 = v1 /\ p2 = v2 p1 and p2 are inputs, v1 and v2 their values Similarly, the t-wise coverage can be modeled by a set of test predicates, each of the type p1 = v1 /\ p2 = v2 /\ … /\ pt = vt C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

T EST = LOGICAL MODEL test: an assignment to all the inputs of the system a test ts covers a test predicate tp if and only if it is a model of tp: ts |= tp Finding a test suite finding a model for each test predicate C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

A DDING CONSTRAINTS With the constraints c1,…, cn, a test is a model of tp and the constraints c_i ts |= tp /\ c1 /\ … /\ cn the constraints become first class citizens and they can be represented by logical expressions too Finding tests becomes a problem of finding a model of a complex expression many techniques like, constraint solvers, model checkers [AFM08], SAT solver, SMT solvers … C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

Y ICES [ CSL. SRI. COM ] Efficient SMT solver that decides the satisfiability of arbitrary formulas Expressive language for constraints and input models Powerful algorithms to find models C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING YICES Test predicate constraints Model = test

T EST S UITE GENERATION A SIMPLIFIED VERSION Test predicates Input model Test suite builder Test predicate Model= test constraints YICES C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

M ONITORING AND REDUCTION Monitoring: A test covers may cover several test predicates which can be removed from the pool Reduction: at the end, a minimal set of tests that cover all the test predicates can be found by a greedy algorithm t1 t2 C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

C OLLECTING Test suite builder Model = test that covers all the test predicates collected YICES Collected test predicates tp1 /\ tp2 /\ tp3 Instead of one test for every tp, collect the tps to build a conjoint C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

O RDERING In which order test predicates can be collected? First simple two policies: 1. the order in which tp are generated 2. random order C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

R ANDOM O RDERING non deterministic ordering Like most CIT approaches: run the method 50 times and then take the best result C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING GOAL: finding a deterministic ordering that performs as better as the random ordering Best result = min test suite Worst result = max test suite

D ETERMINISTIC O RDERING P OLICIES C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING Several criteria for ordering the test predicates can be defined Looking at the tests already generated and at the test predicates still to cover

D ETERMINISTIC O RDERING P OLICIES touchCounting explored assignments count the number of assignment var = val contained in the tps which are already contained in a test of the test suite and take the tp which has fewer assignments already touched minLeast used assignments Consider only the least used assignment in a tp maxMost used assignment Consider only the most used assignment in the tp devEven usage of assignments Consider the standard deviation in the usage count an try to keep the usage even C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING /c variants Consider not only the tests in the test suite (test already generated) but also the other test predicates in the collected test predicate

C ASE S TUDIES 13 specifications with constraints taken from the literature From 3 ^3 to 8.3 x 10^6 combinations From 6 to 50 constraints (forbidden tuples) C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

E XPERIMENTAL R ESULTS C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING Among policies: One policy (touch/c) performed always better except in two cases in which touch performed better As generated: bad policy

C OMPARISON WITH RANDOM C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING random max min avg Bad policies: worse than average of random ordering Good policies: better than average of random ordering

C OMPARISON WITH RANDOM Best heuristicstouch/cmeaning better than minneverRandom is still a viable option if one can run the algorithms several (at least 50) times like min3/13 better than avg9/13Touch/c gives good results better than max12/13 Like max1/13If one can run the algorithms only once, a deterministic policy can guarantee better or equal results Worst than maxNeverNo risk in using touch/c C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING

C ONCLUSIONS Logic approach can be applied to constrained combinatorial testing It allows a more natural (and expressive) formalization of constraints Good heuristics are defined to order the test predicates and obtain small test suites Random ordering still useful in case of unlimited resources Prototype tool available at C ALVAGNA & G ARGANTINI - C OMBINING S ATISFIABILITY S OLVING AND H EURISTICS TO C ONSTRAINED C OMBINATORIAL I NTERACTION T ESTING