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

为事件驱动程序的方法生成摘要:Android案例研究

Generating Summaries for Methods of Event-Driven Programs: an Android Case Study

Alireza Aghamohammadi, Maliheh Izadi, Abbas Heydarnoori

摘要:

缺乏适当的文档使程序理解成为开发人员的一个繁琐的过程。源代码摘要是解决这个问题的现有解决方案之一。近年来,人们提出了许多源代码摘要的方法。这些解决方案的一个普遍的弱点是,它们不太关注软件元素之间的交互。元素只是一个可调用的代码片段,比如一个方法,甚至是一个可单击的按钮。因此,这些方法不能应用于事件驱动的程序,例如Android应用程序,因为它们具有特定的功能,例如它们的元素之间的大量交互。为了解决这个问题,我们提出了一种基于深度神经网络和动态调用图的新方法来生成事件驱动程序方法的摘要。首先,我们从Github收集一组注释/代码对,并在集合上训练一个深度神经网络。之后,通过利用动态调用图、Pagerank算法和预训练的深度神经网络,我们生成摘要。对14个真实世界的Android应用程序和42名参与者的经验评估表明,BLEU 4为32.3%,与现有的最先进的技术相比,这是一个明确的改进。我们还从开发人员的角度评估了我们生成的摘要的信息量和自然性,并表明它们足够容易理解和信息丰富。

英文摘要:

The lack of proper documentation makes program comprehension a cumbersome process for developers. Source code summarization is one of the existing solutions to this problem. Lots of approaches have been proposed to summarize source code in recent years. A prevalent weakness of these solutions is that they do not pay much attention to interactions among elements of a software. An element is simply a callable code snippet such as a method or even a clickable button. As a result, these approaches cannot be applied to event-driven programs, such as Android applications, because they have specific features such as numerous interactions between their elements. To tackle this problem, we propose a novel approach based on deep neural networks and dynamic call graphs to generate summaries for methods of event-driven programs. First, we collect a set of comment/code pairs from Github and train a deep neural network on the set. Afterward, by exploiting a dynamic call graph, the Pagerank algorithm, and the pre-trained deep neural network, we generate summaries. An empirical evaluation with 14 real-world Android applications and 42 participants indicates 32.3% BLEU4 which is a definite improvement compared to the existing state-of-the-art techniques. We also assessed the informativeness and naturalness of our generated summaries from developers' perspectives and showed they are sufficiently understandable and informative.

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

↑