Source Code Generation-based on NLP and Ontology

Document Type : Original Article

Authors

1 computer science / FCIS - Ain Shams University

2 Information Systems Department, Faculty of Computer and Information Sciences, Ain Shams University, Cairo, Egypt

3 Department Computer Science, Faculty of Computer and Information Sciences,Ain Shams University, Cairo, Egypt.

4 Computer Sciece Department, Faculty of Computer and Information Sciences, Ain Shams University

Abstract

Generating source code is necessary especially as software evolves in complexity and demand. Finding a mechanism to generate the source code according to the requirements will save time for developers at the stage of development of the software. In this paper, a mechanism is proposed to generate the source code based on the database schema and user requirements (user story). This model contains three layers: The first layer is to analyze each of the database schema, extract the relationships between the tables, determine the meanings of the fields and analyze the user’s story to find the functions performed by each role of the software users. The second layer is deducing new functions based on what was mentioned in the first layer and extracting the knowledge that contains the solutions to the problems that are inferred. The knowledge bases used are WordNet and Backend Ontology built from scratch. In the third Layer, the solutions are converted to source code based on templates extracted from the knowledge and configured, that is applied to the templates. The model showed success in generating the source code, generating PHP source code for a site that is tested and generated seventy percent of what was required to be written by programmers.

Keywords