Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing III No reading Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.

Slides:



Advertisements
Similar presentations
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
Advertisements

Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
White-Box Testing Techniques IV
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
MUTATION TESTING. Mutation testing is a technique that focuses on measuring the adequacy (quality) of test data (or test cases). Modify a program by introducing.
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
An Analysis and Survey of the Development of Mutation Testing by Yue Jia and Mark Harmon A Quick Summary For SWE6673.
Copyright © 2010 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
CSE503: SOFTWARE ENGINEERING TESTING David Notkin Spring 2011.
1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.
Exam 1 Review u Scores Min 30 Max 96 Ave 63.9 Std Dev 14.5.
Swami NatarajanJune 17, 2015 RIT Software Engineering Reliability Engineering.
A CONTROL INSTRUMENTS COMPANY The Effectiveness of T-way Test Data Generation or Data Driven Testing Michael Ellims.
Software Quality Control Methods. Introduction Quality control methods have received a world wide surge of interest within the past couple of decades.
SE 450 Software Processes & Product Metrics Reliability Engineering.
(c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 1 Fault-Based Testing.
(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 1 Functional testing.
(c) 2007 Mauro Pezzè & Michal Young Ch 1, slide 1 Software Test and Analysis in a Nutshell.
Review for Exam 2 Some important themes from Chapters 6-9 Chap. 6. Significance Tests Chap. 7: Comparing Two Groups Chap. 8: Contingency Tables (Categorical.
Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce.
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
1 1 Slide Statistical Inference n We have used probability to model the uncertainty observed in real life situations. n We can also the tools of probability.
Introduction to Software Testing Chapter 5.2 Program-based Grammars Paul Ammann & Jeff Offutt
Software Testing and Validation SWE 434
1 Validation & Verification Chapter VALIDATION & VERIFICATION Very Difficult Very Important Conceptually distinct, but performed simultaneously.
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
What is Mutation Testing ? The premise in mutation testing is that small changes are made in a module and then the original and mutant modules are compared.
Copyright © 2009 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
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.
Test Drivers and Stubs More Unit Testing Test Drivers and Stubs CEN 5076 Class 11 – 11/14.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Black-box Testing.
Stat 112: Notes 2 Today’s class: Section 3.3. –Full description of simple linear regression model. –Checking the assumptions of the simple linear regression.
Exam 1 Review u Scores Min 30 Max 96 Ave 63.9 Std Dev 14.5.
Mutation Testing G. Rothermel. Fault-Based Testing White-box and black-box testing techniques use coverage of code or requirements as a “proxy” for designing.
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
Testing CSE 160 University of Washington 1. Testing Programming to analyze data is powerful It’s useless (or worse!) if the results are not correct Correctness.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
CSE SW Metrics and Quality Engineering Copyright © , Dennis J. Frailey, All Rights Reserved CSE8314M13 8/20/2001Slide 1 SMU CSE 8314 /
Week 12 - Monday.  What did we talk about last time?  Defining classes  Class practice  Lab 11.
Copyright , Dennis J. Frailey CSE Software Measurement and Quality Engineering CSE8314 M00 - Version 7.09 SMU CSE 8314 Software Measurement.
Mutation Testing Breaking the application to test it.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 23, 1999.
Week 6 MondayTuesdayWednesdayThursdayFriday Testing III Reading due Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
Statistics (cont.) Psych 231: Research Methods in Psychology.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
Mutation Testing Laraib Zahid & Mariam Arshad. What is Mutation Testing?  Fault-based Testing: directed towards “typical” faults that could occur in.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing I No reading Group meetings MidtermNo Section Testing II Progress report due Readings out Testing.
Software Testing and Quality Assurance Syntax-Based Testing (2) 1.
Regression Testing with its types
White-Box Testing Techniques IV
White-Box Testing Techniques IV
Analyzing the Validity of Selective Mutation with Dominator Mutants
FAULT BASED TESTING,TEST EXECUTION
CSCI1600: Embedded and Real Time Software
Mutation Testing Tutorial Answers
Regression testing Tor Stållhane.
CSE403 Software Engineering Autumn 2000 More Testing
Mutation Testing The Mutants are Coming! Copyright © 2017 – Curt Hill.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
CSCI1600: Embedded and Real Time Software
Mutation Testing Faults are introduced into the program by creating many versions of the program called mutants. Each mutant contains a single fault. Test.
Presentation transcript:

Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing III No reading Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out CSE403 ● Software engineering ● sp12 CSE403 Sp121

Today: symbolic & mutation testing Symbolic example from Michael Beder –Basic idea of symbolic testing is to consider inputs as symbols, not values –Track predicates and constraints over those symbols through the control flow graph (CFG) –Can help in determining inputs that will cause the execution of particular paths Mutation testing – an approach to assessing test suites –Systematically change (mutate) the program being tested –If the test suite cannot distinguish the original program from the mutated program, it has a weakness CSE403 Sp122

Example all variables are int s CSE403 Sp123 I a = read(b) II c = 0 III while (a > 1) { IV if (a^2 > c) V c = c + a VI a = a - 2 } VII write(c) a= c= a>1 a 2 >c c=+a write T T a=-2 F F What input(s) will take path: (I,II)  III  IV  V  VI  III  IV  V  VI  III  VII (I,II) III IV V VI VII

After-node[A,B,C]Condition (I,III)(B,B,0)true III(B,B,0)B>1 IV(B,B,0) B>1  B 2 >0  B>1 V(B,B,B)B>1 VI(B-2,B,B)B>1 III(B-2,B,B) B>1  B-2>0  B>3 IV(B-2,B,B) B>3  (B-2) 2 >B  B>4 V(B-2,B,2B-2)B>4 VI(B-4,B,2B-2)B>4 III(B-4,B,2B-2) B>4  (B-4)<=1  B=5 CSE403 Sp124 I a = read(b) II c = 0 III while (a > 1) { IV if (a^2 > c) V c = c + a VI a = a - 2 } VII write(c) a= c= a>1 a 2 >c c=+a write T T a=-2 F F What input(s) will take path: (I,II)  III  IV  V  VI  III  IV  V  VI  III  VII (I,II) III IV V VI VII Expected result for input B=5

What happens when solving … B>3  (B-2) 2 >B (or such) is hard? Remember, we have to automate all these steps if they are going to be genuinely useful Come on Wednesday… CSE403 Sp125

Mutation testing Mutation testing is an approach to evaluate – and to improve – test suites Basic idea –Create small variants of the program under test –If the tests don’t exhibit different behavior on the variants then the test suite is not sufficient The material on the following slides is due heavily to Pezzè and Young on fault-based testing CSE403 Sp126

Estimation Given a big bowl of marbles, how can we estimate how many? Can’t count every marble individually CSE403 Sp127

What if I also… … have a bag of 100 other marbles of the same size, but a different color (say, black) and mix them in? Draw out 100 marbles at random and find 20 of them are black How many marbles did we start with? CSE403 Sp128

Estimating test suite quality Now take a program with bugs and create 100 variations each with a new and distinct bug –Assume the new bugs are exactly like real bugs in every way Run the test suite on all 100 new variants –... and the tests reveal 20 of the bugs –… and the other 80 program copies do not fail What does this tell us about the test suite? CSE403 Sp129

Basic Assumptions The idea is to judge effectiveness of a test suite in finding real faults by measuring how well it finds seeded fake faults Valid to the extent that the seeded bugs are representative of real bugs: not necessarily identical but the differences should not affect the selection CSE403 Sp1210

Mutation testing A mutant is a copy of a program with a mutation: a syntactic change that represents a seeded bug –Ex: change (i < 0) to (i <= 0) Run the test suite on all the mutant programs A mutant is killed if it fails on at least one test case –That is, the mutant is distinguishable from the original program by the test suite, which adds confidence about the quality of the test suite If many mutants are killed, infer that the test suite is also effective at finding real bugs CSE403 Sp1211

Mutation testing assumptions Competent programmer hypothesis: programs are nearly correct –Real faults are small variations from the correct program and thus mutants are reasonable models of real buggy programs Coupling effect hypothesis: tests that find simple faults also find more complex faults –Even if mutants are not perfect representatives of real faults, a test suite that kills mutants is good at finding real faults, too CSE403 Sp1212

Mutation Operators Syntactic change from legal program to legal program and are thus specific to each programming language Ex: constant for constant replacement –from (x < 5) to (x < 12) –Maybe select from constants found elsewhere in program text Ex: relational operator replacement –from (x <= 5) to (x < 5) Ex: variable initialization elimination –from int x = 5; to int x; CSE403 Sp1213

Live mutants scenario Create 100 mutants from a program –Run the test suite on all 100 mutants, plus the original program –The original program passes all tests –94 mutant programs are killed (fail at least one test) –6 mutants remain alive What can we learn from the living mutants? CSE403 Sp1214

How mutants survive A mutant may be equivalent to the original program –Maybe changing (x < 0) to (x <= 0) didn’t change the output at all! –The seeded “fault” is not really a “fault” – determining this may be easy or hard or in the worst case undecideable Or the test suite could be inadequate –If the mutant could have been killed, but was not, it indicates a weakness in the test suite –But adding a test case for just this mutant is a bad idea – why? CSE403 Sp1215

Weak mutation: a variation There are lots of mutants – the number of mutants grows with the square of program size Running each test case to completion on every mutant is expensive Instead execute a “meta-mutant” that has many of the seeded faults in addition to executing the original program –Mark a seeded fault as “killed” as soon as a difference in an intermediate state is found – don’t wait for program completion –Restart with new mutant selection after each “kill” CSE403 Sp1216

Statistical Mutation: another variation Running each test case on every mutant is expensive, even if we don’t run each test case separately to completion Approach: Create a random sample of mutants –May be just as good for assessing a test suite –Doesn’t work if test cases are designed to kill particular mutants CSE403 Sp1217

In real life... Fault-based testing is a widely used in semiconductor manufacturing –With good fault models of typical manufacturing faults, e.g., “stuck-at-one” for a transistor –But fault-based testing for design errors – as in software – is more challenging Mutation testing is not widely used in industry –But plays a role in software testing research, to compare effectiveness of testing techniques Some use of fault models to design test cases is important and widely practiced CSE403 Sp1218

Summary If bugs were marbles... –We could get some nice black marbles to judge the quality of test suites Since bugs aren’t marbles... –Mutation testing rests on some troubling assumptions about seeded faults, which may not be statistically representative of real faults Nonetheless... –A model of typical or important faults is invaluable information for designing and assessing test suites CSE403 Sp1219

Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing I No reading Group meetings MidtermNo Section Testing II Progress report due Readings out Testing III Readings due Group meetings TBASection ZFR due ZFR demos CSE403 ● Software engineering ● sp12 CSE403 Sp1220