Generating Pseudo-Code from Source Code Using Deep Learning

Abdulaziz Alhefdhi, Hoa Khanh Dam, Hideaki Hata, Aditya Ghose · 2018

Pseudo-code written in natural language and mathematical expressions is a useful description of source code. Pseudocode aids programmers in understanding the code written in a programming language they are not familiar with. However, writing pseudo-code for each code statement is labour intensive. In this paper, we propose a novel approach to automatically generate pseudo-code from source code using Neural Machine Translation. Our model is built upon the deep learning encoder-decoder using the attention-based Long Short-Term Memory architecture to capture the long-term dependencies in both source code and pseudo-code. An empirical evaluation on a real Python dataset demonstrates the applicability of our approach in practice.

Read the paper · More papers on PaperTik