A Case Study on Combining Model-based Testing and Constraint Programming for Path Coverage

  1. Maria Carmen de Castro-Cabrera 1
  2. Antonio Garcia-Dominguez 2
  3. Inmaculada Medina-Bulo 1
  1. 1 Department of Computer Science. University of Cadiz. Cadiz, Spain
  2. 2 Department of Computer Science. University of York. York, United Kingdom
Actas:
ICSEA 2022 The Seventeenth International Conference on Software Engineering Advances

Editorial: ICSEA 2022 Editors Lugi Lavazza, University of Insubria at Varese, Italy

ISBN: 978-1-61208-997-3

Año de publicación: 2022

Páginas: 41-45

Tipo: Aportación congreso

Resumen

In the context of advances in software testing, this paper is related to the generation of test suites and black box testing. Test coverage is a popular technique to evaluate test quality: a test suite that can exercise a large part of the paths in a program will provide a high confidence that the program will work as expected. One way to obtain test suites with high path coverage is through model-based testing, and specifically using a diagram, which represents the various states in the program and their possible transitions. Using model-based testing, it is possible to obtain a set of paths that achieves a set of coverage criteria. Constraint programming approaches can then be used to turn each path into a test case with its program inputs and oracle, by solving the input and output constraints collected along the path. In this paper, we present a case study on this combination of techniques, by developing a state diagram that represents a popular piece of software, and using it to derive a set of test cases that achieve path coverage through constraint programming. Specifically, two tools have been used: GraphWalker (to obtain a set of paths through the program) and MiniZinc (to obtain test inputs by solving the constraints along the paths). We have obtained good results on the cat GNU Coreutils utility, especially in terms of ease of understanding the logic of the software through the GraphWalker diagram and its visual execution, as well as the agility in obtaining the restrictions to be solved to achieve path coverage.