The Causal Testing Framework
The Causal Testing Framework - Published in JOSS (2025)
Science Score: 100.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 12 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: acm.org, joss.theoj.org -
✓Committers with academic emails
6 of 11 committers (54.5%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Scientific Fields
Repository
A causal inference-driven framework for functional black-box testing of complex software.
Basic Info
- Host: GitHub
- Owner: CITCOM-project
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://causal-testing-framework.readthedocs.io/en/latest/
- Size: 4.43 MB
Statistics
- Stars: 18
- Watchers: 3
- Forks: 5
- Open Issues: 16
- Releases: 51
Metadata Files
README.md
Causal Testing Framework
A Causal Inference-Driven Software Testing Framework
Causal testing is a causal inference-driven framework for functional black-box testing. This framework utilises graphical causal inference (CI) techniques for the specification and functional testing of software from a black-box perspective. In this framework, we use causal directed acyclic graphs (DAGs) to express the anticipated cause-effect relationships amongst the inputs and outputs of the system-under-test and the supporting mathematical framework to design statistical procedures capable of making causal inferences. Each causal test case focuses on the causal effect of an intervention made to the system-under test. That is, a prescribed change to the input configuration of the system-under-test that is expected to cause a change to some output(s).

Installation
Requirements
Python 3.10, 3.11 and 3.12
Microsoft Visual C++ 14.0+ (Windows only).
To install the latest stable release of the Causal Testing Framework:
pip install causal-testing-framework
or if you want to install with the development packages/tools:
pip install causal-testing-framework[dev]
Alternatively, you can install directly via source:
shell
git clone https://github.com/CITCOM-project/CausalTestingFramework
cd CausalTestingFramework
then to install a specific release:
shell
git fetch --all --tags --prune
git checkout tags/<tag> -b <branch>
pip install . # For core API only
pip install -e . # For editable install, useful for development work
For more information on how to use the Causal Testing Framework, please refer to our documentation.
[!NOTE] We recommend you use a 64 bit OS (standard in most modern machines) as we have had reports of the installation crashing on some 32 bit Debian installations.
Usage
[!NOTE] Example usage can be found in the
examplesdirectory.
To run the causal testing framework, you need some runtime data from your system, some causal test cases, and a causal DAG that specifies the expected causal relationships between the variables in your runtime data (and any other relevant variables that are not recorded in the data but are known to be relevant).
If you do not already have causal test cases, you can convert your causal DAG to causal tests by running the following command.
python -m causal_testing generate --dag_path $PATH_TO_DAG --output_path $PATH_TO_TESTS
- You can now execute your tests by running the following command.
python -m causal_testing test --dag_path $PATH_TO_DAG --data_paths $PATH_TO_DATA --test_config $PATH_TO_TESTS --output $OUTPUTThe results will be saved for inspection in a JSON file located at$OUTPUT. In the future, we hope to add a visualisation tool to assist with this.
How to Cite
If you use our framework in your work, please cite the following:
This research has used version X.Y.Z (software citation) of the
Causal Testing Framework (paper citation).
The paper citation should be the Causal Testing Framework paper, and the software citation should contain the specific Figshare DOI of the version used in your work.
BibTeX Citations
Paper
``` @ARTICLE{Clark_etal_2023, author = {Clark, Andrew G. and Foster, Michael and Prifling, Benedikt and Walkinshaw, Neil and Hierons, Robert M. and Schmidt, Volker and Turner, Robert D.}, title = {Testing Causality in Scientific Modelling Software}, year = {2023}, publisher = {Association for Computing Machinery}, url = {https://doi.org/10.1145/3607184}, doi = {10.1145/3607184}, journal = {ACM Trans. Softw. Eng. Methodol.}, month = {jul}, keywords = {Software Testing, Causal Testing, Causal Inference} } ```Software (example)
``` @ARTICLE{Wild2023, author = {Foster, Michael and Clark, Andrew G. and Somers, Richard and Wild, Christopher and Allian, Farhad and Hierons, Robert M. and Wagg, David and Walkinshaw, Neil}, title = {CITCOM Software Release}, year = {2023}, month = {nov}, url = {https://orda.shef.ac.uk/articles/software/CITCOM_Software_Release/24427516}, doi = {10.15131/shef.data.24427516.v1} } ```How to Contribute
To contribute to our work, please ensure the following:
- Fork the repository into your own GitHub account, and clone it to your local machine.
- Create a new branch in your forked repository. Give this branch an appropriate name, and create commits that describe the changes.
- Push your changes to your new branch in your remote fork, compare with
CausalTestingFramework/main, and ensure any conflicts are resolved. - Create a draft pull request from your branch, and ensure you have linked it to any relevant issues in your description.
We use the unittest module to develop our tests and the pytest framework as our test discovery, pylint for our code analyser, and black for our code formatting.
To find the other (optional) developer dependencies, please check pyproject.toml.
Acknowledgements
The Causal Testing Framework is supported by the UK's Engineering and Physical Sciences Research Council (EPSRC), with the project name CITCOM - "Causal Inference for Testing of Computational Models" under the grant EP/T030526/1.
Owner
- Name: CITCOM-project
- Login: CITCOM-project
- Kind: organization
- Repositories: 4
- Profile: https://github.com/CITCOM-project
JOSS Publication
The Causal Testing Framework
Authors
Tags
causal testing causal inference causality software testing metamorphic testingCitation (CITATION.cff)
cff-version: "1.2.0"
authors:
- family-names: Foster
given-names: Michael
orcid: "https://orcid.org/0000-0001-8233-9873"
- family-names: Clark
given-names: Andrew
orcid: "https://orcid.org/0000-0002-6830-0566"
- family-names: Wild
given-names: Christopher
orcid: "https://orcid.org/0009-0009-1195-1497"
- family-names: Allian
given-names: Farhad
orcid: "https://orcid.org/0000-0002-4569-0370"
- family-names: Turner
given-names: Robert
orcid: "https://orcid.org/0000-0002-1353-1404"
- family-names: Somers
given-names: Richard
orcid: "https://orcid.org/0009-0009-1195-1497"
- family-names: Latimer
given-names: Nicholas
orcid: "https://orcid.org/0000-0001-5304-5585"
- family-names: Walkinshaw
given-names: Neil
orcid: "https://orcid.org/0000-0003-2134-6548"
- family-names: Hierons
given-names: Robert M.
orcid: "https://orcid.org/0000-0003-2134-6548"
contact:
- family-names: Foster
given-names: Michael
orcid: "https://orcid.org/0000-0001-8233-9873"
doi: 10.15131/shef.data.28539398.v1
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Foster
given-names: Michael
orcid: "https://orcid.org/0000-0001-8233-9873"
- family-names: Clark
given-names: Andrew
orcid: "https://orcid.org/0000-0002-6830-0566"
- family-names: Wild
given-names: Christopher
orcid: "https://orcid.org/0009-0009-1195-1497"
- family-names: Allian
given-names: Farhad
orcid: "https://orcid.org/0000-0002-4569-0370"
- family-names: Turner
given-names: Robert
orcid: "https://orcid.org/0000-0002-1353-1404"
- family-names: Somers
given-names: Richard
orcid: "https://orcid.org/0009-0009-1195-1497"
- family-names: Latimer
given-names: Nicholas
orcid: "https://orcid.org/0000-0001-5304-5585"
- family-names: Walkinshaw
given-names: Neil
orcid: "https://orcid.org/0000-0003-2134-6548"
- family-names: Hierons
given-names: Robert M.
orcid: "https://orcid.org/0000-0003-2134-6548"
date-published: 2025-03-06
doi: 10.21105/joss.07739
issn: 2475-9066
issue: 107
journal: Journal of Open Source Software
publisher:
name: Open Journals
start: 7739
title: The Causal Testing Framework
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.07739"
volume: 10
title: The Causal Testing Framework
GitHub Events
Total
- Create event: 38
- Issues event: 35
- Release event: 14
- Watch event: 7
- Delete event: 17
- Issue comment event: 116
- Push event: 203
- Pull request review event: 75
- Pull request review comment event: 40
- Pull request event: 60
- Fork event: 2
Last Year
- Create event: 38
- Issues event: 35
- Release event: 14
- Watch event: 7
- Delete event: 17
- Issue comment event: 116
- Push event: 203
- Pull request review event: 75
- Pull request review comment event: 40
- Pull request event: 60
- Fork event: 2
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| cwild-UoS | 9****S | 479 |
| Michael Foster | m****r@s****k | 455 |
| AndrewC19 | a****2@s****k | 175 |
| f-allian | a****d@g****m | 123 |
| Richard Somers | r****1@s****k | 65 |
| Robert (Bob) Turner | r****r@s****k | 46 |
| cwild-UoS | c****d@s****k | 33 |
| bobturneruk | 3****k | 2 |
| Daniel S. Katz | d****z@i****g | 2 |
| Sam Grayson | s****m@s****e | 1 |
| James Oyaide | 5****r | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 125
- Total pull requests: 184
- Average time to close issues: 9 months
- Average time to close pull requests: 13 days
- Total issue authors: 9
- Total pull request authors: 11
- Average comments per issue: 1.31
- Average comments per pull request: 2.66
- Merged pull requests: 157
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 19
- Pull requests: 67
- Average time to close issues: 26 days
- Average time to close pull requests: 9 days
- Issue authors: 4
- Pull request authors: 6
- Average comments per issue: 0.68
- Average comments per pull request: 2.3
- Merged pull requests: 49
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jmafoster1 (39)
- cwild-UoS (23)
- f-allian (18)
- christopher-wild (12)
- rsomers1998 (11)
- bobturneruk (9)
- AndrewC19 (8)
- neilwalkinshaw (2)
- akothen (1)
Pull Request Authors
- jmafoster1 (77)
- f-allian (51)
- cwild-UoS (36)
- christopher-wild (17)
- AndrewC19 (8)
- rsomers1998 (8)
- bobturneruk (7)
- charmoniumQ (2)
- Jimazcoder (2)
- neilwalkinshaw (2)
- danielskatz (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 425 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 38
- Total maintainers: 2
pypi.org: causal-testing-framework
A framework for causal testing using causal directed acyclic graphs.
- Documentation: https://causal-testing-framework.readthedocs.io/
- License: MIT
-
Latest release: 12.0.1
published 5 months ago
Rankings
Maintainers (2)
Dependencies
- sphinx ==4.2.0
- sphinx-autoapi ==1.8.4
- sphinx-rtd-theme ==1.0.0
- actions/checkout v2 composite
- codecov/codecov-action v2 composite
- conda-incubator/setup-miniconda v2 composite
- actions/checkout v2 composite
- actions/upload-artifact v2 composite
- oxsecurity/megalinter/flavors/python v6 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- econml ~=0.12
- fitter ~=1.4
- lhsmdu ~=1.1
- networkx ~=2.6
- numpy ~=1.23
- pandas ~=1.3
- pydot ~=1.4
- scikit_learn ~=1.1
- scipy ~=1.7
- statsmodels ~=0.13
- tabulate ~=0.8
- z3_solver ~=4.11.2
- figshare/github-upload-action v1.1 composite
