Practical Model-Based Testing
This book gives a practical introduction to model-based testing, showing how to write models for testing purposes and how to use model-based testing tools to generate test suites. It is aimed at testers and software developers who wish to use model-based testing, rather than at tool-developers or academics.
The book focuses on the mainstream practice of functional black-box testing and covers different styles of models, especially transition-based models (UML state machines) and pre/post models (UML/OCL specifications and B notation). The steps of applying model-based testing are demonstrated on examples and case studies from a variety of software domains, including embedded software and information systems.
Review By: Harmon Avera, Jr.
01/18/2008Deciding on what to test, how to test it, what constitutes pass or fail, and then building the test infrastructure, can take as much time and effort as actually constructing the software itself. But what if you could build a model of your software, and then use a set of tools against that model to automatically generate test cases, executable test suites, and the needed pass/fail criteria? That’s how this book begins, by asking this intriguing "what if" question. Using a "black-box" testing approach, "Practical Model-Based Testing" tries to give an introduction to model-based testing and to demonstrate that the modeling and test-generation tools for the "what-if" scenario actually exist and have been used.
The eleven chapters of this book are organized around five major areas. First is introductory material: what is model-based testing, where does it fit in the spectrum of testing processes, what are its benefits, costs, and limitations? Second area focuses on methods and notations used to model software systems and criteria for selecting the tests. Third area highlights ways of creating tests from different model types (such as finite state, pre/post, and UML transition), and making the tests executable. Fourth area details case studies using different modeling techniques. The final area presents ideas on putting the theory into practice, both in Agile and Unified Process environments, and what the future trends might be. The appendices give summaries of two notational systems used in the book and some commercially available tools.
This book is information-dense and not a "light" read, but the style is logical, understandable, and obviously draws from the authors' personal experience and learnings. It is aimed at experienced test engineers, although some chapters would be useful to managers and developers as well.
Although described as an introduction to model-based testing, it is not a book that you can just skim. It took fairly serious study and analysis to follow the ideas and examples presented. Still, the book grabbed my interest right away and maintained that interest even through the technical middle chapters. The biggest challenge for me was learning enough of the B Abstract Machine Notation to follow the authors' models and examples – I was constantly referring back to B-Notation summary.
Subtitled "A Tools Approach," the book provides examples of both the model and a complementary test-generation tool. Both authors are involved with LEIRIOS Technologies and several of their examples use the LEIRIOS Test Generator tools, for both B-Notation and UML-based models. However, other examples use tools such as Microsoft Spec Explorer, Conformiq Qtronic, and the open source ModelJUnit framework.
I thought the authors did an excellent job of laying out the benefits and costs of model-based testing, the limitations of this testing methodology, and the infrastructure prerequisites, such as process maturity, people, and training. They point out that work isn't so much eliminated as it's shifted. Instead of manually creating, executing, and analyzing test cases from loose specifications, model-based testing requires the creation of a precise model from a selection of requirements, use of tools to create abstract test cases from the model, and the development of adapter code to make the abstract test cases into executable tests. However, the gain comes from being able to re-generate and re-run tests automatically, if the model changes. I highly recommend this readable introductory reference to model-based testing.
The authors use interesting and varied examples of both building the model and using a complementary test-generation tool to create executable tests. They lay out the benefits, costs and techniques of model-based testing in a format and style that will be of interest to experienced test engineers, developers, and managers.