Improving Code Generation From Descriptive Text By Combining Deep Learning and Syntax Rules

Xiangru Tang, Zhihao Wang, Jiyang Qi, Zengyang Li · Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering · 2019

Code generation is a model-driven engineering approach that enables developers to generate source code automatically and achieves extremely high development productivity.Specifically, generating code from a descriptive text reduces the time and expense of software development significantly.However, the performance of existing methods is not satisfying, since they are either of low accuracy (lack of specifics of the generated code) or too complicated (lack of efficiency in training).In this work, we proposed three novel methods by combining neural architectures and syntax rules, aiming at explicitly capturing the syntactical characteristics of target code.First, we proposed three models based on the Combination of Deep learning and Syntax rules (CDS models).Then, we evaluated CDS models with BLEU metric by comparing our models with existing methods.The results show that our models outperform existing methods for the challenging code generation task.Finally, we conducted a comparative study between the three CDS models.With further analysis we provided advice on the choice of neural architectures by considering both task accuracy and efficiency.Experimental results show that (1) there is a trade-off between speed and accuracy of the model, and (2) one of our CDS models (i.e., the CDS-POOLING model) outperforms other existing methods for the challenging code generation task.

Read the paper · More papers on PaperTik