This document discusses mutation testing and introduces Mull, a mutation testing tool for LLVM. It begins with an overview of software quality techniques like formal verification, fuzz testing, and unit testing. It then explains how mutation testing works by modifying code and running tests against the mutated code. The document outlines challenges with mutation testing like performance and generating too many mutants. It presents Mull as a way to address these challenges through techniques like smart mutant selection and runtime compilation. The document demonstrates Mull's use on test suites for LLVM and shows mutation testing scores. It concludes with open questions around integration, user experience, and supporting other languages.
19. Mutation Testing
int sum(int a, int b) {
return a + b;
}
void test() {
assert(sum(5, 10) > 0);
}
int sum'(int a, int b) {
return a * b;
}
20. Mutation Testing
int sum(int a, int b) {
return a + b;
}
void test() {
assert(sum(5, 10) > 0);
}
int sum'(int a, int b) {
return a * b;
}
int sum''(int a, int b) {
return a - b;
}
21. Mutation Testing
int sum(int a, int b) {
return a + b;
}
void test() {
assert(sum(5, 10) > 0);
}
int sum'(int a, int b) {
return a * b;
}
int sum''(int a, int b) {
return a - b;
}
test passed ->
mutant survived
22. Mutation Testing
int sum(int a, int b) {
return a + b;
}
void test() {
assert(sum(5, 10) > 0);
}
int sum'(int a, int b) {
return a * b;
}
int sum''(int a, int b) {
return a - b;
}
test passed ->
mutant survived
test failed ->
mutant killed
25. Mutation Testing
• First proposed by Richard Lipton in 1971
• First implemented by Timothy Budd in 1980
26. Mutation Testing
• First proposed by Richard Lipton in 1971
• First implemented by Timothy Budd in 1980
• Studies say that MT was able to detect 70%-90%
of real faults
30. Mutation Testing
• Generates lots of data
• Time consuming
• Languages are not mutation-testing-friendly
• Problem of a Human Test Oracle
31. Mutation Testing
• Generates lots of data
• Time consuming
• Languages are not mutation-testing-friendly
• Problem of a Human Test Oracle
• "Excuse me, but I write good tests"
49. IRTests: 238 tests
Distance: 2
Number of mutants: ~1.5k
Real execution time: ~1 hour
Distance: 29
Number of mutants: ~18k
Approximate execution time: ~11 days
55. System Design
Core
• Driver
• Reporter
•
Mutation
Operators
Toolchain
• JIT Compiler
• Object Cache
Test Framework
• Test Finder
• Test Runner
56. System Design
Core
• Driver
• Reporter
•
Mutation
Operators
Toolchain
• JIT Compiler
• Object Cache
Test Framework
• Test Finder
• Test Runner
• Test Finder
• Test Runner
Google Test
57. System Design
Core
• Driver
• Reporter
•
Mutation
Operators
Toolchain
• JIT Compiler
• Object Cache
Test Framework
• Test Finder
• Test Runner
• Test Finder
• Test Runner
Google Test
• Test Finder
• Test Runner
XCTest