arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2209.03198cs.SE
收藏

什么时候名字相似或相同?代码名称匹配器库简介

When Are Names Similar Or the Same? Introducing the Code Names Matcher Library

Moshe Munk, Dror G. Feitelson

摘要:

程序代码包含由名称表示的函数、变量和数据结构。为了促进人们的理解,这些名称应该描述它们所代表的代码元素的作用和用途。但开发人员给出的名称显示出高度的可变性,反映了每个开发人员的品味,不同的词用于相同的含义或相同的词用于不同的含义。这使得比较名字变得困难。精确的比较应该基于匹配相同的单词,但也要考虑单词的可能变化(包括拼写和打字错误),单词的重新排序,同义词之间的匹配,等等。为了方便起见,我们开发了一个比较函数库,专门针对代码中的名称进行比较。不同的函数以不同的方式计算名称之间的相似性,因此研究人员可以选择适合其特定需求的函数。所有这些都试图反映人类对相似性的看法,可能会牺牲词汇匹配。

英文摘要:

Program code contains functions, variables, and data structures that are represented by names. To promote human understanding, these names should describe the role and use of the code elements they represent. But the names given by developers show high variability, reflecting the tastes of each developer, with different words used for the same meaning or the same words used for different meanings. This makes comparing names hard. A precise comparison should be based on matching identical words, but also take into account possible variations on the words (including spelling and typing errors), reordering of the words, matching between synonyms, and so on. To facilitate this we developed a library of comparison functions specifically targeted to comparing names in code. The different functions calculate the similarity between names in different ways, so a researcher can choose the one appropriate for his specific needs. All of them share an attempt to reflect human perceptions of similarity, at the possible expense of lexical matching.

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

↑