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

Moshe Munk, Dror G. Feitelson
9/7/2022
cs.SE

Official code: moshmunk/name_compare (2 stars, Python, MIT, last commit 2022-09-08).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

Python Library for Names Comparisons

20PythonApr 6, 20224 years agoMIT

Similar Papers

Cite this paper

@article{munk2022when,
  title  = {When Are Names Similar Or the Same? Introducing the Code Names Matcher Library},
  author = {Moshe Munk and Dror G. Feitelson},
  year   = {2022},
  eprint = {2209.03198},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.03198}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2209.03198.svg)](https://codeofpaper.com/paper/2209.03198)

Discussion