13
ISECON 2006-Dallas 1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University Southeast New Albany, IN [email protected]

ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

Embed Size (px)

Citation preview

Page 1: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 1

Representing and Generating Mutant Programs in Support of

Measuring Test Suite Effectiveness

Ronald Finkbine, Ph.D.Indiana University Southeast

New Albany, [email protected]

Page 2: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 2

Introduction Definitions Purpose Background Mutation Operators Sample Database Flow Summary

Page 3: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 3

Definitions Source program Test suite Mutation operator (s) Mutant Seed with a fault

Page 4: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 4

Purpose Inject common syntax changes Induce branch execution Measure ratio of mutants killed by test suite Between 0 and 1, higher is better Strength of test suite Examine equivalent mutants (better code?)

Page 5: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 5

Background Fortran, Mothra, (Ada) MuJava (JMutation) C, Proteum Java Objects, Sofya GAMUT – uses genetic algorithms Parasoft Insure++

Page 6: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 6

Mutation Operators Scalars – integer, floats, char data Increment, decrement, set constant Operators – math, logic, relational Collections – empty, remove, add, mutate

element, reorder

Page 7: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 7

Sample – Token Set

import java.io.*;class test {public static void main (String[] args) { System.out.println ("hello world"); } //main} //class test

Figure 1

…Token 1 1 1 importToken 2 1 8 javaToken 3 1 12 .Token 4 1 13 ioToken 5 1 15 .Token 6 1 16 *Token 7 1 17 ;…

Figure 2

Page 8: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 8

Token_Tbl and MutantOp_Tbl Number Column Line Value Spelling

Number TokenNumber MutOperator CompilesStatus

Page 9: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 9

MutantTokens_Tbl Number Column Line Value Spelling

Page 10: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 10

MutantExecution_Tbl Number PgmOrMutant RunTimeExpected TestCaseNumber TestCaseResult

Page 11: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 11

TestCase_Tbl Number ControlFileName InputFileName OutputFileName

Page 12: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 12

Database Flow

Page 13: ISECON 2006-Dallas1 Representing and Generating Mutant Programs in Support of Measuring Test Suite Effectiveness Ronald Finkbine, Ph.D. Indiana University

ISECON 2006-Dallas 13

Summary Definitions Purpose Background Mutation Operators Sample Database Flow