How to Kill Them All

An Exploratory Study on the Impact of Code Observability on Mutation Testing

Journal Article (2021)
Author(s)

Q. Zhu (TU Delft - Software Engineering)

Andy Zaidman (TU Delft - Software Engineering)

Annibale Panichella (TU Delft - Software Engineering)

Research Group
Software Engineering
Copyright
© 2021 Q. Zhu, A.E. Zaidman, A. Panichella
DOI related publication
https://doi.org/10.1016/j.jss.2020.110864
More Info
expand_more
Publication Year
2021
Language
English
Copyright
© 2021 Q. Zhu, A.E. Zaidman, A. Panichella
Research Group
Software Engineering
Volume number
173
Pages (from-to)
1-20
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

Mutation testing is well-known for its efficacy in assessing test quality, and starting to be applied in the industry. However, what should a developer do when confronted with a low mutation score? Should the test suite be plainly reinforced to increase the mutation score, or should the production code be improved as well, to make the creation of better tests possible? In this paper, we aim to provide a new perspective to developers that enables them to understand and reason about the mutation score in the light of testability and observability. First, we investigate whether testability and observability metrics are correlated with the mutation score on six open-source Java projects. We observe a correlation between observability metrics and the mutation score, e.g., test directness, which measures the extent to which the production code is tested directly, seems to be an essential factor. Based on our insights from the correlation study, we propose a number of ”mutation score anti-patterns”, enabling software engineers to refactor their existing code or add tests to improve the mutation score. In doing so, we observe that relatively simple refactoring operations enable an improvement or increase in the mutation score.