Font Size: a A A

Dynamic Threshold Adaptation For Code Smell Detection

Posted on:2017-04-21Degree:MasterType:Thesis
Country:ChinaCandidate:Q R LiuFull Text:PDF
GTID:2308330503458924Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
Software refactoring is an important technology to improve software quality by adjusting software internal structure. In order to determine where need refactor, people put forward the concept of code smell is used to represent the code design is not reasonable. However, manual identification of code smells is difficult and need to spend a lot of valuable human resources. Thus, researchers have proposed dozens of algorithms and tools to identify code smells.Considering the subjectivity of software refactoring, these algorithms usually expose thresholds to engineers for customization. First, code smell identification is essentially subjective and application specific. For example, to identify long methods to extract method, detection algorithms should decide how long is long. Second, engineers have different working schedules and different requirements on software quality. They need customize thresholds according to their unique working schedules and quality requirements. However, most engineers usually do not know the exact quantitative relations between thresholds’ settings and performance. Thus, it is difficult for software engineers to manually adjust thresholds in smell detection algorithms.So, we propose an approach to adapt thresholds of smell detection tools automatically and dynamically. This method optimize threshold Settings in bad smell detection according to the feedback of the programmer. Specific optimization process includes the following several steps. First, engineers customize a threshold, target precision, manual according to their working schedules and quality requirements. Second, with feedback from engineers, the threshold adaption maximizes recall while having precision close to the target precision. We analyze four common code smells from five open source applications from SourceForge. Evaluation results suggest that our approach is more effective than the existing method, reduces the distance between actual precision and target precision by 80% on average and initial threshold values have little influence on the effect of our approach. Therefore our approach is very effective.
Keywords/Search Tags:software refactoring, code smells, feedback control, smell identification
PDF Full Text Request
Related items