• elixir mutation testing library
• goal
• install exavier library
• run mix exavier.test
• mutate code
• run tests
• show mutation testing report
exavier
Slide 29
Slide 29 text
exunit
• allows definition of custom formatters
• provides callbacks for events
•:test_started
•:test_finished
• etc.
• e.g., junit_formatter
Slide 30
Slide 30 text
exunit
Slide 31
Slide 31 text
• elixir mutation testing library
• goal
• install exavier library
• run mix exavier.test
• mutate code
• run tests
• show mutation testing report
exavier
Slide 32
Slide 32 text
mutators
• used by pitest (JVM) and mutant (Ruby)
• e.g., following pitest, AOR1
(Arithmetic Operator Replacement Mutator #1)
original mutated
+ -
- +
* /
/ *
% *
Slide 33
Slide 33 text
mutators
Slide 34
Slide 34 text
mutators
• e.g., following pitest, REMOVE_CONDITIONALS
(Remove Conditionals Mutator)
“The remove conditionals mutator will remove all
conditionals statements such that the guarded statements
always execute”
original mutated
Slide 35
Slide 35 text
mutators
• e.g., following pitest, REMOVE_CONDITIONALS
(Remove Conditionals Mutator)
“The remove conditionals mutator will remove all
conditionals statements such that the guarded statements
always execute”
original mutated
Slide 36
Slide 36 text
mutators
Slide 37
Slide 37 text
we’re ready
Slide 38
Slide 38 text
exavier
• Run code line coverage analysis for each module,
sequentially
• Mutate the code according to each available mutator
For each module, in parallel:
For each mutator, sequentially:
1. Mutate code with given mutator
2. Run tests (now against mutated code)
3. Report (% mutants survived vs. killed)
Slide 39
Slide 39 text
exavier
•mix exavier.test
Slide 40
Slide 40 text
biggest drawback
• currently mutating a single module all at once and
running all tests against mutated module
problem?
Slide 41
Slide 41 text
biggest drawback
• skews number of survived mutants, e.g.:
Slide 42
Slide 42 text
rough edges
• Macros
• might be hard to provide useful output
• may have to track macro expansion (if possible)
• Edge cases, e.g.:
• division by zero (Issue #7)
• function references as division (Issue #2)
Slide 43
Slide 43 text
future
• get back to work on exavier
• hopefully with the help of the community
⚠
first order of business: fix “biggest drawback”