Skip to content

Python3pkg/PyModel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyModel: Model-based testing in Python

PyModel is a model-based testing framework in Python.

In model-based testing, you code a model that can generate as many test cases as desired and also acts as the oracle that checks the test outcomes. Model-based testing is helpful where so many test cases are needed that it is not feasible to code them all by hand.

The samples included with PyModel include models and test scripts for network sockets, communication protocols, embedded controllers, data structures, and a web application.

PyModel includes an analyzer for validating models, visualizing their behavior, and checking their safety properties.

PyModel can generate offline tests which are similar to unit tests, but the typical way to use PyModel is on-the-fly testing, where the test runner uses the model to compute the test run as it executes. On-the-fly testing can cope with nondeterminism and asynchrony in the system under test.

PyModel can combine models using composition, guide tests through programmed scenarios, and focus test coverage according to programmed strategies.

PyModel provides three main programs:

  • pma, PyModel analyzer: generates a finite state machine (FSM) and computes properties by exploring a model program, FSM, test suite, or a product of these. Optionally checks safety properties.

  • pmg, PyModel graphics: generates a file of graphic commands from an FSM, that can be processed by the Graphviz dot command to produce graphics files in various formats including svg, pdf, and ps.

  • pmt, PyModel tester: displays traces, generates tests offline, executes offline tests, or generates and executes tests on-the-fly.

There is also a fourth program:

  • pmv, PyModel viewer: invokes pma, pmg, and the Graphiz dot command (to display the graphics generated by pmg). The pmv program provides brevity and convenience, so analysis and display can be accomplished by a single command.

For more information, read the notes, peruse the talks, browse the code, or try the samples.

PyModel is also available at PyPI.

PyModel requires Python 2.6 (because it uses itertools.product)

PyModel is influenced by NModel, but is not a translation or re-implementation.

PyModel is covered by the [BSD License](http://www.opensource.org/licenses/BSD-3-Clause)

Code and documents are copyright (C) 2009-20013, Jonathan Jacky.

Revised Apr 2013

Packages

No packages published

Languages

  • Python 72.7%
  • HTML 25.6%
  • Batchfile 1.6%
  • Shell 0.1%