This documents contains useful information for developers that want to help in the development of Frodo.
Check setup.cfg file for the list of dependencies.
- Use type annotations: it is easier to read the code in local context
- Any python tests should be placed in the
tests
directory. - Always run
tox
before submitting your contributions.
To use frodo
as a library, here are the necessary steps:
- Generate a history using
gen_history
. An isolation level and a list ofDBConn
s are required. There are many other possible knobs, including anemesis
, which injects faults while the test is running. - Check that history using
check_history
. An isolation level and aHistory
are required. It is also possible to output elements of the graph asDOT
files. - If there is no need to separate the two phases,
test_isolation
combines the two calls, returning both theHistory
and the list ofAnomaly
s.
There are some important types in frodo
:
History
(defined inhistory.py
): logged results of each operation and transcaction, which exposes a query interface.Anomaly
(defined inhistory.py
): represents an anomaly, which can then be printed as an explanation.DSG
(defined incycle.py
): implements the Direct Serialization Graph, as well as cycle enumeration and conversions from cycles toAnomaly
s.Nemesis
(defined innemesis.py
): API for fault injection. By subclassing and overriding its two methods (inject
andheal
) this will introduce faults while generating theHistory
.
File | Description |
---|---|
checker.py |
Check whether a history is valid under some isolation level. Includes definitions of the isolation levels. It is also possible to output a DOT representation of the graph and its anomalies |
cycle.py |
Construct the DSG. It also enumerates cycles in the graph. Cyclic anomalies are also described in this file |
db.py |
Define the interface for adapting databases. Implements that interface for mysql compatible DB's |
domain.py |
General purpose domain types (DBObject , Operation , Transaction , Result ) |
driver.py |
Concatenation of the history generation and anomaly checking |
generator.py |
Generation and execution of the workload and subsequent production of the History |
history.py |
Defines the History and Anomaly types |
nemesis.py |
Nemesis API for fault injection |
non_cycle.py |
Detection of non cyclical anomalies |