Volume 14, Number 6

Code Swarm: A Code Generation Tool based on the Automatic Derivation of Transformation Rule Set

  Authors

Hina Mahmood1, Atif Aftab Jilani2 and Abdul Rauf3, 1McMaster University, Canada, 2FAST-National University of Computer and Emerging Sciences, Pakistan, 3Knightec AB, Sweden

  Abstract

Automatic generation of software code from system design models remains an actively explored research area for the past several years. A number of tools are currently available to facilitate and automate the task of generating code from software models. To the best of our knowledge, existing software tools rely on an explicitly defined transformation rule set to perform the model-to-code transformation process. In this paper, we introduce a novel tool named Code Swarm, abbreviated as CodS, that automatically generates implementation code from system design models by utilizing a swarm-based approach. Specifically, CodS is capable of generating Java code from the class and state models of the software system by making use of the previously solved model-to-code transformation examples. Our tool enables the designers to specify behavioural actions in the input models using the Action Specification Language (ASL). We use an industrial case study of the Elevator Control System (ECS) to perform the experimental validation of our tool. Our results indicate that the code generated by CodS is correct and consistent with the input design models. CodS performs the process of automatic code generation without taking the explicit transformation rule set or languages metamodels’ information as input, which distinguishes it from all the existing automatic code generation tools.

  Keywords

Automatic Code Generation, Model-to-Code Transformation, Transformation by Example, Swarm Intelligence, Particle Swarm Optimization (PSO), Action Specification Language (ASL), Transformation Rules, Metamodels.