code quality is an important aspect of programming education, with duplicate code being a common issue. To help students learn to avoid code duplication, it is useful to provide them with actionable, specific feedback...
详细信息
ISBN:
(纸本)9798400705328
code quality is an important aspect of programming education, with duplicate code being a common issue. To help students learn to avoid code duplication, it is useful to provide them with actionable, specific feedback, not just a generic code duplication warning. In this paper, we introduce the concept of diagnosable code duplication, provide an overview of its various types, and propose a framework for automatic detection. We apply the framework to an introductory programming dataset to demonstrate its ability to provide specific feedback and reveal non-trivial differences in detected cases compared to simpler detectors.
Duplicating a code fragment is the act of copying and pasting it with or without minor modifications into another section of the code base. Despite being an intuitive practice of code reuse, duplicate code brings its ...
详细信息
ISBN:
(纸本)9798400704246
Duplicating a code fragment is the act of copying and pasting it with or without minor modifications into another section of the code base. Despite being an intuitive practice of code reuse, duplicate code brings its own challenges to software maintenance and evolution. To combat the propagation of duplicate code, we developed a plugin for IntelliJ IDEA called AntiCopyPaster, which tracks the pasting of code fragments inside the IDE and suggests the appropriate Extract Method refactoring. Unlike the existing approaches, our tool is integrated with the development workflow, and pro-actively recommends refactorings. Since not all code fragments need to be extracted, we develop a classification model to make this decision. When a code fragment is copy-pasted, the plugin searches for duplicates in the currently opened file, waits for a short period of time to allow the developer to edit the code, and finally inferences the refactoring decision based on a number of features. This tool can be used by educators to control the spread of duplicate code in their students code, and raise their awareness of the exitence of automated refactoring tehchniques that exist in the IDE. The plugin and its source code are publicly available on GitHub at https://***/refactorings/anti-copy-paster. The demonstration video can be found on YouTube: https://***/Y1sbfpds2Ms.
Bad smells in code are indications of low code quality representing potential threats to the maintainability and reusability of software. code clone is a type of bad smells caused by code fragments that have the same ...
详细信息
Bad smells in code are indications of low code quality representing potential threats to the maintainability and reusability of software. code clone is a type of bad smells caused by code fragments that have the same functional semantics with syntactic variations. In the recent years, the research on duplicate code has been dramatically geared up by deep learning techniques powered by advances in computing power. However, there exists little work studying the current state-of-art and future prospects in the area of applying deep learning to code clone detection. In this paper, we present a systematic review of the literature on the application of deep learning on code clone detection. We aim to find and study the most recent work on the subject, discuss their limitations and challenges, and provide insights on the future work. (C) 2021 Elsevier Inc. All rights reserved.
Tato práce se věnuje problematice nalezení zkopírovaných úseků kódu. Pozornost je přitom zaměřena na programovací jazyk Python verze 3 a na úseky kódu pocházejí...
详细信息
Tato práce se věnuje problematice nalezení zkopírovaných úseků kódu. Pozornost je přitom zaměřena na programovací jazyk Python verze 3 a na úseky kódu pocházející ze služby Stack Overflow. Cílem práce je vyhodnocení vlivu kopírování kódu na kvalitu softwarového projektu. Detekce úryvků kódu uvnitř softwarového projektu je provedena pomocí nástroje NiCad. Výchozí proces detekce byl upraven tak, aby se podařilo nalézt co největší počet shodných úryvků. Kvalita kódu je měřena podle míry obsahu duplicitního kódu a dále podle počtu nahlášených chyb daného projektu. Vliv kopírování na kvalitu je vyhodnocen na vzorku open-source projektů pocházejících ze služby GitHub. Vztah mezi přítomností úryvku ze služby Stack Overflow a kvalitou projektu byl prokázán formou statistického testu.
暂无评论