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

关于上下文在推荐异常处理代码示例中的使用

On the Use of Context in Recommending Exception Handling Code Examples

Mohammad Masudur Rahman, Chanchal K. Roy

摘要:

研究表明,软件开发人员经常滥用异常处理功能或使用效率低下,这样的做法可能会导致一个正在进行的软件项目的脆弱,不安全和非鲁棒的应用系统。在本文中,我们提出了一种上下文感知的代码推荐方法,该方法推荐来自GitHub上托管的许多流行开源代码库的异常处理代码示例。它收集利用GitHub代码搜索API的代码示例,然后通过利用结构(即,基于图的)和词汇特征,而且还包括示例中的异常处理程序的启发式质量度量。4,400个代码示例和65个异常处理场景的实验以及与四种现有方法的比较表明,该方法是非常有前途的。

英文摘要:

Studies show that software developers often either misuse exception handling features or use them inefficiently, and such a practice may lead an undergoing software project to a fragile, insecure and non-robust application system. In this paper, we propose a context-aware code recommendation approach that recommends exception handling code examples from a number of popular open source code repositories hosted at GitHub. It collects the code examples exploiting GitHub code search API, and then analyzes, filters and ranks them against the code under development in the IDE by leveraging not only the structural (i.e., graph-based) and lexical features but also the heuristic quality measures of exception handlers in the examples. Experiments with 4,400 code examples and 65 exception handling scenarios as well as comparisons with four existing approaches show that the proposed approach is highly promising.

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

↑