An automated search‐based test model generation approach for structural testing of model transformations. Issue 11 (9th May 2022) - Jilani, Atif Aftab; Khan, Muhammad Uzair; Iqbal, Muhammad Zohaib; Usman, Muhammad
Abstract: Model transformation testing has become crucial as model‐driven engineering has raised the abstraction level for developing software systems. Transformation is written to transform models from one level of abstraction to another, for example, model to model or model to code. A major challenge in testing the transformation is the creation of test models, such that (i) they conform to the source meta‐model (i.e., multiplicities and Object Constraint Language [OCL] constraints on meta‐model) and (ii) they provide coverage of the complete transformation (solving branch conditions for traversing all paths). Manual creation of test models requires a lot of time and effort. Still, the validity of the developed test models cannot be ensured. This paper aims to solve the above challenges using an automated search‐based strategy. The proposed approach is two‐stepped. First, valid test models are generated by solving source meta‐model constraints. Second, the generated models are evolved for achieving the structural coverage of the transformation by solving the branch conditions. A toolset model transformation testing environment (MOTTER) is developed to automate the search‐based solution. The proposed work is empirically evaluated on two case studies using four search algorithms. The result reflects that it successfully generates valid test models for achieving desired structural coverage with high performance on both the case studies. Abstract : This paper proposes an automated search‐based test model generation approach for structural testing of model transformations that specifically generates valid test model instances. The contributions of the paper include (i) a strategy for solving multiplicity and OCL constraints on the meta‐model, (ii) a strategy for solving branch conditions in the transformation code, (iii) approach and branch distance heuristics for fitness functions, and (iv) evaluation on the benchmark and industrial case studies. The result shows that the approach is successful in generating valid test models, achieves desired branch coverage for the transformation, and has potential to reduce the effort and time.