SlideShare a Scribd company logo
MUTATION TESTING
Quis custodiet ipsos custodies?
By COLE / ACT LAB
Quis custodiet ipsos custodies?
뀌ㅅ 꾸ㅅ또디엗 입소ㅅ 꾸ㅅ또데ㅅ
Who watches the watchmen?
누가 감시자를 감시할 것인가?
What is Mutation ?
What is Mutation ?
Original
Mutation
A mutation is a change that occurs in our DNA sequence, either
due to mistakes when the DNA is copied or as the result of
environmental factors such as UV light and cigarette smoke.
What is Mutation in SW ?
Mutation은
프로그램 내에서 의도적으로
결함을 유발시키기 위한 작은 변경 사항
What is Mutation in SW ?
If (a && b) { … }  If (a || b) { … }
What is Mutation Testing?
Mutation testing은
기존 테스트의 품질을 평가하는 Test
기존 Test 에서 다루는 코드를 약간 변경을 가하고 기존 Test suit가 변경
사항을 감지하고 거부하는지 여부를 확인하는 Test
변경사항을 감지 및 거부하지 않으면 테스트가 코드의 복잡성을 전부 수용
하지 못하고 하나 이상의 요소가 테스트되지 않은 상태임을 나타냄
CODE TESTS
MUTATION
TESTING
Verify Quality of Verify Quality of
변경사항 감지 및 거부 O  Mutant Killed
변경사항 감지 및 거부 X  Mutant Survived
Value Mutations
변수를 변경 해서 프로그램 내 에러 탐지
가장 일반적인 방법으로는 상수를 변경하거나, 한 개 변수를 매우 크거나 작은 수로 변경
Decision Mutations
결정/조건 요소를 변경 설계 상의 에러 탐지
arithmetic operators(+, -, *, /, %) 변경
relational operators and logical operators (AND, OR , NOT) 변경
Statement Mutations
Line 삭제나 복제를 통해 에러 탐지
Mutation Testing Types
into
MUTATORS: CONDITION BOUNDARY
into
into
into
>
<
>=
<=
>=
<=
>
<
into
MUTATORS: NEGATE CONDITONALS
into
into
into
==
!=
>=
<=
>=
<=
<
>
into
into
<
>
>=
<=
into
MUTATORS: ETC
into
become
( doSomething(); is removed )
If( a == b )
+
return a;
If( true )
-
return 0;
Remove void invocations
Mutation Testing Benefits
개발자가 생각하지 못한 새로운 오류를 찾아줌
기존의 테스트 방법으로는 찾을 수 없는 숨겨진 결함을 찾아줌
디버깅 및 유지 관리가 이전보다 훨씬 쉬움
Why is not widely used?
Begins in 1971, Richard J. Lipton
Testing Maturity
Integration into the SW development process
Technical Problem – Brute Force
Code Coverage
‘Test coverage is a useful tool for finding
untested parts of a codebase‘
Martin Fowler
public class Calculator {
int valueDisplayed;
public Calculator() { this.valueDisplayed = 0; }
public Calculator(int initialValue) {
this.valueDisplayed = initialValue;
}
public void add(int x) { this.valueDisplayed += x; }
public void power(int x) {
this.valueDisplayed = (int) ;
Math.pow(this.valueDisplayed, x);
}
public int getResult() { return this.valueDisplayed; }
public void set(int x) { this.valueDisplayed = x; }
public boolean setConditional(int x, boolean yesOrNo) {
if(yesOrNo) {
set(x);
return true;
} else {
return false;
}
}
}
@Test
public void testAddition() {
Calculator calculator = new Calculator();
calculator.add(2);
assertEquals(calculator.getResult(), 2);
}
@Test
public void testPower() {
Calculator calculator = new Calculator(2);
calculator.power(3);
assertEquals(calculator.getResult(), 8);
}
@Test
public void testConditionalSetTrue() {
Calculator calculator = new Calculator();
assertEquals(calculator.setConditional(2, true), true);
}
@Test
public void testConditionalSetFalse() {
Calculator calculator = new Calculator();
assertEquals(calculator.setConditional(3, false), false);
}
public class Calculator {
int valueDisplayed;
public Calculator() { this.valueDisplayed = 0; }
public Calculator(int initialValue) {
this.valueDisplayed = initialValue;
}
public void add(int x) { this.valueDisplayed += x; }
public void power(int x) {
this.valueDisplayed = (int) ;
Math.pow(this.valueDisplayed, x);
}
public int getResult() { return this.valueDisplayed; }
public void set(int x) { this.valueDisplayed = x; }
public boolean setConditional(int x, boolean yesOrNo) {
if(yesOrNo) {
set(x);
return true;
} else {
return false;
}
}
}
@Test
public void testAddition() {
Calculator calculator = new Calculator();
calculator.add(2);
assertEquals(calculator.getResult(), 2);
}
@Test
public void testPower() {
Calculator calculator = new Calculator(2);
calculator.power(3);
assertEquals(calculator.getResult(), 8);
}
@Test
public void testConditionalSetTrue() {
Calculator calculator = new Calculator();
assertEquals(calculator.setConditional(2, true), true);
}
@Test
public void testConditionalSetFalse() {
Calculator calculator = new Calculator();
assertEquals(calculator.setConditional(3, false), false);
}
@Test
public void testConditionalSetTrue() {
Calculator calculator = new Calculator();
assertEquals(calculator.setConditional(2, true), true);
assertEquals(calculator.getResult(), 2);
}
MUTATION TESTING IS SLOW ?
단일 테스트케이스는 수행에 큰 문제가 없지만 테스트케이스가 많은 경
우 수행 시간이 증가될 수 있음
• 1000 classes , 10 unit test / class, 2ms / unit test
• 1000 x 10 x 2ms = 20sec
• 8 mutants / class : 1000 classes x 8 = 8000 mutants
• Brute force : 8000 x 20sec = 1day 20hour 26min 40sec
• Smart testing : 8000 x 10 x 2ms = 2min 40sec
•muJava A mutation tool for Java that includes class-level operators
•Mutate.py A Python script to mutate C-programs
•Mutator A source-based multi-language commercial mutation analyzer for concurrent Java, Ruby, JavaScript, PHP
•Bacterio Mutation testing tool for multi-class Java systems
•Javalanche Bytecode-based mutation testing tool for Java
•Major Compiler-integrated mutation testing framework for Java
•Jumble Bytecode-based mutation testing tool for Java
•PIT Bytecode-based mutation testing tool for Java
•Stryker Mutation testing tool for JavaScript
•Mutant AST based mutation testing tool for Ruby
•Jester Source-based mutation testing tool for Java
•Judy Mutation testing tool for Java
•Heckle Mutation testing tool for Ruby
•NinjaTurtles IL-based mutation testing tool for .NET and Mono
•Nester Mutation testing tool for C#
•Humbug Mutation testing tool for PHP
•MuCheck Mutation analysis library for Haskell
Mutation Testing Framework
Reference
• https://www.tutorialspoint.com/software_testing_dictionary/mu
tation_testing.htm
• http://www.inf.ed.ac.uk/teaching/courses/st/2011-
12/Resource-folder/09_mutation.pdf
• http://www.codeaffine.com/2015/10/05/what-the-heck-is-
mutation-testing/
• http://www.ontestautomation.com/an-introduction-to-
mutation-testing-and-pit/

More Related Content

What's hot

Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
Thomas Zimmermann
 
Thread & concurrancy
Thread & concurrancyThread & concurrancy
Thread & concurrancy
Onkar Deshpande
 
Sample Chapter of Practical Unit Testing with TestNG and Mockito
Sample Chapter of Practical Unit Testing with TestNG and MockitoSample Chapter of Practical Unit Testing with TestNG and Mockito
Sample Chapter of Practical Unit Testing with TestNG and Mockito
Tomek Kaczanowski
 
Junit
JunitJunit
Unit testing best practices with JUnit
Unit testing best practices with JUnitUnit testing best practices with JUnit
Unit testing best practices with JUnit
inTwentyEight Minutes
 
JUnit 5
JUnit 5JUnit 5
Junit With Eclipse
Junit With EclipseJunit With Eclipse
Junit With Eclipse
Sunil kumar Mohanty
 
Junit
JunitJunit
GeeCON 2012 Bad Tests, Good Tests
GeeCON 2012 Bad Tests, Good TestsGeeCON 2012 Bad Tests, Good Tests
GeeCON 2012 Bad Tests, Good Tests
Tomek Kaczanowski
 
Confitura 2012 Bad Tests, Good Tests
Confitura 2012 Bad Tests, Good TestsConfitura 2012 Bad Tests, Good Tests
Confitura 2012 Bad Tests, Good Tests
Tomek Kaczanowski
 
Junit
JunitJunit
Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1
Kiki Ahmadi
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practicesnickokiss
 
Testing And Mxunit In ColdFusion
Testing And Mxunit In ColdFusionTesting And Mxunit In ColdFusion
Testing And Mxunit In ColdFusion
Denard Springle IV
 
Software testing basics and its types
Software testing basics and its typesSoftware testing basics and its types
Software testing basics and its types
360logica Software Testing Services (A Saksoft Company)
 
STAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Descartes Presentation
STAMP Descartes Presentation
STAMP Project
 
Unit testing
Unit testingUnit testing
Unit testing
Murugesan Nataraj
 
Mutation Testing and MuJava
Mutation Testing and MuJavaMutation Testing and MuJava
Mutation Testing and MuJava
Krunal Parmar
 

What's hot (20)

Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 
Thread & concurrancy
Thread & concurrancyThread & concurrancy
Thread & concurrancy
 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
 
Sample Chapter of Practical Unit Testing with TestNG and Mockito
Sample Chapter of Practical Unit Testing with TestNG and MockitoSample Chapter of Practical Unit Testing with TestNG and Mockito
Sample Chapter of Practical Unit Testing with TestNG and Mockito
 
Junit
JunitJunit
Junit
 
Unit testing best practices with JUnit
Unit testing best practices with JUnitUnit testing best practices with JUnit
Unit testing best practices with JUnit
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 
Junit With Eclipse
Junit With EclipseJunit With Eclipse
Junit With Eclipse
 
Junit
JunitJunit
Junit
 
GeeCON 2012 Bad Tests, Good Tests
GeeCON 2012 Bad Tests, Good TestsGeeCON 2012 Bad Tests, Good Tests
GeeCON 2012 Bad Tests, Good Tests
 
Confitura 2012 Bad Tests, Good Tests
Confitura 2012 Bad Tests, Good TestsConfitura 2012 Bad Tests, Good Tests
Confitura 2012 Bad Tests, Good Tests
 
Junit
JunitJunit
Junit
 
Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
Junit tutorial
Junit tutorialJunit tutorial
Junit tutorial
 
Testing And Mxunit In ColdFusion
Testing And Mxunit In ColdFusionTesting And Mxunit In ColdFusion
Testing And Mxunit In ColdFusion
 
Software testing basics and its types
Software testing basics and its typesSoftware testing basics and its types
Software testing basics and its types
 
STAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Descartes Presentation
STAMP Descartes Presentation
 
Unit testing
Unit testingUnit testing
Unit testing
 
Mutation Testing and MuJava
Mutation Testing and MuJavaMutation Testing and MuJava
Mutation Testing and MuJava
 

Similar to Mutation testing

Test driven development
Test driven developmentTest driven development
Test driven development
christoforosnalmpantis
 
Must.Kill.Mutants. Agile Testing Days 2017
Must.Kill.Mutants. Agile Testing Days 2017Must.Kill.Mutants. Agile Testing Days 2017
Must.Kill.Mutants. Agile Testing Days 2017
Gerald Muecke
 
Kill the mutants - A better way to test your tests
Kill the mutants - A better way to test your testsKill the mutants - A better way to test your tests
Kill the mutants - A better way to test your tests
Roy van Rijn
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van Rijn
NLJUG
 
Mutation Testing
Mutation TestingMutation Testing
Mutation Testing
Chris Sinjakli
 
TestNG vs Junit
TestNG vs JunitTestNG vs Junit
TestNG vs Junit
Büşra İçöz
 
Mutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The BugsMutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The Bugs
Ari Waller
 
Software testing
Software testingSoftware testing
Software testing
Nitish Upreti
 
Design for Testability
Design for TestabilityDesign for Testability
Design for Testability
Stefano Dalla Palma
 
Tomasz Polanski - Droidcon Berlin 2016
Tomasz Polanski - Droidcon Berlin 2016Tomasz Polanski - Droidcon Berlin 2016
Tomasz Polanski - Droidcon Berlin 2016
Tomasz Polanski
 
Tomasz Polanski - Automated mobile testing 2016 - Testing: why, when, how
Tomasz Polanski - Automated mobile testing 2016 - Testing: why, when, howTomasz Polanski - Automated mobile testing 2016 - Testing: why, when, how
Tomasz Polanski - Automated mobile testing 2016 - Testing: why, when, how
Tomasz Polanski
 
We Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentWe Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End Development
All Things Open
 
Best practices unit testing
Best practices unit testing Best practices unit testing
Best practices unit testing
Tricode (part of Dept)
 
Mutation testing - the way to improve unit tests quality
Mutation testing - the way to improve unit tests qualityMutation testing - the way to improve unit tests quality
Mutation testing - the way to improve unit tests quality
Vadim Mikhnevych
 
J unit presentation
J unit presentationJ unit presentation
J unit presentationPriya Sharma
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
priya_trivedi
 
Junit 4.0
Junit 4.0Junit 4.0
05 junit
05 junit05 junit
05 junit
mha4
 
Must.kill.mutants. TopConf Tallinn 2016
Must.kill.mutants. TopConf Tallinn 2016Must.kill.mutants. TopConf Tallinn 2016
Must.kill.mutants. TopConf Tallinn 2016
Gerald Muecke
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
Amr E. Mohamed
 

Similar to Mutation testing (20)

Test driven development
Test driven developmentTest driven development
Test driven development
 
Must.Kill.Mutants. Agile Testing Days 2017
Must.Kill.Mutants. Agile Testing Days 2017Must.Kill.Mutants. Agile Testing Days 2017
Must.Kill.Mutants. Agile Testing Days 2017
 
Kill the mutants - A better way to test your tests
Kill the mutants - A better way to test your testsKill the mutants - A better way to test your tests
Kill the mutants - A better way to test your tests
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van Rijn
 
Mutation Testing
Mutation TestingMutation Testing
Mutation Testing
 
TestNG vs Junit
TestNG vs JunitTestNG vs Junit
TestNG vs Junit
 
Mutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The BugsMutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The Bugs
 
Software testing
Software testingSoftware testing
Software testing
 
Design for Testability
Design for TestabilityDesign for Testability
Design for Testability
 
Tomasz Polanski - Droidcon Berlin 2016
Tomasz Polanski - Droidcon Berlin 2016Tomasz Polanski - Droidcon Berlin 2016
Tomasz Polanski - Droidcon Berlin 2016
 
Tomasz Polanski - Automated mobile testing 2016 - Testing: why, when, how
Tomasz Polanski - Automated mobile testing 2016 - Testing: why, when, howTomasz Polanski - Automated mobile testing 2016 - Testing: why, when, how
Tomasz Polanski - Automated mobile testing 2016 - Testing: why, when, how
 
We Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentWe Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End Development
 
Best practices unit testing
Best practices unit testing Best practices unit testing
Best practices unit testing
 
Mutation testing - the way to improve unit tests quality
Mutation testing - the way to improve unit tests qualityMutation testing - the way to improve unit tests quality
Mutation testing - the way to improve unit tests quality
 
J unit presentation
J unit presentationJ unit presentation
J unit presentation
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
 
Junit 4.0
Junit 4.0Junit 4.0
Junit 4.0
 
05 junit
05 junit05 junit
05 junit
 
Must.kill.mutants. TopConf Tallinn 2016
Must.kill.mutants. TopConf Tallinn 2016Must.kill.mutants. TopConf Tallinn 2016
Must.kill.mutants. TopConf Tallinn 2016
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
 

Recently uploaded

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
Globus
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Mutation testing

  • 1. MUTATION TESTING Quis custodiet ipsos custodies? By COLE / ACT LAB
  • 2. Quis custodiet ipsos custodies? 뀌ㅅ 꾸ㅅ또디엗 입소ㅅ 꾸ㅅ또데ㅅ Who watches the watchmen? 누가 감시자를 감시할 것인가?
  • 4. What is Mutation ? Original Mutation A mutation is a change that occurs in our DNA sequence, either due to mistakes when the DNA is copied or as the result of environmental factors such as UV light and cigarette smoke.
  • 5. What is Mutation in SW ? Mutation은 프로그램 내에서 의도적으로 결함을 유발시키기 위한 작은 변경 사항
  • 6. What is Mutation in SW ? If (a && b) { … }  If (a || b) { … }
  • 7. What is Mutation Testing? Mutation testing은 기존 테스트의 품질을 평가하는 Test 기존 Test 에서 다루는 코드를 약간 변경을 가하고 기존 Test suit가 변경 사항을 감지하고 거부하는지 여부를 확인하는 Test 변경사항을 감지 및 거부하지 않으면 테스트가 코드의 복잡성을 전부 수용 하지 못하고 하나 이상의 요소가 테스트되지 않은 상태임을 나타냄
  • 9. 변경사항 감지 및 거부 O  Mutant Killed 변경사항 감지 및 거부 X  Mutant Survived
  • 10. Value Mutations 변수를 변경 해서 프로그램 내 에러 탐지 가장 일반적인 방법으로는 상수를 변경하거나, 한 개 변수를 매우 크거나 작은 수로 변경 Decision Mutations 결정/조건 요소를 변경 설계 상의 에러 탐지 arithmetic operators(+, -, *, /, %) 변경 relational operators and logical operators (AND, OR , NOT) 변경 Statement Mutations Line 삭제나 복제를 통해 에러 탐지 Mutation Testing Types
  • 13. into MUTATORS: ETC into become ( doSomething(); is removed ) If( a == b ) + return a; If( true ) - return 0; Remove void invocations
  • 14. Mutation Testing Benefits 개발자가 생각하지 못한 새로운 오류를 찾아줌 기존의 테스트 방법으로는 찾을 수 없는 숨겨진 결함을 찾아줌 디버깅 및 유지 관리가 이전보다 훨씬 쉬움
  • 15. Why is not widely used? Begins in 1971, Richard J. Lipton Testing Maturity Integration into the SW development process Technical Problem – Brute Force
  • 16. Code Coverage ‘Test coverage is a useful tool for finding untested parts of a codebase‘ Martin Fowler
  • 17. public class Calculator { int valueDisplayed; public Calculator() { this.valueDisplayed = 0; } public Calculator(int initialValue) { this.valueDisplayed = initialValue; } public void add(int x) { this.valueDisplayed += x; } public void power(int x) { this.valueDisplayed = (int) ; Math.pow(this.valueDisplayed, x); } public int getResult() { return this.valueDisplayed; } public void set(int x) { this.valueDisplayed = x; } public boolean setConditional(int x, boolean yesOrNo) { if(yesOrNo) { set(x); return true; } else { return false; } } } @Test public void testAddition() { Calculator calculator = new Calculator(); calculator.add(2); assertEquals(calculator.getResult(), 2); } @Test public void testPower() { Calculator calculator = new Calculator(2); calculator.power(3); assertEquals(calculator.getResult(), 8); } @Test public void testConditionalSetTrue() { Calculator calculator = new Calculator(); assertEquals(calculator.setConditional(2, true), true); } @Test public void testConditionalSetFalse() { Calculator calculator = new Calculator(); assertEquals(calculator.setConditional(3, false), false); }
  • 18.
  • 19.
  • 20.
  • 21. public class Calculator { int valueDisplayed; public Calculator() { this.valueDisplayed = 0; } public Calculator(int initialValue) { this.valueDisplayed = initialValue; } public void add(int x) { this.valueDisplayed += x; } public void power(int x) { this.valueDisplayed = (int) ; Math.pow(this.valueDisplayed, x); } public int getResult() { return this.valueDisplayed; } public void set(int x) { this.valueDisplayed = x; } public boolean setConditional(int x, boolean yesOrNo) { if(yesOrNo) { set(x); return true; } else { return false; } } } @Test public void testAddition() { Calculator calculator = new Calculator(); calculator.add(2); assertEquals(calculator.getResult(), 2); } @Test public void testPower() { Calculator calculator = new Calculator(2); calculator.power(3); assertEquals(calculator.getResult(), 8); } @Test public void testConditionalSetTrue() { Calculator calculator = new Calculator(); assertEquals(calculator.setConditional(2, true), true); } @Test public void testConditionalSetFalse() { Calculator calculator = new Calculator(); assertEquals(calculator.setConditional(3, false), false); }
  • 22. @Test public void testConditionalSetTrue() { Calculator calculator = new Calculator(); assertEquals(calculator.setConditional(2, true), true); assertEquals(calculator.getResult(), 2); }
  • 23. MUTATION TESTING IS SLOW ? 단일 테스트케이스는 수행에 큰 문제가 없지만 테스트케이스가 많은 경 우 수행 시간이 증가될 수 있음 • 1000 classes , 10 unit test / class, 2ms / unit test • 1000 x 10 x 2ms = 20sec • 8 mutants / class : 1000 classes x 8 = 8000 mutants • Brute force : 8000 x 20sec = 1day 20hour 26min 40sec • Smart testing : 8000 x 10 x 2ms = 2min 40sec
  • 24. •muJava A mutation tool for Java that includes class-level operators •Mutate.py A Python script to mutate C-programs •Mutator A source-based multi-language commercial mutation analyzer for concurrent Java, Ruby, JavaScript, PHP •Bacterio Mutation testing tool for multi-class Java systems •Javalanche Bytecode-based mutation testing tool for Java •Major Compiler-integrated mutation testing framework for Java •Jumble Bytecode-based mutation testing tool for Java •PIT Bytecode-based mutation testing tool for Java •Stryker Mutation testing tool for JavaScript •Mutant AST based mutation testing tool for Ruby •Jester Source-based mutation testing tool for Java •Judy Mutation testing tool for Java •Heckle Mutation testing tool for Ruby •NinjaTurtles IL-based mutation testing tool for .NET and Mono •Nester Mutation testing tool for C# •Humbug Mutation testing tool for PHP •MuCheck Mutation analysis library for Haskell Mutation Testing Framework
  • 25. Reference • https://www.tutorialspoint.com/software_testing_dictionary/mu tation_testing.htm • http://www.inf.ed.ac.uk/teaching/courses/st/2011- 12/Resource-folder/09_mutation.pdf • http://www.codeaffine.com/2015/10/05/what-the-heck-is- mutation-testing/ • http://www.ontestautomation.com/an-introduction-to- mutation-testing-and-pit/

Editor's Notes

  1. 80’S 수용 불가 CPU 집약적 PIT가 많이 해결했음