OOF: Finite Element Analysis of Microstructures
gtklogger is a Python module for recording (capturing) and replaying a session of a program with a graphical user interface written with PyGTK. It was developed as part of OOF2, a program for computing the properties of materials with complicated microstructures, but it can be used with any PyGTK program. gtklogger is somewhat similar in spirit to PyUseCase, but the implementation is very different.
gtklogger enables a test suite to be written for the user interface of a PyGTK program. A PyGTK program that imports gtklogger and has been suitably modified can record a user session in a log file. Tests can be added to the log file, and the file can be replayed by the program. If the file plays to completion and passes the tests, the program is working correctly (or, at least, not known to fail).
The modifications to a program that are required by gtklogger are not onerous, and do not interfere with normal operation of the program. They are thoroughly explained in the documentation and illustrated in the example.
|Download and Install||
Please note the following Disclaimer and Copyright notice:
This software was produced by NIST, an agency of the U.S. government, and by statute is not subject to copyright in the United States. Recipients of this software assume all responsibilities associated with its operation, modification and maintenance. However, to facilitate maintenance we ask that before distributing modified versions of this software, you first contact the authors at firstname.lastname@example.org.
|Documentation||The documentation for gtklogger is available as a pdf file (166 KB). There is also extensive documentation in the source code and in the accompanying README file.|
A simple PyGTK program called gtkloggerdemo.py demonstrates how to use gtklogger. The program files contain a multitude of comments describing how the original program was modified. It can be downloaded as a gzipped tar file here (6 KB). Unpack it with
% tar -xzf gtkloggerdemo.tar.gzTo run the program without logging, simply run
% cd gtkloggerdemo % python gtkloggerdemo.pyTo record a session into a file called logfile, instead type
% python gtkloggerdemo.py --record=logfileTo replay a recorded session from logfile, type
% python gtkloggerdemo.py --replay=logfileTo re-record a session from logfile, type
% python gtkloggerdemo.py --rerecord=logfile