NModel is a model-based testing and analysis framework for model programs written in C#. It is explained and used in the book Model-based Software Testing and Analysis with C#.

A model program acts as an executable specification for another program or system, called the implementation. Usually the model program is much smaller and simpler than the implementation. The model program can be analyzed to check for design errors in the implementation, can generate test cases for the implementation, and can serve as the oracle that provides the correct results when testing the implementation. The implementation does not have to be written in C# and does not have to use .NET.

In constrast with conventional unit testing, where a test engineer must code each test case, model-based testing is recommended where so many test cases are needed that it would be infeasible to code them all by hand. It is especially indicated for testing behaviors with data- and history-dependence and nondeterminism, where many different variations (data values, interleavings etc.) should be tested for each scenario (or use case). Model-based testing has been applied to communication protocols, web applications, embedded control systems, and graphical user interfaces.

The NModel release includes: The library also exposes the functionality of mpv, otg, ct and more, so you may write your own tools which are more closely adapted to your environment, or which provide other capabilities.

To use NModel, you must write your own model program in C# that models your implementation. Then you can use the mpv tool to visualize and analyze the behavior of your model program, in order to confirm that it behaves as you intend, and to check for design errors. To execute tests using the test runner ct, you must write a test harness in C# that couples your implementation to the tool. You can use the test generator otg to create tests from your model program in advance, or let ct generate the test on-the-fly from your model program as the test run executes. If you wish, you can write a custom strategy in C# that ct uses to maximize coverage according to criteria you define. To express scenarios, you can dispense with C# and write simple finite state machines (FSMs), then use composition to achieve scenario control during testing or to check temporal properties during analysis. You can build up model programs from separate features or use composition to combine model programs in a well-structured way.

A good way to get started is to install NModel, download the reference manual and samples from Releases, and try some of the examples.

NModel requires .NET, but does not require Visual Studio.

NModel pages at Codeplex: Also: NModel pages elsewhere:
Last edited Jun 12 at 4:03 PM by jon, version 9

 

Want to leave feedback?
Please use Discussions or Reviews instead.

Archived page comments (1)

Updating...
© 2006-2009 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Version 2009.6.1.15196