Abstract

Code smell is unreasonable programming, and is produced when software developers don't have good habits of development and experience of development and other reasons. Code becomes more and more chaotic, the code structure become bloated. Code smell can make degradation of code quality. It also can make some difficulties for software developers to understand and maintain the source code of projects, and then cause unnecessary maintenance costs. This study presents an evolutionary version of detection tool DT. DT can support detection of two kinds of code smell -Duplicated code and Feature envy. At the same time, two types of code smell are mainly detected by two detection thoughts: dynamic programming algorithm (DP) and abstract grammar tree (AST). DP can be applied in code smell - Duplicated code. DP uses the similarity between comparative lines to determine whether there is duplicated code; AST is used to detect code smell- feature envy, AST use tree structure to represent the source code, the grammatical structure of the source code transforms to each tree node. Through statistical analysis of existence of these nodes, we can determine whether is a kind of code smell or not. In experiment, detection tool DT compares with four famous detection tools Checkstyle, PMD, iPlasma and JDeodorant. Detection accuracy is higher than above detection tools. In addition, these four well-known tools can't support detection of large industrial projects, while DT can support detection of industrial projects. In future work, we want to detect more kinds of code smell, meanwhile we want update detection precision of detection tool.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call