Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

ModelJUnit is a Java library that extends JUnit to support model-based testing.

In this example, we will consider how to model and test the example from the ModelJUnit website. The system under test is illustrated by the following state diagram:

The FSM class models this system. Our script makes use of the RandomTester class to generate some tests for this model. The total code looks like this:

When we run this script, we will see the randomly generated test transitions. The output will be:

  • No labels