PyModel 1.0: model-based testing in Python

jon.p.jacky at gmail.com jon.p.jacky at gmail.com
Sat May 25 23:47:12 CEST 2013


PyModel v 1.0 is released.

PyModel is a model-based testing framework for Python.  In model-based
testing, you code a model that can generate as many test cases as
needed; the model also checks the test outcomes.  In the samples
included with PyModel, there are models and test scripts for network
sockets, a communication protocol, embedded controllers, some data
structures, a multithreaded application, and a web application.
PyModel also includes an analyzer for validating models, visualizing
their behavior, and checking their safety properties.

Earlier public releases were versions 0.80 in Jan 2010, 0.85 in Mar
2010, and 0.90 in July 2011.  Since July 2011 ongoing work has been
available at GitHub: https://github.com/jon-jacky/PyModel/ PyModel can
also be downloaded from PyPI http://pypi.python.org/pypi/PyModel or
the author's web page at http://staff.washington.edu/jon/pymodel/www/

This release is called version 1.0 because it includes all of the
features considered in the original project plan.  (Development and
maintenance will continue beyond this release.)

Version 1.0 adds new functionality:

- The PyModel Tester pmt supports observable actions and asynchronous
  steppers, to handle event-driven systems and nondeterminism.

- The PyModel Analyzer pma performs safety analysis by checking state
  invariants.  The PyModel Graphics program pmg indicates unsafe states
  in the generated graphs.

- The new PyModel Viewer command pmv combines the functionality of the
  PyModel Analyzer pma, the PyModel Graphics program pmg, and the
  Graphviz dot program in a single command, for convenience and
  brevity.

- The options to include or exclude actions, -a and -e, are now
  supported for FSMs and TestSuites as well as Model Programs, so you
  can use the command line to select which actions to include in your
  analyses or tests, even when you compose model programs with
  scenario machines.

- The tester pmt provides a timeout option to specify that the test
  fails if the implementation does not respond within a given
  deadline.  (This option might not work on Windows.)

- The PyModel programs pma, pmg, pmt, and pmv can be run from the
  command line without the .py extension, like any other command.
  You can just type pmt ... , you no longer have to type pmt.py ...

- The regression testing command tdiff replaces clogdiff.  It works
  the same - this is just a renaming.  The clogdiff command is
  retained in this version for backward compatibility, but is now
  deprecated.

- The new command tclean removes test output files from the
  current directory.

- The revised setup.py now supports the install argument, to
  optionally install the PyModel python modules and commands in system
  directories.  Now PyModel can be installed using distutils
  (... setup.py install ...) or pip.

Version 1.0 adds a new sample and revises all the others:

- The completely rewritten Socket sample includes new asynchronous
  steppers (test harnesses) that show how to support asynchrony and
  nondeterminism using the select function, or alternatively, using
  threads.  The Socket sample also includes new simulators that can
  optionally replace the the Python standard library socket and select
  modules, to demonstrate greater nondeterminism and transmission
  errors.

- The new safety sample demonstrates state invariants and safety analysis.

- There are new fsmpy/ and svg/ directories in each sample that
  contain FSM modules and SVG graphics files generated by the commands
  in the test scripts.

- Many sample test scripts (test*.py modules) have been revised and
  the corresponding reference output (*.ref files) has been
  regenerated.

Version 1.0 adds much new documentation and revises the rest:

- There are new README.md (Markdown format) files in PyModel in most
  top-level directories below PyModel.

- The new README.md in the samples directory briefly describes every
  sample.  The new README.md in each sample directory explains that
  sample in more detail, and describes every file in that sample.

- The documentation in the notes directory has been expanded and
  brought up to date.  There are new and revised .txt files. Some .txt
  files have been replaced by .md (Markdown format) files.

- The web pages in the www directory have been expanded and brought up
  to date.  The content in these pages is drawn from .md files
  and .txt files in other PyModel directories.

Version 1.0 reorganizes some code and directory structure:

- There is a new bin directory for commands and scripts, separated
  from the pymodel directory for Python modules.

- There is a new model.py module that contains the Model base class
  for the ModelProgram, FSM, TestSuite classes.

Version 1.0 makes some bug fixes:

- The programs no longer crash when a parameter generator is missing.
  Now they issue a helpful error message and exit.

- The pmt program cancels the timeout when a timeout was requested but
  did not expire.

- When models are composed, omitted arguments are handled correctly
  (usually, as "match any" indicators).

- The pmt -o offline test generator option works.






More information about the Python-announce-list mailing list