Cargando…

Too trivial to test? An inverse view on defect prediction to identify methods with low fault risk

BACKGROUND: Test resources are usually limited and therefore it is often not possible to completely test an application before a release. To cope with the problem of scarce resources, development teams can apply defect prediction to identify fault-prone code regions. However, defect prediction tends...

Descripción completa

Detalles Bibliográficos
Autores principales: Niedermayr, Rainer, Röhm, Tobias, Wagner, Stefan
Formato: Online Artículo Texto
Lenguaje:English
Publicado: PeerJ Inc. 2019
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7924551/
https://www.ncbi.nlm.nih.gov/pubmed/33816840
http://dx.doi.org/10.7717/peerj-cs.187
_version_ 1783659112542765056
author Niedermayr, Rainer
Röhm, Tobias
Wagner, Stefan
author_facet Niedermayr, Rainer
Röhm, Tobias
Wagner, Stefan
author_sort Niedermayr, Rainer
collection PubMed
description BACKGROUND: Test resources are usually limited and therefore it is often not possible to completely test an application before a release. To cope with the problem of scarce resources, development teams can apply defect prediction to identify fault-prone code regions. However, defect prediction tends to low precision in cross-project prediction scenarios. AIMS: We take an inverse view on defect prediction and aim to identify methods that can be deferred when testing because they contain hardly any faults due to their code being “trivial”. We expect that characteristics of such methods might be project-independent, so that our approach could improve cross-project predictions. METHOD: We compute code metrics and apply association rule mining to create rules for identifying methods with low fault risk (LFR). We conduct an empirical study to assess our approach with six Java open-source projects containing precise fault data at the method level. RESULTS: Our results show that inverse defect prediction can identify approx. 32–44% of the methods of a project to have a LFR; on average, they are about six times less likely to contain a fault than other methods. In cross-project predictions with larger, more diversified training sets, identified methods are even 11 times less likely to contain a fault. CONCLUSIONS: Inverse defect prediction supports the efficient allocation of test resources by identifying methods that can be treated with less priority in testing activities and is well applicable in cross-project prediction scenarios.
format Online
Article
Text
id pubmed-7924551
institution National Center for Biotechnology Information
language English
publishDate 2019
publisher PeerJ Inc.
record_format MEDLINE/PubMed
spelling pubmed-79245512021-04-02 Too trivial to test? An inverse view on defect prediction to identify methods with low fault risk Niedermayr, Rainer Röhm, Tobias Wagner, Stefan PeerJ Comput Sci Data Mining and Machine Learning BACKGROUND: Test resources are usually limited and therefore it is often not possible to completely test an application before a release. To cope with the problem of scarce resources, development teams can apply defect prediction to identify fault-prone code regions. However, defect prediction tends to low precision in cross-project prediction scenarios. AIMS: We take an inverse view on defect prediction and aim to identify methods that can be deferred when testing because they contain hardly any faults due to their code being “trivial”. We expect that characteristics of such methods might be project-independent, so that our approach could improve cross-project predictions. METHOD: We compute code metrics and apply association rule mining to create rules for identifying methods with low fault risk (LFR). We conduct an empirical study to assess our approach with six Java open-source projects containing precise fault data at the method level. RESULTS: Our results show that inverse defect prediction can identify approx. 32–44% of the methods of a project to have a LFR; on average, they are about six times less likely to contain a fault than other methods. In cross-project predictions with larger, more diversified training sets, identified methods are even 11 times less likely to contain a fault. CONCLUSIONS: Inverse defect prediction supports the efficient allocation of test resources by identifying methods that can be treated with less priority in testing activities and is well applicable in cross-project prediction scenarios. PeerJ Inc. 2019-04-15 /pmc/articles/PMC7924551/ /pubmed/33816840 http://dx.doi.org/10.7717/peerj-cs.187 Text en © 2019 Niedermayr et al. http://creativecommons.org/licenses/by/4.0/ This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0/) , which permits unrestricted use, distribution, reproduction and adaptation in any medium and for any purpose provided that it is properly attributed. For attribution, the original author(s), title, publication source (PeerJ Computer Science) and either DOI or URL of the article must be cited.
spellingShingle Data Mining and Machine Learning
Niedermayr, Rainer
Röhm, Tobias
Wagner, Stefan
Too trivial to test? An inverse view on defect prediction to identify methods with low fault risk
title Too trivial to test? An inverse view on defect prediction to identify methods with low fault risk
title_full Too trivial to test? An inverse view on defect prediction to identify methods with low fault risk
title_fullStr Too trivial to test? An inverse view on defect prediction to identify methods with low fault risk
title_full_unstemmed Too trivial to test? An inverse view on defect prediction to identify methods with low fault risk
title_short Too trivial to test? An inverse view on defect prediction to identify methods with low fault risk
title_sort too trivial to test? an inverse view on defect prediction to identify methods with low fault risk
topic Data Mining and Machine Learning
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7924551/
https://www.ncbi.nlm.nih.gov/pubmed/33816840
http://dx.doi.org/10.7717/peerj-cs.187
work_keys_str_mv AT niedermayrrainer tootrivialtotestaninverseviewondefectpredictiontoidentifymethodswithlowfaultrisk
AT rohmtobias tootrivialtotestaninverseviewondefectpredictiontoidentifymethodswithlowfaultrisk
AT wagnerstefan tootrivialtotestaninverseviewondefectpredictiontoidentifymethodswithlowfaultrisk