Publication | Closed Access
Deep learning code fragments for code clone detection
560
Citations
95
References
2016
Year
Unknown Venue
Software MaintenanceEngineeringMachine LearningClone DetectionSoftware EngineeringSource Code AnalysisSoftware AnalysisNatural Language ProcessingData ScienceData MiningComputational LinguisticsCode Clone DetectionSoftware MiningSource CodeCode GenerationKnowledge DiscoveryComputer ScienceDeep LearningCode RepresentationSoftware DesignCode RefactoringContent Similarity DetectionProgram AnalysisSoftware Testing
Code clone detection is crucial for software maintenance, yet existing methods typically focus on either structure or identifiers and rely on handcrafted features, failing to model both sources of information. The study introduces and evaluates a learning‑based code clone detection approach that mines representations directly from the repository to assess its feasibility for software maintainers. The approach uses deep learning to link lexical and syntactic patterns mined from the repository, and evaluates this framework on 398 file‑ and 480 method‑level pairs from eight Java systems. The evaluation showed 93 % true positives across file‑ and method‑level pairs, covering all four clone types, and outperformed the structure‑oriented tool Deckard, confirming the approach’s suitability for clone detection.
Code clone detection is an important problem for software maintenance and evolution. Many approaches consider either structure or identifiers, but none of the existing detection techniques model both sources of information. These techniques also depend on generic, handcrafted features to represent code fragments. We introduce learning-based detection techniques where everything for representing terms and fragments in source code is mined from the repository. Our code analysis supports a framework, which relies on deep learning, for automatically linking patterns mined at the lexical level with patterns mined at the syntactic level. We evaluated our novel learning-based approach for code clone detection with respect to feasibility from the point of view of software maintainers. We sampled and manually evaluated 398 file- and 480 method-level pairs across eight real-world Java systems; 93% of the file- and method-level samples were evaluated to be true positives. Among the true positives, we found pairs mapping to all four clone types. We compared our approach to a traditional structure-oriented technique and found that our learning-based approach detected clones that were either undetected or suboptimally reported by the prominent tool Deckard. Our results affirm that our learning-based approach is suitable for clone detection and a tenable technique for researchers.
| Year | Citations | |
|---|---|---|
Page 1
Page 1