Publication | Closed Access
NICAD: Accurate Detection of Near-Miss Intentional Clones Using Flexible Pretty-Printing and Code Normalization
507
Citations
33
References
2008
Year
Unknown Venue
EngineeringPotential ClonesVerificationData DeduplicationSoftware EngineeringSource Code AnalysisSoftware AnalysisFormal VerificationCode NormalizationHardware SecurityComputational LinguisticsAgile ParsingProgram TransformationIsland GrammarsAccurate DetectionCode GenerationComputer EngineeringComputer ScienceStatic Program AnalysisSoftware DesignCode RefactoringMutation-based TestingContent Similarity DetectionProgram AnalysisSoftware TestingFormal Methods
A source transformation system underpins the clone detection approach by providing flexible pretty‑printing, efficient extraction, and code normalization. The paper examines the effectiveness of a lightweight, language‑specific parser‑based clone detection approach and demonstrates its use for finding function clones in C code. The method exploits a source transformation system that offers agile parsing for flexible pretty‑printing, island grammars for efficient extraction of potential clones, and transformation rules for code normalization, enabling accurate near‑miss clone detection via efficient text line comparison. Early experiments show the method achieves high precision and recall in detecting near‑miss clones while maintaining reasonable performance.
This paper examines the effectiveness of a new language- specific parser-based but lightweight clone detection approach. Exploiting a novel application of a source transformation system, the method accurately finds near-miss clones using an efficient text line comparison technique. The transformation system assists the method in three ways. First, using agile parsing it provides user-specified flexible pretty- printing to remove noise, standardize formatting and break program statements into parts such that potential changes can be detected as simple linewise text differences. Second, it provides efficient flexible extraction of potential clones to be compared using island grammars and agile parsing to select granularities and enumerate potential clones. Third, using transformation rules it provides flexible code normalization to allow for local editing differences between similar code segments and filtering out of uninteresting parts of potential clones. In this paper we introduce the theory and practice of the framework and demonstrate its use in finding function clones in C code. Early experiments indicate that the method is capable of finding near-miss clones with high precision and recall, and with reasonable performance.
| Year | Citations | |
|---|---|---|
Page 1
Page 1