You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<b>PyModel</b> is an open-source model-based testing framework in Python.
18
15
19
16
<p>
20
-
In unit testing, the programmer codes the test cases, and also codes
21
-
assertions that check whether each test case passed. In model-based
22
-
testing, the programmer codes a "model" that generates as many test
23
-
cases as desired and also acts as the oracle that checks the cases.
17
+
In model-based testing, you code a <em>model</em> that can generate as
18
+
many test cases as needed. The model also checks the test outcomes.
19
+
Model-based testing is helpful where so many test cases are needed
20
+
that it is not feasible to code them all by hand.
21
+
22
+
<p>
23
+
In the samples included with PyModel, there are models and test
24
+
scripts for network sockets, a communication protocol, embedded
25
+
controllers, some data structures, a multithreaded application, and a web
26
+
application.
24
27
25
28
<p>
26
-
Model-based testing is recommended where so many test cases are needed
27
-
that it is not feasible to code them all by hand. This need arises
28
-
when testing behaviors that exhibit history-dependence and
29
-
nondeterminism, so that many variations (data values, interleavings,
30
-
etc.) should be tested for each scenario (or use case). Examples
31
-
include communication protocols, web applications, control systems,
32
-
and user interfaces.
29
+
PyModel includes an analyzer for validating models, visualizing their
30
+
behavior, and checking their safety properties.
33
31
34
32
<p>
35
-
PyModel supports on-the-fly testing, which can generate indefinitely
36
-
long nonrepeating tests as the test run executes. PyModel can focus
37
-
test cases on scenarios of interest by composition, a versatile
38
-
technique that combines models by synchronizing shared actions and
39
-
interleaving unshared actions. PyModel can guide test coverage
40
-
according to programmable strategies coded by the programmer.
33
+
PyModel can generate <em>offline tests</em> which are similar to unit
34
+
tests, but the typical way to use PyModel is <em>on-the-fly
35
+
testing</em>, where the test runner uses the model to compute the test
36
+
run as it executes, so test runs can be as long as needed. On-the-fly
37
+
testing can cope with nondeterminism and asynchrony in the system
38
+
under test.
39
+
40
+
<p>
41
+
PyModel can combine models using <em>composition</em>, guide tests through
42
+
programmed <em>scenarios</em>, and focus test coverage according to
43
+
programmed <em>strategies</em>.
44
+
41
45
42
46
<p>
43
-
PyModel provides three programs:
47
+
PyModel provides three main programs:
44
48
45
49
<ul>
46
-
<li><ahref="pma.html">pma.py</a> PyModel analyzer: generates a finite state machine (FSM) and computes properties by exploring a model program, FSM, test suite, or a product of these.
47
-
<li><ahref="pmg.html">pmg.py</a> PyModel graphics: generates a file of graphic commands from an FSM.
48
-
<li><ahref="pmt.html">pmt.py</a> PyModel tester: displays traces, generates tests offline, executes offline tests, or generates and executes tests on-the-fly.
50
+
<li><ahref="pma.html">pma</a> PyModel analyzer: generates a finite state machine (FSM) and computes properties by exploring a model program, FSM, test suite, or a product of these.
51
+
<li><ahref="pmg.html">pmg</a> PyModel graphics: generates a file of graphic commands from an FSM.
52
+
<li><ahref="pmt.html">pmt</a> PyModel tester: displays traces, generates tests offline, executes offline tests, or generates and executes tests on-the-fly.
49
53
</ul>
50
54
51
55
<p>
52
-
There is also a fourth program, <ahref="pmv.html">pmv.py</a>, the
53
-
PyModel viewer, that invokes pma, pmg, and
56
+
There is also a fourth program:
57
+
58
+
<ul>
59
+
<li><ahref="pmv.html">pmv</a>, PyModel viewer: invokes pma, pmg, and
54
60
the <ahref="http://www.graphviz.org/">Graphiz dot</a> command (to
55
61
display the graphics generated by pmg). The pmv program provides
56
62
brevity and convenience, so analysis and display can be accomplished
57
63
by a single command.
64
+
</ul>
58
65
</p>
59
66
60
67
<p>
61
68
Use pma and pmg (or pmv) to visualize and preview the behavior of pmt.
62
69
Every path through the graph created by pma (and drawn by pmg) is a
63
70
trace (test run) that may be generated by pmt, when pma and pmt are
64
-
invoked with the same arguments.
71
+
invoked with the same arguments. The pma program is also useful on
72
+
its own for visualization and safety analysis.
65
73
66
74
<p>
67
-
For more information, peruse the <ahref="../talks">talks</a>,
75
+
For more information,
68
76
read the <ahref="concepts.html">overview</a> and
69
-
the more detailed <ahref="../notes">notes</a>, browse
77
+
the more detailed <ahref="notes.html">notes</a>, browse
70
78
the <ahref="../pymodel">code</a>,
79
+
peruse the <ahref="../talks">talks</a>,
71
80
view the <ahref="../samples/Stack/svg">graphs</a>
72
81
(<ahref="../samples/WebApplication/svg">etc.</a>)
73
-
or try the <ahref="../samples">samples</a>.
82
+
or try the <ahref="samples.html">samples</a>.
83
+
There are README files in most of the directories.
74
84
75
85
<p>
76
86
Here are the <ahref="../talks/pymodel-nwpd10.pdf">slides</a> for
@@ -89,7 +99,7 @@ <h2>PyModel: Model-based testing in Python</h2>
89
99
and <ahref="https://github.com/jon-jacky/PyModel">GitHub</a>.
90
100
91
101
<p>
92
-
PyModel requires Python 2.6 (because it uses <code>itertools.product</code>).
102
+
PyModel requires Python 2.6 or later (because it uses <code>itertools.product</code>).
93
103
94
104
<p>
95
105
PyModel is influenced by <a
@@ -100,11 +110,15 @@ <h2>PyModel: Model-based testing in Python</h2>
<ahref="index.html">PyModel</a> is an open-source model-based testing
19
+
framework in Python.
20
+
21
+
<hr>
22
+
23
+
<p>The <ahref="../notes">notes</a> directory contains some of the
24
+
PyModel documentation. See also the <em>README</em> files in each
25
+
directory, the slides and papers in
26
+
the <ahref="../talks"><em>talks</em></a> directory, and the web pages
27
+
in the <ahref="../www"><em>www</em></a> directory.</p>
28
+
29
+
<p>These are the files in the <em>notes</em> directory, in a recommended<br>
30
+
reading order:</p>
31
+
32
+
<ul>
33
+
<li><p><em>concepts.md</em>: concepts and vocabulary</p></li>
34
+
<li><p><em>commands.txt</em>: PyModel commands and how to use them. Also,<br><em>pma.txt</em>, <em>pmg.txt</em>, <em>pmt.txt</em>, and <em>pmv.txt</em> on each command.</p></li>
35
+
<li><p><em>samples.txt</em>: where to find the samples and how to run them. See also<br>
36
+
the <em>README</em> in the samples directory and in each sample subdirectory.</p></li>
37
+
<li><p><em>models.txt</em>: how to write and use model programs, FSMs, and test suites</p></li>
38
+
<li><p><em>composition.txt</em>: how and why to use composition to combine models</p></li>
39
+
<li><p><em>strategy.txt</em>: how to select or write an optional strategy to guide test runs</p></li>
40
+
<li><p><em>stepper.txt</em>: how to write the test harness needed to test an implementation</p></li>
41
+
<li><p><em>test.txt</em>: how to script and run tests on the PyModel software itself</p></li>
42
+
<li><p><em>advice.txt</em>: miscellaneous tips and advice</p></li>
43
+
<li><p><em>socket_experiments.txt</em>: steppers and other files in the socket sample that<br>
44
+
are not discussed in its <em>README</em></p></li>
45
+
<li><p><em>releases.txt</em>: release history </p></li>
0 commit comments