Font Size: a A A

Research On Detection Technology Of Duplicated Code

Posted on:2006-10-24Degree:MasterType:Thesis
Country:ChinaCandidate:J Z LiFull Text:PDF
GTID:2168360155962940Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Software continuously becomes more and more difficult to understand and maintain with time elapsing. Refactoring is a key technique to acquire software quality, which is to restructure and reorganize software without changing its external observable behaviour. However, "Where did Refactoring Come From" is one key issue to refactoring.Duplicated code is the worst "bad smells". Kontogiannis metrics is a technique of detecting the duplicated code. However, false matches will be taken place on account of two reasons, when this technique is used to detect the duplicated code. The first is that the complexity of the control flow between if statement and loops statement cannot be distinguished by the McCabe metrics, which is used by the Kontogiannis metrics. The second is that the Kontogiannis metrics doesn't make judgement of the types of the returns of the two compared methods. In this paper. Kontogiannis metrics is improved by introducing two new variables so that the accuracy of detecting the duplicated code is raised and the false matches are reduced. And a technique based-on process blueprint is proposed, which measures the software cyclomatic complexity. This technique simplifies the process of the measuring and easy to implement. It is more efficient than the traditional method.Kontogiannis metrics search for duplicates using the knowledge that two clones have similar structural and functional properties, so it can recongnize the similar functions. The parameterized string matching method proposed by Baker can detect duplicated blocks. However, its ability to solve problem is limited for the space complexity. In order to reduce the space complexity of the arithmetic and avoid transforming the source code to p-suffix tree, the method is improved based-on process blueprint.Duplicated code can be detected accurately by integrating two different techniques organically in the same context. Based on process blueprint, we can avoid transforming the source code to not only abstract syntax tree but also p-suffix tree. So that more effective technology is provided for the localization of automatic refactoring.
Keywords/Search Tags:Detection of duplicated code, Program refactoring, Cyclomatic Complexity, Procedure Blueprint, Abstract Logic Structure Diagram (AISD)
PDF Full Text Request
Related items