Introduction to Model-Based Testing

Model-based testing (MBT)is defined as the automated generation of software testing procedures based models of system requirements and behavior. In this article, Sergio Mera and Yiming Cao provides an introduction to model-based testing and explains how to implement it with Spec Explorer, an free tool that extends Visual Studio.

The article starts with a general overview of the main concepts behind model-based testing. The formal models are usually created manually from information specifications or requirements. This creation of formal models from the requirements already provides some feedback about the initial specifications, because this process requires modelers to ask questions about the quality of the requirements. The article discusses then the various benefits of MBT.

Model-Based Testing
Figure source: https://msdn.microsoft.com/

A chat system is used as an example and the article provides the formal model of this system using C#. The System state is modeled with class fields and state transitions are modeled with rule methods.

The conclusion of the authors is that “Model-based testing is a powerful technique that adds a systematic methodology to traditional techniques. Spec Explorer is a mature tool that leverages the MBT concepts in a highly integrated, state-of-the-art development environment as a free Visual Studio Power Tool.”

Read the complete article on https://msdn.microsoft.com/en-us/magazine/dn532205.aspx