arrow
返回

Sequential coding patterns: How to use them effectively in code recommendation

delete2021-12-01
delete7
PRE
AI
L
Luiz Laerte Nunes da Silva
T
Troy Kohwalter *
A
Alexandre Plastino
L
Leonardo Murta
DOI:10.1016/j.infsof.2021.106690delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Context: Some programming constructs frequently appear together in different parts of the code, representing sequential coding patterns throughout the project. These sequential coding patterns can be mined from the project repository and, whenever the code a developer is writing coincides with the beginning of a sequential pattern, the remainder of this pattern can be suggested to the developer. This is equivalent to the usual Code Completion, which suggests syntactic structures based on the line being programmed. However, instead of providing syntactic suggestions for completing the current line, such feature suggests code snippets containing multiple lines. Objective: This paper contributes with an in-depth study on how code pattern recommendation can be used effectively. Method: We answer three research questions through a quantitative study using a robust experimental infrastructure with a corpus of five open-source projects: (1) In a code recommendation, how many frequent coding patterns should be presented?'', (2) What is the impact of filtering sequential patterns by their confidence?, and (3) Does the effectiveness of the sequential coding patterns degrade over time?''. Results: Our study shows that it is possible to achieve correctness above 80% when using suggestions with the highest confidence values and that a threshold confidence of 30% generally provides better outcomes. Furthermore, it shows that frequent code pattern completion effectiveness tends to degrade 50 commits after the patterns have been mined. Conclusion: We could observe that: (1) the top five ranked suggestions are the ones that deliver the best results; (2) the code recommendations that deliver the best results are the ones with the highest confidence values; and (3) the code recommendation performance degrades as the source code evolves because patterns become outdated.
Keyword:
Sequential code patterns
Data mining
Recommendation system
Version control system

期刊

Information and Software Technology 封面图
Information and Software Technology
IF:
4.3
论文数:
3.8K
被引数:
7.7K

机构

Universidade Federal Fluminense 封面图
Universidade Federal Fluminense
学者数:
9.7K
论文数: 6.4K
被引数: 4.8K
引用论文

引用论文

Timing of cyclic estradiol treatment differentially affects cognition in aged female rhesus monkeys.
err2018-08-01
err0
errOAAI
errMark G. Baxter; Anthony C. Santistevan; Eliza Bliss-Moreau; John H. Morrison
err分享
err收藏
GAS SENSITIVITY OF CuO/ZnO HETERO-CONTACT
err2006-03-27
err0
PREAI
errYoshinobu Nakamura; Akiro Ando; Tsuyoshi Tsurutani; Osamu Okada; Masaru Miyayama; Kunihito Koumoto; Hiroaki Yanagida
err分享
err收藏
Fiber optic glucose biosensor
err2006-10-01
err0
PREAI
errIgnacio Del Villar
err分享
err收藏
没有更多内容