Generating Boundary Values from OCL Constraints Using Constraints Rewriting and Search Algorithms

Shaukat Ali,Tao Yue,Xiang Qiu,Hong Lu
DOI: https://doi.org/10.1109/cec.2016.7743819
2016-01-01
Abstract:A key component of model-based testing is the generation of test data from constraints (e.g., specified in the Object Constraint Language (OCL)) associated with models e.g., specified in the Unified Modeling Language (UML). The quality of test data eventually determines the effectiveness of test cases, e.g., fault detection and coverage. A simple way to generate test data from an OCL constraint is to find a set of values for all the variables that satisfies the constraint. One way of improving the quality of test data is by generating test data at the boundaries of each variable in the constraint. In this paper, we extend our search-based test data generation approach to generate test data at the boundaries of each variable involved in a constraint. We present different cases of constraints involving different types of variables and how we rewrite them in order to automatically generate boundary values using our existing OCL Solver called EsOCL based on a set of heuristics. We empirically evaluated our heuristics using three search algorithms, i.e., Genetic Algorithm, (1+1) Evolutionary Algorithm, and Alternating Variable Method, on industrial OCL constraints from our previous work. Results show that AVM on average achieved a 95% of success rate and outperformed the rest of the algorithms in finding all the boundary values of constraints in fewer generations.
What problem does this paper attempt to address?