1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.

Slides:



Advertisements
Similar presentations
1 Software Unit Test Coverage And Test Adequacy Hong Zhu, Patrick A. V. Hall, John H.R. May Presented By: Arpita Gandhi.
Advertisements

Chair of Software Engineering From Program slicing to Abstract Interpretation Dr. Manuel Oriol.
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.
West Virginia University SENG 530 Verification & Validation Slide 1 Part III: Execution – Based Verification and Validation Katerina Goseva - Popstojanova.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
A CONTROL INSTRUMENTS COMPANY The Effectiveness of T-way Test Data Generation or Data Driven Testing Michael Ellims.
(c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 1 Fault-Based Testing.
Software Testing and Quality Assurance
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
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
Fruitful functions. Return values The built-in functions we have used, such as abs, pow, int, max, and range, have produced results. Calling each of these.
Topics in Software Dynamic White-box Testing Part 2: Data-flow Testing
Software Testing and Validation SWE 434
Presented By Dr. Shazzad Hosain Asst. Prof., EECS, NSU
Data Flow Testing Chapter Data Flow Testing Testing All-Nodes and All-Edges in a control flow graph may miss significant test cases Testing All-Paths.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Course Outline Traditional Static Program Analysis –Theory –Classic analysis and applications Points-to analysis, CHA, RTA –The Soot analysis framework.
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.
Software testing techniques Software testing techniques Mutation testing Presentation on the seminar Kaunas University of Technology.
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.
White-Box Software Testing Methods Speaker: Jerry Gao Ph.D. San Jose State University URL:
Coverage Estimating the quality of a test suite. 2 Code Coverage A code coverage model calls out the parts of an implementation that must be exercised.
Xusheng Xiao North Carolina State University CSC 720 Project Presentation 1.
Introduction to Software Testing Paul Ammann & Jeff Offutt Updated 24-August 2010.
Introduction to Software Testing. OUTLINE Introduction to Software Testing (Ch 1) 2 1.Spectacular Software Failures 2.Why Test? 3.What Do We Do When We.
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.
Overview Structural Testing Introduction – General Concepts
Software Testing Part II March, Fault-based Testing Methodology (white-box) 2 Mutation Testing.
Software Testing Syntax-based Testing. Syntax Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases Specs Design Source.
Introduction to Software Testing Chapter 9.2 Program-based Grammars 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.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing III No reading Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
Foundations of Software Testing Slides based on: Draft V4.0. November 19, 2006 Test Adequacy Measurement and Enhancement Using Mutation Last update: January15,
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Mutation Testing Breaking the application to test it.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 23, 1999.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
MUTACINIS TESTAVIMAS Benediktas Knispelis, IFM-2/2 Mutation testing.
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.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
Software Testing and Quality Assurance Syntax-Based Testing (2) 1.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
1 Sections 7.2 – 7.7 Nested Control Statements Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
Testing Tutorial 7.
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Mutation Testing Moonzoo Kim School of Computing KAIST
CompSci 230 Software Construction
Mutation testing Julius Purvinis IFM-0/2.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Introduction to Software Testing Chapter 5.2 Program-based Grammars
Chapter 10 – Software Testing
Software Testing Syntax-based Testing.
Mutation Testing The Mutants are Coming! Copyright © 2017 – Curt Hill.
Mutation Testing Moonzoo Kim School of Computing KAIST
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
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:

1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques

2 Lecture Outline Mutation Analysis Theory of Mutation analysis and concept of mutant. Mutation Operator Equivalent mutants Comparing coverage criteria.

3 Example Void squeeze (char s[],int c) { int i,j; for (i = j = 0; s[i] != ‘\0’; i++) if (s[i] != c}{ s[ j++ ] = s[i]; } s[i] = ‘\0’; }

4 Example Void squeeze (char s[],int c) { int i,j; for (i = j = 0; s[i] != ‘\0’; i++) if (s[i] != c}{ s[ j ] = s[i]; } s[i] = ‘\0’; } Now, function places all references to ‘c’ at position 0 in the array. (FAULT)

5 Test Cases for the Example Test cases (Test suite) is executed on the faulty version; two possibilities An error is encountered, and the programmer can debug the program to find the fault and repair it. An error is not encountered, and all the test cases pass.

6 Coverage Based Testing Techniques To date, we have discussed methods that aim to find faults by achieving coverage. Little idea as to how good the resulting test suite is.

7 Mutation Analysis Method for measuring the effectiveness of test suites; and As a result, we produce new test cases to be added to that test suite. A mutant of a program is a copy of the program, but with one slight syntactic change.

8 Fault is a mutant. In this case, the slight syntactic change is the removal of ++ operator in the array index. Mutant Example Void squeeze (char s[],int c) { int i,j; for (i = j = 0; s[i] != ‘\0’; i++) if (s[i] != c}{ s[ j ] = s[i]; } s[i] = ‘\0’; }

9 Mutation Analysis Given a program, A test input for that program, and a mutant, We say that test case kills the mutant if and only if The output of the program and the mutant differ for the test inputs. A mutant that has been killed is said to be dead. A mutant that has not been killed is said to be alive.

10 Coupling Effect - Theory behind Mutation Analysis A test case that distinguishes a small fault in a program by identifying unexpected behavior is so sensitive that it will distinguish more complex faults. More complex faults are coupled with simple faults. This is our general observation as well. Many of the faults produced by test suites are a result of one minor fault.

11 Coupling Effect, Mutant & Testing Any test suite that does not uncover the mutant is inadequate. For example,we test the original squeeze function with a test suite,and all test cases pass. Now, we deliberately insert the fault (to evaluate the quality of test suites). If fault is uncovered, mutant is killed. Otherwise, test suites are inadequate. Mutation Analysis Process

12 Mutation Analysis Used to guide test input generation. For example, Find a test case that kills every mutant. It is a way of assessing test suite quality. Test suites that kill more mutants is of higher quality.

13 Mutation Analysis via Mutant Operator Mutant operator is a transformation rule that, given a program, generates a mutant for that program. For example, For ‘if (x < y)’ statement, possible mutants are If (x ≤ y) If (x > y) If (x ≥ y) If (x = y) If (x ≠ y) …..

14 Mutation Analysis via Mutant Operator Mutants are syntactic changes to a program, so mutant operators are depend on the syntax of programming languages. The mutant operators of one programming language may not necessarily apply to other languages.

15 Equivalent Mutants Given a program and a mutant of that program, The mutant is said to be equivalent mutant if, for every input, the program and the mutant produce the same output. A major problem with mutation analysis

16 Equivalent Mutants - example Squeeze function S [ j ++] = s [ i ]; S [ j ++] = s [abs[ i ]]; Absolute value function Variable i only ever takes on value between 0 and the size of the array. Hence, abs[i] is irrelevant. This mutant is equivalent can not be killed. In industry, testers aim to kill 95% of the mutants.

17 Comparing Coverage Criteria Which criteria gives the best coverage? Frankl et al. [ An applicable Family of Data-Flow Testing Criteria, IEEE Transactions on Software Engineering, 14(10), 1988 ] compared paths that each criteria selects.

18 Comparing Coverage Criteria All-Paths All-Du-Paths Multiple condition All-C-Use/Some-P-Use All Uses All-P-Uses/Some C-Uses All-Defs All-P-Uses All-Edges All-Nodes Decision/condition Condition

19 Comparing Coverage Criteria If (y==1) { x = 2; } If (z==1) { a = f(x); } Multiple condition coverage enforces that y == 1 and z == 1 are both executed for the true and false. To achieve any data-flow criteria, at least One test must execute a definition path From the statement x = 2 to a = f(x).

20 Key points Mutation analysis is a method of measuring effectiveness of test suites. And as a result, we produce test cases to improve program testing. The set of paths that satisfy ‘data-flow’ and ‘coverage based testing’ are not necessarily unique.