arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2106.10918cs.SE
收藏

多种源代码表示对软件工程任务的影响——一项实证研究

On the Impact of Multiple Source Code Representations on Software Engineering Tasks -- An Empirical Study

Karthik Chandra Swarna, Noble Saji Mathews, Dheeraj Vagavolu, Sridhar Chimalakonda

AI总结:

本研究实证探讨了结合AST、CFG和PDG多种代码表示对软件工程任务的影响,通过改进基于路径的注意力模型,在方法命名、程序分类和克隆检测上分别提升了11%、15.7%和9.3%的性能,并分析了时间开销。

摘要:

高效地表示源代码对于各种软件工程任务(如代码分类和克隆检测)至关重要。现有方法主要使用抽象语法树(AST),而只有少数方法关注语义图,如控制流图(CFG)和程序依赖图(PDG),这些图包含AST所不具备的源代码信息。尽管一些工作尝试利用多种表示,但它们并未提供关于使用多种表示的成本和收益的任何见解。本文的主要目标是讨论利用多种代码表示(具体为AST、CFG和PDG)的启示。我们修改了一种基于AST路径的方法,使其能够接受多种表示作为基于注意力模型的输入。我们这样做是为了衡量额外表示(如CFG和PDG)相对于AST的影响。我们在三个任务上评估了我们的方法:方法命名、程序分类和克隆检测。与基线相比,我们的方法在这些任务上的性能分别提高了11%(F1)、15.7%(准确率)和9.3%(F1)。除了对性能的影响外,我们还讨论了使用多种表示所带来的时间开销。我们期望这项工作为研究人员提供一个评估各种任务中代码表示组合的视角。

英文摘要:

Efficiently representing source code is crucial for various software engineering tasks such as code classification and clone detection. Existing approaches primarily use Abstract Syntax Tree (AST), and only a few focus on semantic graphs such as Control Flow Graph (CFG) and Program Dependency Graph (PDG), which contain information about source code that AST does not. Even though some works tried to utilize multiple representations, they do not provide any insights about the costs and benefits of using multiple representations. The primary goal of this paper is to discuss the implications of utilizing multiple code representations, specifically AST, CFG, and PDG. We modify an AST path-based approach to accept multiple representations as input to an attention-based model. We do this to measure the impact of additional representations (such as CFG and PDG) over AST. We evaluate our approach on three tasks: Method Naming, Program Classification, and Clone Detection. Our approach increases the performance on these tasks by 11% (F1), 15.7% (Accuracy), and 9.3% (F1), respectively, over the baseline. In addition to the effect on performance, we discuss timing overheads incurred with multiple representations. We envision this work providing researchers with a lens to evaluate combinations of code representations for various tasks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑