Welcome to MSDN Blogs Sign in | Join | Help

Data Tools and Software Testing

Old model-based testers never die; they just transition to a higher state.

Syndication

News

    These postings are provided "AS IS" with no warranties, and confer no rights.
    Use of included script and code samples are subject to the terms specified here.

Model Based Testing – An Introduction

In this article I will attempt to give a brief overview of Model Based Testing (MBT) and provide links to help you dig in for more details. I have been increasingly getting more and more fascinated (obsessed?) with this paradigm, which I believe holds great promise for the future of the software testing discipline. Hope to rub some of that passion for MBT on to you.

 

MBT is an approach in which you define the behavior of a system in terms of actions that change the state of the system. Such a model of the system results in a well-defined Finite State Machine (FSM) which helps us to understand and predict the system’s behavior. For e.g. when working with a model of a car, the action of “press accelerator” has a different result depending on whether the state of the car is “neutral” or “drive”.

 

The biggest MBT take-away from a testing perspective is that any test case that you define is really just a traversal of the model that you have of the system – either an explicitly defined one or the one in your head. Generating test cases thus boils down to traversing this state machine. MBT is therefore especially useful for automatic generation of test sequences from the defined model. Various graph theory algorithms can be employed to walk this graph (e.g. shortest path, N-states, all-states, all-transitions etc.). The best part is that when you are using a good MBT tool, you do not need to know or dig into all this graph theory all the time. Simply define the states, actions, transitions etc. for your model and click a button to start generating tons of interesting test cases.

 

Model based testing offers a lot of benefits, some of which I list here. I shall expound on some of these in later posts.

1.      Forces detailed understanding of the system behavior

2.      Early bug detection (which is much cheaper)

3.      Test suite grows with the product

4.      Manage the model instead of the cases (useful when features changing constantly).

5.      Can generate endless tests (since test cases are machine generated)

6.      Resistant to pesticide paradox

7.      Find crashing and non-crashing bugs

8.      Automation is cheaper and more effective

9.      One implementation per model, then all cases free (test code is better enabled for changes).

10.  Gain automated exploratory testing

11.  Testers can address bigger test issues

 

Any other benefits that you think it brings to the table? I would love to hear from anyone actually using model based testing outside of Microsoft, and what their experience has been using MBT.

 

If I had to recommend just one and only one short introduction to Model Based Testing in order to sell the idea and get you hooked to it, I would point to this paper, Intelligent Test Automation, by Harry Robinson, which appeared a few years ago in the STQE magazine (which I believe has morphed into the Better Software magazine). Interestingly on this page, Harry has put up the 2-file state model of the example in the paper and also a Chinese Postman traversal for the model.

 

Here is an extensive list of technical papers related to model based testing that can help you dig into the details and the theory behind this super powerful testing paradigm.

 

One great publicly available tool you can use for Model Based Testing is Abstract State Machine Language(ASML) produced by the Foundations of Software Engineering(FSE) group Microsoft Research(MSR). You can actually have executable specifications with ASML, so when your Program Manager generates the functional specs, you can simply execute that spec and generate test cases directly from the spec. Buckle up - The future is here (almost)!

Published Sunday, May 30, 2004 1:28 PM by nihitk

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Model Based Testing - The future is here! @ Sunday, May 30, 2004 4:47 PM

Nihit Kaul's WebLog

# re: Model Based Testing – An Introduction @ Sunday, May 30, 2004 4:44 PM

Outstanding. I am also in love with these ideas, and even have a few to contribute. You are one of my newest favorite people. Subscribed! -JB.

James D. Beine

# For Testers: Nihit Kaul Talks Up Model Based Testing @ Tuesday, June 01, 2004 1:01 PM

scooblog by josh ledgard

# Pesticide Paradox @ Friday, July 16, 2004 9:51 PM

Nihit Kaul's WebLog

# Pesticide Paradox @ Friday, July 16, 2004 10:03 PM

Nihit Kaul's WebLog

# re: Model Based Testing – An Introduction @ Monday, July 26, 2004 1:20 AM

Moreover, with .Net reflection, you can easily explore an application and build the model "on the heap"...

Jonathan de Halleux

# ZDrop for eBay Sellers @ Tuesday, October 05, 2004 6:46 PM

Nihit Kaul's WebLog

# re: Model Based Testing – An Introduction @ Monday, August 01, 2005 3:01 AM

I am in love with this concept since 2001.

Would like to share thoughts with this interest group.

Lakshmi Kumar

# re: Model Based Testing – An Introduction @ Tuesday, February 07, 2006 4:35 AM

Its great! my research area is MBT.It is quite interesting

shilpa

# re: Model Based Testing – An Introduction @ Tuesday, February 07, 2006 4:38 AM

My research topic model based testing and I will delighted to get more information about it

shilpa

# Advanced Test Harness Features @ Sunday, May 07, 2006 1:52 AM


In a past post I talked about the basic functionality of a test harness.  That is, it should be...

Steve Rowe's Blog

# re: Model Based Testing – An Introduction @ Tuesday, June 13, 2006 6:35 AM

Nihit,

Good article for giving a insight into the exciting area of MBT

Anil B Biradar

# Model Based Testing – The Yellow Brick Road @ Friday, July 28, 2006 9:11 PM

The future was here – now it’s the past. I am, however, wiser about the ways-of-the-model-based world....

Nihit Kaul's WebLog

# Pesticide Paradox @ Friday, August 11, 2006 8:15 PM

In this article I will be attempting to explain one of the biggest (or what I feel is the biggest) drawback...

Nihit Kaul's WebLog

# Model for Getting Drunk @ Wednesday, January 03, 2007 12:59 PM

You know your team members are really catching onto this whole model-based way of thinking when they

Nihit Kaul's World of Testing

# Model for Getting Drunk @ Friday, January 19, 2007 10:47 PM

You know your team members are really catching onto this whole model-based way of thinking when they

Nihit Kaul's World of Testing

# Elements of MBT - Part 1 - What is a model? @ Friday, March 23, 2007 9:02 PM

In this series of "Elements of MBT" posts, I will be covering some basic concepts used when trying to

Nihit Kaul's World of Testing

# re: Model Based Testing – An Introduction @ Tuesday, May 22, 2007 9:50 AM

pleae reade the book Practical Model based testing from prof Bruno Legeard and

Mark utting

isbn-10:0-12-372501-1

josef Narings@leirios.com

# re: Model Based Testing – An Introduction @ Tuesday, May 22, 2007 11:45 AM

Hi Josef,

I am going through this currently - very interesting.

Thanks,

Nihit

nihitk

# re: Model Based Testing – An Introduction @ Monday, September 10, 2007 8:29 PM

HEY I WOULD LIKE TO HEAR MORE ABOUT IT, I WAS JUST LOOKING FUTURE IN  MODEL BASED TESTING.

SANAFAR

# re: Model Based Testing – An Introduction @ Sunday, December 02, 2007 12:36 PM

just outstanding. helped me alot writing my assignment about model-based testing. nice work buddy

Yasir Shah

# re: Model Based Testing – An Introduction @ Thursday, April 24, 2008 5:33 AM

Hi,

For information, All4Tec MaTeLo is a tool for MBT.

MaTeLo, new tool for validation using the statistical test usage.

MaTeLo test your software under the real conditions, just like will do it your customer.

Thanks,

Anthony RIBOT

# re: Model Based Testing – An Introduction @ Thursday, May 22, 2008 2:59 PM

I also agree that this is the future of testing, and even i can say that modeling and MDE is the future. the main problem with these approaches is that the tools and languages for modeling are still insufficient in complex examples. the modeling part is the only negative part of this, and by negative i mean hard to achieve. other than that this model based approaches in SE seem only natural.

Omar Guy

# Data Tools and Software Testing : Model Based Testing – An Introduction @ Sunday, June 08, 2008 3:34 AM

In this article I will attempt to give a brief overview of Model Based Testing (MBT) and provide links to help you dig in for more details. I have been increasingly getting more and more fascinated (obsessed?) with this paradigm, which I believe hold

Relationship Compatibility

# re: Model Based Testing – An Introduction @ Friday, March 27, 2009 8:58 PM

I have to agree with one of the comments: The future is here!

TestOptimal offers 4 test case generators, supports both java and xml scripting, cross browsers, app modeling, load / stress testing, debug, statistical analysis, lots of other features.  Check it out at http://TestOptimal.com/.

TestOptimal

# re: Model Based Testing – An Introduction @ Tuesday, December 01, 2009 7:02 PM

You might want to take a look at Spec Explorer, a Model-Based Testing tool from Microsoft, which you can download free of charge: http://msdn.microsoft.com/en-us/devlabs/ee692301.aspx. There are some general MBT articles in the Spec Explorer Team Blog too: http://blogs.msdn.com/specexplorer/.

Nico Kicillof

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
Page view tracker