Unstructured Error Check and Automatic Code Generation for Flowchart
Ming-Cheng Qu,Nai-Gang Cui,Ya-Nan Zhang,Xiang-Hu Wu
DOI: https://doi.org/10.1166/asl.2015.6572
2015-01-01
Advanced Science Letters
Abstract:Model-Driven Software Development (MDD) and Automated Software Engineering (AUSE) have achieved widespread attention and rapid development. Automatic code generation based on model is one of the most key technologies for MDD and AUSE. In recent years, a number of tools are capable of generating code based on UML or other specific graphics, such as Rhapsody, B4F, Matlab, Win A&D, etc. These tools mostly use state diagram, class diagram, data flow diagram, block diagram for system modeling, and can automatically generate software framework code. But they all lack effective ability of graphic description and code generation for detailed processing procedure or algorithm logic. Structured flowchart has been widely used in software requirements, design and testing phases. Rhapsody has the ability to build flowchart and generate code, but it does not check whether a given flowchart is correct or structural, it will randomly generate 'goto' statements for the error or non-structural features. We proposed three algorithms, i.e., structure feature recognition and code generation O(n) algorithms, error and unstructured feature recognition O(n) algorithm. After a theoretical proof, application development and testing, and comparative analysis with existing tools, the effectiveness, accuracy and advance of the proposed algorithms were proved fully.