Skip to content

Commit 4614f02

Browse files
committed
revise installation directions in INSTALL.txt
also revise release notes, samples.txt add README.rst for PyPI and revise setup.py to use it add links to slides and papers in README.md add 'PyModel Tester' to TesterOptions.py
1 parent c77d467 commit 4614f02

File tree

7 files changed

+135
-34
lines changed

7 files changed

+135
-34
lines changed

INSTALL.txt

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@ or
1414

1515
http://staff.washington.edu/jon/pymodel/www/
1616

17-
Then unpack using a tar or zip utility. Then you can run PyModel
18-
using the commands and modules in the unpacked distribution directory.
19-
Just put PyModel/bin on your execution PATH and PyModel/pymodel on
20-
your PYTHONPATH. You can achieve this by executing the script
21-
PyModel/bin/pymodel_paths (or pymodel_paths.bat on Windows). That
22-
script assumes the distribution directory is in your HOME directory
23-
and is named PyModel (not PyModel-1.0, so you many need to rename it).
17+
Then unpack it using a tar or zip utility.
18+
19+
Alternatively, if you have pip installed you can download
20+
PyModel-1.0.tar.gz from PyPI into the current directory, and then
21+
unpack it, with a single command:
22+
23+
pip install --no-install --build . PyModel
24+
25+
Then you can run PyModel using the commands and modules in the
26+
unpacked distribution directory. Just put PyModel/bin on your
27+
execution PATH and PyModel/pymodel on your PYTHONPATH. You can
28+
achieve this by executing the script PyModel/bin/pymodel_paths (or
29+
pymodel_paths.bat on Windows). That script assumes the distribution
30+
directory is in your HOME directory and is named PyModel (not
31+
PyModel-1.0, so you many need to rename it).
2432

2533
Confirm that PyModel works for you by running some of the test scripts
2634
in the samples directories. For example, in
@@ -32,15 +40,28 @@ The setup.py script included in the distribution now supports the
3240
install argument, so you can optionally install the PyModel python
3341
modules and commands in system directories (for example in
3442
/Library/Python/2.7/site-packages and /usr/local/bin, respectively).
35-
In the PyModel directory, type the command: sudo python setup.py
36-
install. Then you should not need to execute pymodel_path, but
37-
You still need to type the command: source tpath (in Windows, just tpath)
43+
In the PyModel directory, type the command:
44+
45+
sudo python setup.py install
46+
47+
Alternatively, if you have pip installed you can type the command:
48+
49+
sudo pip install --no-download --build . PyModel
50+
51+
The pip utility maintains a registry of the packages it has installed,
52+
which makes it easy to review and uninstall packages.
53+
54+
After installing you should not need to execute pymodel_path, but You
55+
still need to type the command: source tpath (in Windows, just tpath)
3856
in every session (terminal window).
3957

40-
Most of the distribution is in the examples under PyModel/samples, and
41-
in the documentation under PyModel/notes, www, and talks, and in the
42-
README files in most directories. Installation does not install these
43-
into any system directories; find them under the unpacked PyModel
44-
distribution directory.
58+
Most of the distribution contents is in the examples under
59+
PyModel/samples, and in the documentation under PyModel/notes, www,
60+
and talks, and in the README files in most directories. Installation
61+
does not install these into any system directories; find them under
62+
the unpacked PyModel distribution directory. This is why we
63+
recommend the pip --noinstall and --build switches. The pip install
64+
command without these switches will not leave the unpacked
65+
distribution files available on your system.
4566

4667
Revised May 2013

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ For more information, read the [notes](notes), browse the
5858
or try the [samples](samples). There are README files in most of the
5959
directories.
6060

61+
Here are the [slides](talks/pymodel-nwpd10.pdf) for
62+
talks on PyModel given at [NWPD10](http://www.seapig.org/NWPD10)
63+
and [SciPy 2011](http://conference.scipy.org/scipy2011/schedule.php).
64+
Here is the [paper](talks/pymodel-scipy2011.pdf) from the
65+
SciPy 2011 Proceedings.
66+
6167
You can [INSTALL](INSTALL.txt) PyModel.
6268

6369
PyModel is also available at

README.rst

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
2+
PyModel: Model-based testing in Python
3+
======================================
4+
5+
**PyModel** is an open-source model-based testing framework in Python.
6+
7+
In model-based testing, you code a *model* that can generate as many
8+
test cases as needed. The model also checks the test outcomes.
9+
Model-based testing is helpful where so many test cases are needed
10+
that it is not feasible to code them all by hand.
11+
12+
In the samples included with PyModel, there are models and test
13+
scripts for network sockets, a communication protocol, embedded
14+
controllers, some data structures, a multithreaded application, and a
15+
web application.
16+
17+
PyModel includes an analyzer for validating models, visualizing their
18+
behavior, and checking their safety properties.
19+
20+
PyModel can generate *offline tests* which are similar to unit tests,
21+
but the typical way to use PyModel is *on-the-fly testing*, where the
22+
test runner uses the model to compute the test run as it executes, so
23+
test runs can be as long as needed. On-the-fly testing can cope with
24+
nondeterminism and asynchrony in the system under test.
25+
26+
PyModel can combine models using *composition*, guide tests through
27+
programmed *scenarios*, and focus test coverage according to
28+
programmed *strategies*.
29+
30+
PyModel provides three main programs:
31+
32+
- **pma**, PyModel analyzer: generates a finite state machine (FSM)
33+
and computes properties by exploring a model program, FSM, test suite,
34+
or a product of these.
35+
36+
- **pmg**, PyModel graphics: generates a file of graphic commands from an FSM,
37+
that can be processed by the Graphviz *dot* command to produce graphics
38+
files in various formats including *svg*, *pdf*, and *ps*.
39+
40+
- **pmt**, PyModel tester: displays traces, generates tests offline,
41+
executes offline tests, or generates and executes tests on-the-fly.
42+
43+
There is also a fourth program:
44+
45+
- **pmv**, PyModel viewer: invokes *pma*, *pmg*, and the Graphiz *dot*
46+
command (to display the graphics generated by *pmg*). The *pmv*
47+
program provides brevity and convenience, so analysis and display
48+
can be accomplished by a single command.
49+
50+
Use *pma* and *pmg* (or *pmv*) to visualize and preview the behavior of *pmt*.
51+
Every path through the graph created by *pma* (and drawn by *pmg*) is a
52+
trace (test run) that may be generated by *pmt*, when *pma* and *pmt* are
53+
invoked with the same arguments. The *pma* program is also useful on
54+
its own for visualization and safety analysis.
55+
56+
PyModel work in progress is available at GitHub:
57+
https://github.com/jon-jacky/PyModel
58+
59+
The PyModel distribution is also available at the
60+
author's web page: http://staff.washington.edu/jon/pymodel/www/
61+
62+
PyModel requires Python 2.6 or higher (because it uses *itertools.product*)
63+
64+
PyModel is influenced by NModel, but is not a translation or
65+
re-implementation.
66+
67+
PyModel is covered by the BSD License.
68+
69+
Code and documents are copyright (C) 2009-2013, Jonathan Jacky.
70+
71+
72+
Revised May 2013

notes/release-1.0.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ Version 1.0 adds new functionality:
5050

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

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

notes/samples.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ To execute test.py (etc.), type the command
1414

1515
trun test
1616

17-
For this to work, the PyModel/pymodel directory must be on your Python
18-
path, the current directory must be on your Python path, and the
19-
PyModel/bin directory must be on your execution path. To achieve all
20-
this, you can run the PyModel/pymodel/pymodel_paths command.
21-
Alternatively, if you have installed PyModel, these preliminaries may
22-
not be necessary. Just type: trun test
17+
(but not python test.py) For this to work, the PyModel/pymodel
18+
directory must be on your Python path, the current directory must be
19+
on your Python path, and the PyModel/bin directory must be on your
20+
execution path. To achieve all this, you can run the
21+
PyModel/pymodel/pymodel_paths command. Alternatively, if you have
22+
installed PyModel, these preliminaries may not be necessary.
23+
For more details see PyModel/INSTALL.txt
2324

2425
Each test script contains commented command lines that demonstrate
2526
combinations of arguments and options. Running each test script

pymodel/TesterOptions.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
usage = """pmt [options] models
88
9-
models is a list of one or more module names (with no .py suffix).
10-
Each module named in models must contain a model, that is: a model
11-
program, an FSM, or a test suite. In addition, a module named in
12-
models can contain additional configuration information for a model
13-
program. Multiple models (model programs including configuration,
14-
FSMs, and test suites) are composed into a product. The tester
15-
generates traces by executing the product, at random or guided by the
16-
strategy option. To just view the traces, omit the implementation
17-
option. To use pmt as an offline test generator, omit the
18-
implementation option and use the output option to save the traces in
19-
a test suite module. To execute tests, provide the implementation
9+
PyModel Tester. models is a list of one or more module names (with no
10+
.py suffix). Each module named in models must contain a model, that
11+
is: a model program, an FSM, or a test suite. In addition, a module
12+
named in models can contain additional configuration information for a
13+
model program. Multiple models (model programs including
14+
configuration, FSMs, and test suites) are composed into a product.
15+
The tester generates traces by executing the product, at random or
16+
guided by the strategy option. To just view the traces, omit the
17+
implementation option. To use pmt as an offline test generator, omit
18+
the implementation option and use the output option to save the traces
19+
in a test suite module. To execute tests, provide the implementation
2020
option. To execute tests generated offline, provide that test suite
2121
module as the single command argument. To generate and execute tests
2222
on-the-fly, provide one or more model programs and/or scenario FSMs as

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
maintainer_email = 'jon.p.jacky@gmail.com',
4747
url = 'https://github.com/jon-jacky/PyModel',
4848
description = 'Model-based testing in Python',
49-
long_description = open('README.md').read(),
49+
long_description = open('README.rst').read(),
5050
download_url = 'https://pypi.python.org/pypi/PyModel',
5151
license = 'BSD License',
5252

0 commit comments

Comments
 (0)