Software Logic Mutation Testing Presented by Gary Kaminski.

Slides:



Advertisements
Similar presentations
Formal Methods and Testing Goal: software reliability Use software engineering methodologies to develop the code. Use formal methods during code development.
Advertisements

1 Applications of Optimization to Logic Testing Gary Kaminski and Paul Ammann ICST 2010 CSTVA Workshop.
Course Software Testing & Verification 2013/14 Wishnu Prasetya
Software Testing Logic Coverage. Introduction to Software Testing (Ch 3) © Ammann & Offutt 2 Logic Coverage Four Structures for Modeling Software Graphs.
14004 L5 - © D. Deugo, Lecture 5 Combinational Models (Binder chapter 6)
Presenter: Jyun-Yan Li Design Fault Directed Test Generation for Microprocessor Validation Deepak A. Mathaikutty, Sandeep K. Shukla FERMAT Lab, Virginia.
ECE 331 – Digital System Design
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Testing an individual module
© 2006 Fraunhofer CESE1 MC/DC in a nutshell Christopher Ackermann.
 2000 M. CiesielskiPTL Synthesis1 Synthesis for Pass Transistor Logic Maciej Ciesielski Dept. of Electrical & Computer Engineering University of Massachusetts,
Introduction to Software Testing Chapter 8.2
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Introduction to Software Testing Chapter 5.2 Program-based Grammars Paul Ammann & Jeff Offutt
Of 33 Improving Logic-Based Testing Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA
CMSC 345 Fall 2000 Unit Testing. The testing process.
© Andrew IrelandSoftware Design F28SD2 Software Design (F28SD2): Life-Cycle Perspective - Part 2 Andrew Ireland School of Mathematical & Computer Sciences.
Research seminar 1. Dr. S. Vilkomir, Research directions in software testing. 2. Brandi Amstutz, Combinatorial Approach to Testing Mobile Applications:
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
Agenda Introduction Overview of White-box testing Basis path testing
1 Software Testing. 2 Path Testing 3 Structural Testing Also known as glass box, structural, clear box and white box testing. A software testing technique.
SWE 619 © Paul Ammann Procedural Abstraction and Design by Contract Paul Ammann Information & Software Engineering SWE 619 Software Construction cs.gmu.edu/~pammann/
Testing Testing Techniques to Design Tests. Testing:Example Problem: Find a mode and its frequency given an ordered list (array) of with one or more integer.
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
Disjunctive Normal Form CS 270: Math Foundation of CS Jeremy Johnson.
Software Metric; defect removal efficiency, Cyclomate Complexity Defect Seeding Mutation Testing.
Machine Learning A Quick look Sources: Artificial Intelligence – Russell & Norvig Artifical Intelligence - Luger By: Héctor Muñoz-Avila.
Using Logic Criterion Feasibility to Reduce Test Set Size While Guaranteeing Double Fault Detection Gary Kaminski and Paul Ammann Software Engineering.
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
Software Testing Part II March, Fault-based Testing Methodology (white-box) 2 Mutation Testing.
Introduction to Software Testing Chapter 9.2 Program-based Grammars Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
Computer Science 1 Systematic Structural Testing of Firewall Policies JeeHyun Hwang 1, Tao Xie 1, Fei Chen 2, and Alex Liu 2 North Carolina State University.
Condition Testing. Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition.
1 Using a Fault Hierarchy to Improve the Efficiency of DNF Logic Mutation Testing Gary Kaminski and Paul Ammann ICST 2009.
Mutation Testing Breaking the application to test it.
Boolean Programs: A Model and Process For Software Analysis By Thomas Ball and Sriram K. Rajamani Microsoft technical paper MSR-TR Presented by.
Using Logic Criterion Feasibility to Reduce Test Set Size While Guaranteeing Fault Detection Gary Kaminski and Paul Ammann ICST 2009 March 24 Version.
Dr. Rob Hasker Dr. Brad Dennis. Coverage  Exercise: Each participant: write down 4 instructions Input to procedure: value given by someone, which person.
Mutation Testing Laraib Zahid & Mariam Arshad. What is Mutation Testing?  Fault-based Testing: directed towards “typical” faults that could occur in.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Software Testing and Quality Assurance Syntax-Based Testing (2) 1.
Effectiveness of Pair-wise Testing on Logical Expressions Presented by William Ballance.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 8.2
A Review of Software Testing - P. David Coward
Paul Ammann & Jeff Offutt
Truth Table to Statement Form
TQS - Teste e Qualidade de Software (Software Testing and Quality) Test Case Design: White Box Testing João Pascoal Faria.
Logic Gates and Boolean Algebra
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Introduction to Software Testing Syntactic Logic Coverage Criteria
Coverage-Based Test Design CS 4501 / 6501 Software Testing
Boolean Expressions Lecture No. 10.
Logic Coverage CS 4501 / 6501 Software Testing
Propositional Calculus: Boolean Algebra and Simplification
If statement.
Fabiano Ferrari Software Engineering Federal University of São Carlos
Introduction to Software Testing Chapter 5.2 Program-based Grammars
Moonzoo Kim School of Computing KAIST
Introduction to Software Testing Chapter 3.2 Logic Coverage
Boolean Algebra.
Logic Coverage CS 4501 / 6501 Software Testing
Control Structure Testing
Software Testing Syntax-based Testing.
Introduction to Software Testing Chapter 3.2 Logic Coverage
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

Software Logic Mutation Testing Presented by Gary Kaminski

Overview Introduction and Motivation Logic Faults and Detection Case Study Comparison Context Conclusion

Logic Mutation Testing Process 1)Systematically create program variations (mutants) each containing a single typical logic fault if (a && b)  if (a || b) 2)For each mutant, find an input that distinguishes the original program from the mutant program (killing) - a && b and a || b evaluate to different truth values Focus is on step 1)

Logic Mutation Testing Logic mutants are created by applying mutation operators to Boolean predicates Boolean predicates may come from: 1)UML Diagrams 2) Security Requirements 3) Looping constructs (while / do-while / for) 4) Preconditions for methods (if - then)

Motivation Current mutation systems: –generate excess logic mutants –do not detect certain classes of logic faults Goal: - generate fewer logic mutants - detect more logic faults Assumption: - formally restrict attention to minimal Disjunctive Normal Form (DNF) Boolean predicates

Minimal DNF Terms separated by OR, literals by AND ab + a!c vs. a(b + !c) Make each term true and other terms false ab + ac vs. ab + abc Impossible to remove a literal or term without changing the predicate ab vs. abc + ab!c

Excess Logic Mutants - Example Original: ab + b!c + !bc 1) mutant generated multiple times: ab + _ + !bc 2) equivalent mutants: ac + b!c + !bc 3) mutants guaranteed to be killed by an input that kills some other mutant: !ab + b!c + !bc and cb + b!c + !bc 4) highly effective mutation operators not used: abc + b!c + !bc

Minimal DNF Logic Faults Original: ab + b!c + !bc Expression Negation Fault: !(ab + b!c + !bc) Expression Stuck At Fault 0: FALSE Expression Stuck At Fault 1: TRUE Term Negation Fault: !(ab) + b!c + !bc Term Omission Fault: ab + _ + !bc Scalar Variable Replacement TOF: ab + c!c + !bc TOF generates same mutant twice: ab + _ + !bc

Minimal DNF Logic Faults Original: ab + b!c + !bc Operator Reference Fault+: abb!c + !bc Operator Reference Fault.: a + b + b!c + !bc Operator Reference Fault+0: FALSE + !bc Operator Reference Fault+1: TRUE + !bc Operator Reference Fault.0: FALSE + b!c + !bc Operator Reference Fault.1: TRUE + b!c + !bc

Minimal DNF Logic Faults Original: ab + b!c + !bc Literal Negation Fault: !ab + b!c + !bc Literal Stuck At Fault 0: FALSEb + b!c + !bc Literal Stuck At Fault 1: TRUEb + b!c + !bc Literal Omission Fault: _b + b!c + !bc SVR LOF: bb + b!c + !bc LOF generates same mutant twice original: abc  _bc, a_c, a_c, ab_

Minimal DNF Logic Faults Original: ab + b!c + !bc Literal Reference Fault: ac + b!c + !bc Literal Reference Fault: a!c + b!c + !bc Literal Insertion Fault: abc + b!c + !bc Literal Insertion Fault: ab!c + b!c + !bc LRF and LIF generate equivalent mutants

Logic Fault Minimal DNF Detection Green Arrow – Detection may not hold Black Arrow – Detection always holds Red Box – Mutation Operator does not exist Blue Box – Mutation Operator partially exists Black Box – Mutation Operator exists LOF ORF. LRF LNF TNF LIF TOF LSTF0 ORF.0 ESTF0 ORF+ ORF+0 ENF LSTF1 ORF.1 ORF+1 ESTF1 SVRTOF SVRLOF

Logic Mutation Comparison Original: ab + b!c + !bc 61 mutants vs. 4 LIFs, 3 LOFs, 3 LRFs Equivalent LIF: abc + b!c + !bc LRF: cb + b!c + !bc & ac + b!c + !bc LOF: a_ + b!c + !bc Equivalent LIF: ab + b!c!a + !bc LRFs: ab + !a!c + !bc & ab + b!a + !bc No Equivalent LIFs for term !bc LOFs: ab + b!c + _c & ab + b!c + !b_

Mutation Efficiency Measures Mutation Efficiency Score = Faults Detected - Mutants Generated Mutation Efficiency Ratio = Faults Detected / Mutants Generated FD assumes an input is found to kill the mutant FD includes equivalent mutants detected automatically ab + b!c + !bc Current Mutation Systems: MES: 60 FD - 61 MG = -1 MER: 60 FD / 61 MG =.98 LIF-LRF-LOF MES: 73 FD – 10 MG = 63 MER: 73 FD / 10 MG = 7.30

Case Study Analyzed 19 Boolean predicates in an avionics software system Number of unique literals range: 5 to 13 Compared MES and MER for current mutation systems vs. LIF-LRF-LOF Examined how MES and MER vary based on number of unique literals

Case Study Results LIF-LRF-LOF generated 18% of the mutants current mutation systems would (150 vs. 819) Current mutation systems guarantee detecting 75% of faults LIF-LRF-LOF does (819 vs. 1082) Number of literals matters for MES but not for MER MES = FD – MG and MER = FD / MG CurrentLIF-LRF-LOF MES 0932 MER

Mutation Efficiency Score (FD – MG) vs. Number of Unique Literals

Mutation Efficiency Ratio (FD/MG) vs. Number of Unique Literals

Context: Internal Variable Problem What input values kill a mutant? Mutation may be buried deep in the code Must reach predicate and have mutant predicate and original predicate evaluate to different truth values Partial solutions using constraints exist

Context: Minimal DNF in Practice 1)95% of 20,256 Boolean predicates in avionics software were in minimal DNF* 2) Detected > 99% of corresponding faults in non-minimal DNF Boolean predicates* *Source: Y.T Yu and M.F. Lau. Comparing Several Coverage Criteria for Detecting Faults in Logical Decisions. In Proceedings QSIC 2004: 4th International Conference on Quality Software, Pages

Context: Industry Audience LIF-LRF-LOF for software with Boolean predicates having >= 5 unique literals Exhaustive coverage for < 5 unique literals ab + b!c + bc (8 tests vs. 10 mutants) Avionics software* *Source: J.J Chilenski and S.P. Miller. Applicability of modified condition/decision coverage to software testing. IEE/BCS Software Engineering Journal, 9(5): , September 1994.

Related Work 1)J.J. Chilenski. An Investigation of Three Forms of the Modified Condition Decision Coverage (MCDC) Criterion. Final Technical Report, DOT/FAA/AR-01/18, April Non-Minimal DNF based logic coverage criteria 2) T.Y. Chen, M.F. Lau, and Y.T. Yu. MUMCUT: A Fault-Based Strategy for Testing Boolean Specifications. Software Engineering Conference, (APSEC ’99) Proceedings. Sixth Asia Pacific. Pages Minimal DNF based logic coverage criteria and Double Faults 3) D. Richard Kuhn. Fault Classes and Error Detection Capability of Specification Based Testing. ACM Transactions on Software Engineering and Methodology, 8(4): , October Seminal work in logic fault hierarchy

Conclusion Current logic mutation testing is inefficient Excess mutants generated and faults are missed Fault hierarchy approach based on minimal DNF: detect more faults with less mutants Applications in avionics software

Other Research and Publications Logic Coverage Criteria: Reduce test set size and maintain fault detection Use feasibility of smaller, less expensive component criteria Internal variable problem CoJava and constraint programming Publications: G. Kaminski, G. Williams, and P. Ammann. Reconciling Perspectives of Logic Testing for Software. Submitted to Journal of Software Testing, Verification, and Reliability, January Online.