Skip to main content

Model-based testing in Python

Project description

PyModel is an open-source model-based testing framework in Python.

In unit testing, the programmer codes the test cases, and also codes assertions that check whether each test case passed. In model-based testing, the programmer codes a “model” that generates as many test cases as desired and also acts as the oracle that checks the cases.

Model-based testing is recommended where so many test cases are needed that it is not feasible to code them all by hand. This need arises when testing behaviors that exhibit history-dependence and nondeterminism, so that many variations (data values, interleavings, etc.) should be tested for each scenario (or use case). Examples include communication protocols, web applications, control systems, and user interfaces.

PyModel supports on-the-fly testing, which can generate indefinitely long nonrepeating tests as the test run executes. PyModel can focus test cases on scenarios of interest by composition, a versatile technique that combines models by synchronizing shared actions and interleaving unshared actions. PyModel can guide test coverage according to programmable strategies coded by the programmer.

PyModel provides three programs:

pma.py:

pymodel analyzer, generates a finite state machine (FSM) and computes properties by exploring a model program, FSM, test suite, or a product of these.

pmg.py:

pymodel graphics, generates a file of graphic commands from an FSM.

pmt.py:

pymodel tester, displays traces, generates tests offline, executes offline tests, or generates and executes tests on-the-fly.

Use pma and pmg to visualize and preview the behavior of pmt. Every path through the graph created by pma (and drawn by pmg) is a trace (test run) that may be generated by pmt, when pma and pmt are invoked with the same arguments.

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

PyModel-0.9.zip (364.6 kB view details)

Uploaded Source

PyModel-0.9.tar.gz (306.3 kB view details)

Uploaded Source

File details

Details for the file PyModel-0.9.zip.

File metadata

  • Download URL: PyModel-0.9.zip
  • Upload date:
  • Size: 364.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyModel-0.9.zip
Algorithm Hash digest
SHA256 439ace0d86885cd2e9fed26647cfc09e64ea3d08113c58c21fc8d0b156b4b695
MD5 9519fc40aa285e010f56ec421075ae52
BLAKE2b-256 d26fbe5077201d82b935748129ac62396ac5c8558227de2133155731b826c534

See more details on using hashes here.

File details

Details for the file PyModel-0.9.tar.gz.

File metadata

  • Download URL: PyModel-0.9.tar.gz
  • Upload date:
  • Size: 306.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyModel-0.9.tar.gz
Algorithm Hash digest
SHA256 a9297e6d9de1aefd0dd4e22cf2b886d091c51c465f588db58491c4f9c14188e5
MD5 168467569ac81d785f4b1a06cf96f973
BLAKE2b-256 76fb6dcb1d409d5c375df1fd81e0ded35aa074bd0e2a932377d145de92620600

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page