Less is More: Minimizing Code Reorganization using XTREE

Rahul Krishna, Tim Menzies, Lucas Layman
9/12/2016
23 citations
cs.SE

Official code: ai-se/XTREE (3 stars, Python, MIT, last commit 2017-04-03).

Abstract

Context: Developers use bad code smells to guide code reorganization. Yet developers, text books, tools, and researchers disagree on which bad smells are important.

Show full abstract

Objective: To evaluate the likelihood that a code reorganization to address bad code smells will yield improvement in the defect-proneness of the code. Method: We introduce XTREE, a tool that analyzes a historical log of defects seen previously in the code and generates a set of useful code changes. Any bad smell that requires changes outside of that set can be deprioritized (since there is no historical evidence that the bad smell causes any problems). Evaluation: We evaluate XTREE's recommendations for bad smell improvement against recommendations from previous work (Shatnawi, Alves, and Borges) using multiple data sets of code metrics and defect counts. Results: Code modules that are changed in response to XTREE's recommendations contain significantly fewer defects than recommendations from previous studies. Further, XTREE endorses changes to very few code metrics, and the bad smell recommendations (learned from previous studies) are not universal to all software projects. Conclusion: Before undertaking a code reorganization based on a bad smell report, use a tool like XTREE to check and ignore any such operations that are useless; i.e. ones which lack evidence in the historical record that it is useful to make that change. Note that this use case applies to both manual code reorganizations proposed by developers as well as those conducted by automatic methods. This recommendation assumes that there is an historical record. If none exists, then the results of this paper could be used as a guide.

View on arXivView PDF

Code Implementations(1)

ai-se/XTREEOfficial100%
MIT

Less is More: Minimizing Code Reorganization using XTREE. ARXIV link: https://arxiv.org/abs/1609.03614

30PythonJul 14, 20169 years agoMIT
decision-makingdecision-treespredictionsoftware-engineering

Similar Papers

Cite this paper

@article{krishna2016less,
  title  = {Less is More: Minimizing Code Reorganization using XTREE},
  author = {Rahul Krishna and Tim Menzies and Lucas Layman},
  year   = {2016},
  eprint = {1609.03614},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1609.03614}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1609.03614.svg)](https://codeofpaper.com/paper/1609.03614)

Discussion