Font Size: a A A

Research And Implementation Of Code Smell Detection Based On Empirical Research

Posted on:2018-06-01Degree:MasterType:Thesis
Country:ChinaCandidate:X H LiuFull Text:PDF
GTID:2348330515483926Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Code smell is unreasonable programming,it will be 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.Current research results pay attention to only several specific kinds of code smell,and then several kinds of code smell can't be taken seriously.To find what kinds of code smells could these detection tools of code smell detect.Meanwhile,we try to detect code smell as much as possible,meanwhile to improve the detection precision.In addition,to explore that whether detection tools could be applied to the detection of industrial projects or not.The work of the paper is as follows.(1)We carry out a systematic literature review about 22 code smells.Through electronic search,manual search,snowball retrieval and quality evaluation,a total of 286 articles were collected and code smell related papers,then put these papers up data records.Through the statistical data in the paper,we found that the code smell-duplicated code,larger class,etc are code smells of easy quantitative analysis,it could be detected by lots of detection tools;such as code smell-lazy class,etc are not code smell of easy to quantitative analysis;secondly,almost all software system selection experiment in the paper is the laboratory type,industry type is less.(2)This study proposes a new detection tool:DT.DT mainly use two kinds of detection thoughts:dynamic programming algorithm and abstract syntactic tree.Abstract syntax tree is mainly used in the detection of code smell-duplicated code.Through detecting similarity of lines of code,we judge the existence of duplicated code.Abstract syntax tree are used in other kinds of code smell,AST uses a tree structure to represent the source code,the grammatical structure of the source code transform into tree nodes.Through the statistical analysis of these nodes,we can determine the existence of code smell.(3)Comprehensive experiment is carried out.By using the proposed detection tool DT,we can detect 10 kinds of code smell.Meanwhile DT can get higher detection accuracy than four kinds of famous detection tools Checkstyle,PMD,JDeodorant and iPlasma.In addition detection tool DT can support the detection of large industrial projects,these above four famous detection tools can't support to detect large industrial projects.
Keywords/Search Tags:covariate-relation graph, attributed covariate-relation graph, low-rank subspace, graph sparse representation classification
PDF Full Text Request
Related items