'fat' is the Framework for Automated Testing and was created to fill the need for automated reliable testing of software and firmware products on a regular basis.
The goal of this product is to have a fully built and defined set of tools that can be 'dropped' into a software project environment and immediately enhance the reliablity of said product by giving a defined and simplistic interface for that project's engineers to use in creating a full bodied test suite.
The framework consists of two framework files and as many module files as desired.
The framework files: The framework when executed directly (considered normal usage)
has its main routine called.
The Main routine will allow for several arguments:
| -h|-? | help, prints the usage/help menu |
| -i <script|gui|cli> | user's input interface to use (script is a non-interactive
implementation and is default) *** default is script*** |
| -o <file='filename'|stdout|echo='filename'> | output log type will define which type of log to write to
'file' will write information to the file
filename, 'screen' will send it to the
stdout, and 'echo' will write to
'filename' and echo to the screen *** default is screen *** |
| -t <target> | the name of the target as it will go to the TargetInterface
object, i.e. -t flex4, or -t hl *** -t is a required argument *** |
| -m <module> | the name of a specific module to run, overrides the frameworks normal directive to run all tests as returned by get_tests() function in testconfig.py |
| -D | debug, allows printing/logging of debug information for the test |
| -- args | will tell the TestWrapper to take the quoted arguments following the '--' and give them to both the TestModule being run as well as the TestInterface in testconfig.py |
Arguments following the -- argument are removed and put into a different list. This list is than provided to the TestWrapper which in turn supplies it to the Input Interface, and the Target Interface components for use if desired.
This list is useful for specifying certain arguments or flags unique to the particular test implementation without cluttering the framework with argument tests that only apply to a specific product.
The input interface is given to the TestWrapper as the 'input' argument of its __init__() method. It will normally be provided to the framework by the -i argument given to fat.py when executed directly.
All input interfaces are derived from the base class
UserInterface and have the methods __init__(), run()
, and fini().
From the UserInterface base class we have pre-defined several
sub-classes that will be most commonly used:
The input interface object is given to the TestWrapper as an argument, but once the TestWrapper has the other frame work components in place, the input interface will be given control of the program by the TestWrapper via the 'run()' method. At that time all data is handed to the input interface. At the completion of its run() method the input interface returns (without status code) control to the TestWrapper which calls everyone's fini() method and cleans up.
The Input Interface makes use of some of the output objects hidden
methods to allow for more data collection to occur:
The output interface is a collection of objects controlled through
the logging mechanism's Logger object.
The Logger receives all calls from the input interface and the user
created test modules and writes them to the actual output device,
i.e., stdout or to file.
The Logger also sends information to the Statistics collection object
where appropriate.
The componenets of the output/logging mechanism are obscured from
the user and are not meant to be directly accessed.
They are:
The LogTarget is a base class used in creating a defined interface
for objects that are to act as recipients of the Logger objects calls.
It is required to have the following methods:
The log target is created by the user and given as an argument
to the TestWrapper. In the case of normal usage, the -o argument given
to fat will specify one of three predefined output classes:
The Logger is the wrapper object and is given its log target as an
argument by the TestWrapper when it is initialized. It then creates
an instance of the StatCollect object to gather information about
the types of calls it has recieved. When any of its methods are
invoked the Logger will write to the log target and then forward
information to the StatCollect object when appropriate. The logger
sends all of its writing tasks to a single internal method add_entry()
which does all the writing to the Log Target (using write()). The Logger
has the following hidden methods available that are only used by
the Input Interface:
The StatCollect class stores a list of dictionarys relating to
a given module and tracks import outcome, errors, number of tests,
warnings, passes, fatalities, failures, and time (as tracked by its
Timer object). The data is stored in the following format:
{"Test-Module":,"Import":,
"RunTime":,"Errors":,"Passes":,"Failures":,
"FatalErrors":,"Warnings":,"TotalTests":,"Final":}
The entire list of dictionarys is retrieved by the Logger via the
dump() method and written to the log target.
The Timer class is used as a utillity by the StatCollect class to gather elapsed time for the module to run. It captures time when its start() and stop() methods are called and then returns the difference in a various formats as required.
The target interface is contained within the testconfig.py module. Its implementation is target specific making it impossible to fully describe. The
following items are required to be in testconfig.py:
The TestInterface class will need to provide a method for the
individual TestModule objects to access the target
(firmware/hardware/software).
It will be instantiated by the TestWrapper and the object given to
the TestModules as self.ifc (interface) so the writers of those
modules will need to know how to use that object
The TestWrapper class brings all the components together and handles
final cleanup.
The TestWrapper object is created with the following arguments:
When the TestWrapper's run() method is called it in turn calls the run() method of the UserInterface and giving it the Logger object, the list of args, a list of modules to run, and the TargetInterface object.
Once the UserInterface returns control to the TestWrapper we call
our own fini() method. Our fini() method in turn calls the fini()
for each of the following in order:
End of Document