Font Size: a A A

Refactoring-Oriented Recommondation

Posted on:2016-09-12Degree:DoctorType:Dissertation
Country:ChinaCandidate:Y GaoFull Text:PDF
GTID:1108330503453431Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Software requirements change frequently, which results in the evolution of software applications. As a result, source code is added or deleted by programmers frequently, which breaks the original software design. Consequently, software architecture becomes unclear and source code becomes difficult to comprehend. The maintainability and extendibility of the software applications are reduced.Software refactoring is an effective technique to improve software quality. It is to improve the readability, maintainability and extendibility of software by adjusting its internal structure whereas the external characters of software are not changed. Since William F. Opdyke proposed the conception of software refactoring for the first time in 1992, software refactoring has been a hot spot of research and has been well-recognized in the industry and academia. Researchers have carried out a large amount of research work on software refactoring and have designed a number of refactoring tools.However, software refactoring is a complicate activity of adjusting code. It requires programmers to make various complex decisions, such as where to refactor, when to refactor and how to refactor.Applying automatic recommendation technology to reduce the difficulty of complex refactoring decision-making is not only an important way to reduce the cost of software refactoring and improve the effect of software refactoring,but also an important technical foundation to promote software refactoring application. To this end, this paper proposes a refactoring-oriented recommondation approach to help programmers make decision while refactoring, thereby reduces the difficulty of software refactoring and improves the effect of software refactoring. The main contributions of the dissertation are listed as follows:(1) An approach to recommending method names based on source code depositoryand feature matchingRenaming is one of the most common refactoring operations. Programmers assign meaningful names to software entities through rename refactoring. But it requires people make decision on how to choose appropriate name. It is difficult for the programmers who are inexperienced beginners or whose mother language is not English to select appropriate names. To this end, we propose an approach to recommend method name based on source code depository and feature matching. In the approach,method names are parsed by speech tagging technique in natural language;Code feature extraction technique is used to extract part of the code with function characteristics;Parsed words would be associated with feature code and the relationship would be used to find appropriate words to recommend method names for programmers。Evaluation results suggested that the proposed approach has upper successful of recommendation.(2) An approach to recommending refactoring from test case changesMany beginning programmers are inexperienced in software refactoring and are not familiar with refactoring tool. Therefore, they rarely perform refactoring through software refactoring tools. If we can infer refactoring inference from test code changes, we can remind or guide programmer using refactoring tools, in turn, reduce the artificial error and refactoring difficulty. To this end, we proposed an approach to recommend refactoring from test case changes. We proposed a set of heuristics based on the impact mode of refactoring on the test code in the approach。It can be used to match test code changes and recommend refactoring when monitor test code modification in the process of programming。Evaluation results suggested that the proposed approach has high accuracy of recommendation.(3) A resolution sequence for software refactoring based on severity prioritySoftware refactoring is an effective approach to eliminate code smells. But software refactoring is a high cost activity. In recource constrained conditions, we cannot eliminate all code smells through software refactoring. We should choose the most serious smells to refactor so as to get the max quality improvement of software. To this end, in the thesis,we analyze ten kinds of typical code smells according to causes,safety,symptom,influence and seriousness. We classify the code smells based on the analysis results and clarity the feature of each level(such as threats security, influence range). Evaluation results suggested that refactoring according to the proposed priority based code smell eliminating sequence can improve the overall effect of refactoring.
Keywords/Search Tags:software refactoring, bad smell, software maintenance, recommendation, test driven, automation
PDF Full Text Request
Related items