MuDelta: Delta-Oriented Mutation Testing at Commit Time
In many cases developers would like to test the program changes they introduce. To achieve this, a mutation testing formulation capable of capturing the altered program behaviours that are not adequately tested, is needed. Such a formulation of mutation testing would allow introducing relevant mutants, to the altered program behaviours, thereby allowing developers to focus, at commit time, on testing their changes. We thus introduce MuDelta an approach that identifies commit- relevant mutants; mutants that affect and are affected by the changed program behaviours. Our approach uses machine learning applied on a combined scheme of graph and vector- based representations of static code features. Our results, from 50 commits in 21 Coreutils programs, demonstrate a strong prediction ability of our approach; yielding 0.80 (ROC) and 0.50 (PR-Curve) AUC values with 0.63 and 0.32 precision and recall values. These predictions are significantly higher than random guesses, 0.20 (PR-Curve) AUC, 0.21 and 0.21 precision and recall, and subsequently lead to strong relevant tests that kill 45% more relevant mutants than randomly sampled mutants (either sampled from those residing on the changed component(s) or from the changed lines). Perhaps more importantly, our results show that our approach leads to mutants with 27% higher fault revealing ability in fault introducing commits. Taken together, our results corroborate the conclusion that commit-based mutation testing is suitable and promising for evolving software.