Towards automated generation of Java methods: A way of automated reuse-based programming

Kento Shimonaka, Yoshiki Higo, Junnosuke Matsumoto, Keigo Naito, Shinji Kusumoto · 2018

Automatic programming has been researched for a long time. A variety of methodologies have been proposed. However, they have limited applicability, or they can generate only a few lines of code. In this research, the authors are trying to generate source code of Java methods based on their specifications. In this paper, we propose a reuse-based code generation technique with method signature and test cases. First, our technique searches existing Java methods whose signature are the same as the one input by a user. Then, our technique reworks each of them by using test cases input by the user. Methods passing all the test cases are given to the user. At this moment, the authors have implemented a naive prototype and conducted experiments with four open source software. In total, our technique succeeded to generate 18 Java methods. In this paper, we also introduce some actual examples of generated Java methods and some ideas to enhance our technique.

Read the paper · More papers on PaperTik