Article ID Journal Published Year Pages File Type
4956617 Journal of Systems and Software 2017 16 Pages PDF
Abstract

•An analysis on test suites' capacity of revealing refactoring faults.•Identification of which code elements are most likely to reveal refactoring faults.•Guidelines to help developers to decide when it is safe to perform a refactoring.•A model for predicting a suite's likelihood of detecting refactoring faults.

Refactoring validation by testing is critical for quality in agile development. However, this activity may be misleading when a test suite is insufficiently robust for revealing faults. Particularly, refactoring faults can be tricky and difficult to detect. Coverage analysis is a standard practice to evaluate fault detection capability of test suites. However, there is usually a low correlation between coverage and fault detection. In this paper, we present an exploratory study on the use of coverage data of mostly impacted code elements to identify shortcomings in a test suite. We consider three real open source projects and their original test suites. The results show that a test suite not directly calling the refactored method and/or its callers increases the chance of missing the fault. Additional analysis of branch coverage on test cases shows that there are higher chances of detecting a refactoring fault when branch coverage is high. These results give evidence that a combination of impact analysis with branch coverage could be highly effective in detecting faults introduced by refactoring edits. Furthermore, we propose a statistic model that evidences the correlation of coverage over certain code elements and the suite's capability of revealing refactoring faults.

Related Topics
Physical Sciences and Engineering Computer Science Computer Networks and Communications
Authors
, , ,