Automatic generation of test models and properties from UML models with OCL constraints
Model-Based Testing and Property-Based Testing are two testing methodologies that usually facilitate the automation of the generation of test cases, using either models or properties as basis to derive complete test suites. In doing so, they also contribute to reduce both the source code needed for testing purposes and the time spent on writing those tests, hence saving effort and increasing maintainability. In this paper, we describe how to generate complete property-based test suites automatically translated from a model that describes the system under test, specifically a UML model with OCL constraints. The proposed approach can be applied to both stateless and stateful components. We have used QuickCheck, an automatic property-based testing tool for test case generation, execution and diagnosis, as support tool. Our method produces QuickCheck executable test models as output, so we use the same tool to run and evaluate them. As part of our work, we analyze and discuss the advantages and disadvantages of our approach in contrast to writing test suites manually.