本文已被:浏览 494次 下载 1718次
Received:December 21, 2022 Revised:January 19, 2023
Received:December 21, 2022 Revised:January 19, 2023
中文摘要: 性能bug是指代码中降低程序运行效率的缺陷. 现有的检测工具只能查找特定类型的性能bug并且需要复杂的程序分析过程, 因而缺乏通用性并且时空开销巨大. 同时, 有许多经典的克隆检测技术被用于一般性相似代码检测, 但是它们只能检测高度相似的代码或者需要依赖训练集, 使得它们难以用于在真实数据集中查找性能bug. 基于此, 通过构建带有标记token的代码模板, 本文提出一种使用克隆检测技术来查找多种类型的性能bug的方法. 通过对不同类型和频度的token标记不同的权重, 本文提出的方法可以区分其重要性并因此提取出代码中的关键信息. 在真实项目构成的数据集上的实验表明, 本方法可以发现更多类型的性能bug同时比现有工具耗时更少. 另一项实验也证明了本方法显著提升了基于token的克隆检测技术的检测能力, 相比于现有的克隆检测方法更适合用于性能bug查找.
Abstract:Performance bugs are defects in codes that slow down program execution. Existing detection tools can only find certain types of performance bugs and require complex program analysis processes. Therefore, they lack generality and need high costs in space and time. Meanwhile, many classical clone detection techniques have been used for general similar code detection, but they can only detect highly similar codes or rely on training datasets, which makes them inapplicable for detecting performance bugs in real-world datasets. To this end, this study proposes a method of using clone detection techniques to find multiple types of performance bugs by constructing code templates with labeled tokens. By labeling tokens with different weights according to their types and frequencies, this method can distinguish tokens’ importance and thus extract key information from codes. Experimental results on real-world projects show that this method can find more types of performance bugs and consume less time than existing tools. Another experiment also proves that this method significantly improves the detection capability of token-based clone detection techniques and is more suitable for finding performance bugs than existing clone detection techniques.
文章编号: 中图分类号: 文献标志码:
基金项目:国家自然科学基金(61672480); 国家外专局111引智计划(BP0719016)
引用文本:
邓子含,徐云.基于克隆检测技术的性能Bugs查找.计算机系统应用,2023,32(7):57-64
DENG Zi-Han,XU Yun.Finding Performance Bugs Based on Clone Detection Technique.COMPUTER SYSTEMS APPLICATIONS,2023,32(7):57-64
邓子含,徐云.基于克隆检测技术的性能Bugs查找.计算机系统应用,2023,32(7):57-64
DENG Zi-Han,XU Yun.Finding Performance Bugs Based on Clone Detection Technique.COMPUTER SYSTEMS APPLICATIONS,2023,32(7):57-64