Font Size: a A A

Code Bad Smell Detection Using Software Evolutionary Data Mining

Posted on:2017-12-02Degree:MasterType:Thesis
Country:ChinaCandidate:S Z FuFull Text:PDF
GTID:2428330590488888Subject:Software engineering
Abstract/Summary:
The existence of code bad smell has a severe impact on the software quality according to numerous researches.Many researches show that ignoring code bad smells can lead to failure of a software system.Thus,the detection of bad smells has drawn the attention of many researchers and practitioners.Most approaches are solely based on structural information extracted from source code.Specifically,we have observed that some code bad smells have the evolutionary property.Moreover,although some code bad smells are detected by structural information,the evolutionary history can help to improve the detection of these code bad smells.So this paper proposes a novel approach called BADE to detect six code bad smells by mining software evolutionary data based on the observation.It mines the evolutionary history from software systems.Preprocess steps are performed on the data,then it exploits association rules mining of machine learning to get association relations between different software entities.After that,BADE defines heuristic algorithms to detect the six bad smells,namely duplicated code,shotgun surgery,divergent change,parallel inheritance,blob and feature envy.The main contributions are:1)Code change association rules mining between different code entities.This paper defines the concept of evolutionary couplings,which represents the relation between different code entities.From the history data,BADE builds the code change transaction set,and filters the branch combination.Then,the BADE uses top-down search way,pruning and parallel computing to improve the association rules mining algorithm FP-Growth to find the coupling relations between different code entities.2)Heuristic based bad smell detection.This paper proposes heuristic based bad smell detection algorithm according to the association rules between different code entities.And the paper exploits static code analysis tools to get the necessary structural information of the software system.The structural information can help improve the accuracy of the bad smell detection.3)Experiments.This paper chooses five open source software systems to perform the experiments.It performs the experiments on these software systems using BADE and other competitive approaches to make a comparison.The results demonstrate that the BADE can achieve F-measure between 64% and 92%.BADE can outperform current static based technique for those having evolutionary properties,such as shotgun surgery,divergent change and parallel inheritance.As for duplicated code,blob and feature envy,BADE performs well too.Combing the two technique can achieve higher detection performance.
Keywords/Search Tags:bad smell detection, software evolutionary history, frequent pattern of code change, code change frequent pattern, code change association rules
Related items