当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Investigating and Recommending Co-Changed Entities for JavaScript Programs
arXiv - CS - Programming Languages Pub Date : 2021-02-15 , DOI: arxiv-2102.07877
Zijian Jiang, Hao Zhong, Na Meng

JavaScript (JS) is one of the most popular programming languages due to its flexibility and versatility, but debugging JS code is tedious and error-prone. In our research, we conducted an empirical study to characterize the relationship between co-changed software entities (e.g., functions and variables), and built a machine learning (ML)-based approach to recommend additional entity to edit given developers' code changes. Specifically, we first crawled 14,747 commits in 10 open-source projects; for each commit, we created one or more change dependency graphs (CDGs) to model the referencer-referencee relationship between co-changed entities. Next, we extracted the common subgraphs between CDGs to locate recurring co-change patterns between entities. Finally, based on those patterns, we extracted code features from co-changed entities and trained an ML model that recommends entities-to-change given a program commit. According to our empirical investigation, (1) 50% of the crawled commits involve multi-entity edits (i.e., edits that touch multiple entities simultaneously); (2) three recurring patterns commonly exist in all projects; and (3) 80--90% of co-changed function pairs either invoke the same function(s), access the same variable(s), or contain similar statement(s); and (4) our ML-based approach CoRec recommended entity changes with high accuracy. This research will improve programmer productivity and software quality.

中文翻译:

调查和推荐JavaScript程序的共同更改实体

由于JavaScript(JS)的灵活性和多功能性,它是最受欢迎的编程语言之一,但是调试JS代码既繁琐又容易出错。在我们的研究中,我们进行了一项经验研究,以表征共同更改的软件实体(例如,功能和变量)之间的关系,并建立了一种基于机器学习(ML)的方法,以推荐其他实体来编辑给定开发人员的代码更改。具体来说,我们首先在10个开源项目中抓取了14,747个提交;对于每次提交,我们创建了一个或多个更改依赖关系图(CDG),以对共同更改的实体之间的引用者-引用者关系进行建模。接下来,我们提取了CDG之间的公共子图,以定位实体之间的重复性共同变更模式。最后,根据这些模式,我们从共同变更的实体中提取了代码功能,并训练了一个ML模型,该模型建议在程序提交后建议变更实体。根据我们的经验研究,(1)50%的爬网提交涉及多实体编辑(即,同时接触多个实体的编辑);(2)所有项目中普遍存在三种重复模式;(3)80--90%的共同更改函数对调用相同的函数,访问相同的变量或包含相似的语句;(4)我们的基于ML的方法CoRec建议以较高的准确性更改实体。这项研究将提高程序员的生产率和软件质量。同时接触多个实体的编辑);(2)所有项目中普遍存在三种重复模式;(3)80--90%的共同更改函数对调用相同的函数,访问相同的变量或包含相似的语句;(4)我们的基于ML的方法CoRec建议以较高的准确性更改实体。这项研究将提高程序员的生产率和软件质量。同时接触多个实体的编辑);(2)所有项目中普遍存在三种重复模式;(3)80--90%的共同更改函数对调用相同的函数,访问相同的变量或包含相似的语句;(4)我们的基于ML的方法CoRec建议以较高的准确性更改实体。这项研究将提高程序员的生产率和软件质量。
更新日期:2021-02-17
down
wechat
bug