Generating Summaries for Methods of Event-Driven Programs: an Android Case Study
Developers often dedicate a great amount of time to program comprehension. Program comprehension reduces the cost and time of software development and increases maintainability of a program. However, the lack of documentation makes this process cumbersome for developers. Source code summarization is one of the existing solutions to help developers understand software programs more easily. 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. 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. We conducted an empirical evaluation with 14 real-world Android applications and 26 participants to measure the quality of our approach. The experimental results show 32.20% BLEU4 and 16.91% METEOR which are a definite improvement compared to the existing state-of-the-art techniques.
READ FULL TEXT