# Bi-LSTM-Based Neural Source Code Summarization
## 1 Introduction  
Lack of documentation causes cost growth and an extension in a project's schedule. Manual documentation takes extra effort, and it is hard to maintain, causing frustration for developers when making new changes to their code. The automatic generation of comments saves time for developers, and it is effective in terms of simulating human comments. Long short-term memory (LSTM) has shown its effectiveness in text summarization and translation. In software development and maintenance, software details, such as dependencies, internal structures, integrations, and configurations, must be properly documented in the same source code files. Code comments are essential to software and can help in decreasing the time of software development, better understanding, easy code alteration, better bug detection, and, most importantly, can allow for software reuse. Code comments are one of the most important artifacts to understand for maintenance. A study in [1] showed that artifacts such as literature and architectural models are not as important as code comments. An earlier study has shown that, on average, developers spend 60% of their time on program understanding [2]. A commented code is easier to understand than an uncommented code. Therefore, developers save much time by reading the code description to find key information needed for a code change or maintenance. The absence of code comments can greatly decrease software quality and maintainability. However, because of the dynamic nature of software projects and project management's tight schedules, source code documentation is usually ignored. Code documentationis time-consuming and difficult to write effectively. To address this issue, many studies have introduced the idea of automated source code documentation [1; 2; 3; 4; 5; 6; 7]. Automatic source code documentation can significantly improve software development in terms of speed, quality, easy code handovers, and code reusability. An important component of automated documentation is source code summarization. The source code summarizer generates natural language sentences that explain the functionality of the source code. Summaries such as \"updates the log files in the server\" or \"generates a serial number from a random function and timestamp\" can give a clear picture of how the code works and save the developer from tracing 20+ lines of code. Source code summarization is an expanding research area. Developers are often blamed and noted for neglecting the manual effort of code commenting [4; 8]. Recent studies on code summarization have proved that high-quality, consistent comments can be generated automatically with deep neural networks that are trained on a large corpus [2; 5]. These approaches lack the usage of context and domain knowledge, and they only rely on syntax or language structure [9; 10]. Certain approaches, such as [11; 12], retrieve the code comments from a similar code. Some approaches, such as that discussed in [13], investigated the use of the two-input information, lexical and syntactic, with a gated recurrent unit (GRU) encoder-decoder. In [14], authors combine both retrieval-based and bidirectional GRU with two inputs. The Bi-LSTM showed better performance than a simple LSTM in Python [15; 16]. Our proposed solution aims to study the impact of code's structural features when a Bi-LSTM attentional encoder-decoder model, with two encoders, is applied to the Java method's comment generation. We propose two methods based on neural networks for generating summaries for source code. The two methods use different types of information to compare which information can enhance the performance of the prediction. In Section 2, we will show the general framework of deep neural network-based code comment generators. In Section 3, we will present the related works. Then, in Section 4, we will describe our methodology. Afterward, in Section 5, we will present our implementation details and discuss our results.