# Causal Testing Framework
### A Causal Inference-Driven Software Testing Framework
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
![example workflow](https://github.com/CITCOM-project/CausalTestingFramework/actions/workflows/ci-tests.yaml/badge.svg)
[![codecov](https://codecov.io/gh/CITCOM-project/CausalTestingFramework/branch/main/graph/badge.svg?token=04ijFVrb4a)](https://codecov.io/gh/CITCOM-project/CausalTestingFramework)
[![Documentation Status](https://readthedocs.org/projects/causal-testing-framework/badge/?version=latest)](https://causal-testing-framework.readthedocs.io/en/latest/?badge=latest)
![Dynamic TOML Badge](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FCITCOM-project%2FCausalTestingFramework%2Fmain%2Fpyproject.toml&query=%24.project%5B'requires-python'%5D&label=python)
![PyPI - Version](https://img.shields.io/pypi/v/causal-testing-framework)
[![DOI](https://t.ly/FCT1B)](https://orda.shef.ac.uk/articles/software/CITCOM_Software_Release/24427516)
![GitHub Licens[schematic.tex](images%2Fschematic.tex)e](https://img.shields.io/github/license/CITCOM-project/CausalTestingFramework)
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).
![Causal Testing Workflow](images/schematic-dark.png#gh-dark-mode-only)
![Causal Testing Workflow](images/schematic.png#gh-light-mode-only)
## Installation
### Requirements
- Python 3.9, 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](https://causal-testing-framework.readthedocs.io/en/latest/?badge=latest).
## 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](https://dl.acm.org/doi/10.1145/3607184),
and the software citation should contain the specific Figshare [DOI](https://orda.shef.ac.uk/articles/software/CITCOM_Software_Release/24427516) of the version used in your work.
<details>
<summary><b>BibTeX Citations</b></summary>
<details>
<summary>Paper</summary>
```
@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}
}
```
</details>
<details>
<summary>Software (example)</summary>
```
@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}
}
```
</details>
</details>
## How to Contribute
To contribute to our work, please ensure the following:
1. [Fork the repository](https://help.github.com/articles/fork-a-repo/) into your own GitHub account, and [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) it to your local machine.
2. [Create a new branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository) in your forked repository. Give this branch an appropriate name, and create commits that describe the changes.
3. [Push your changes](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository) to your new branch in your remote fork, compare with `CausalTestingFramework/main`, and ensure any conflicts are resolved.
4. Create a draft [pull request](https://docs.github.com/en/get-started/quickstart/hello-world#opening-a-pull-request) from your branch, and ensure you have [linked](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls) it to any relevant issues in your description.
We use the [unittest]() module to develop our tests and the [pytest](https://pytest.org/en/latest/) framework as our test discovery, [pylint](https://pypi.org/project/pylint/) for our code analyser, and [black](https://pypi.org/project/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](https://gow.epsrc.ukri.org/NGBOViewGrant.aspx?GrantRef=EP/T030526/1) - "_Causal Inference for Testing of Computational Models_"
under the grant EP/T030526/1.
Raw data
{
"_id": null,
"home_page": null,
"name": "causal-testing-framework",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "causal inference, verification",
"author": "The CITCOM team",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/b4/21/067c9c6039b0648404093ba68aa451bdb3bba91fa53a7d3b8bf907d4c329/causal_testing_framework-8.1.0.tar.gz",
"platform": null,
"description": "# Causal Testing Framework\n### A Causal Inference-Driven Software Testing Framework\n\n\n[![Project Status: Active \u2013 The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n![example workflow](https://github.com/CITCOM-project/CausalTestingFramework/actions/workflows/ci-tests.yaml/badge.svg)\n[![codecov](https://codecov.io/gh/CITCOM-project/CausalTestingFramework/branch/main/graph/badge.svg?token=04ijFVrb4a)](https://codecov.io/gh/CITCOM-project/CausalTestingFramework)\n[![Documentation Status](https://readthedocs.org/projects/causal-testing-framework/badge/?version=latest)](https://causal-testing-framework.readthedocs.io/en/latest/?badge=latest)\n![Dynamic TOML Badge](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FCITCOM-project%2FCausalTestingFramework%2Fmain%2Fpyproject.toml&query=%24.project%5B'requires-python'%5D&label=python)\n![PyPI - Version](https://img.shields.io/pypi/v/causal-testing-framework)\n[![DOI](https://t.ly/FCT1B)](https://orda.shef.ac.uk/articles/software/CITCOM_Software_Release/24427516)\n![GitHub Licens[schematic.tex](images%2Fschematic.tex)e](https://img.shields.io/github/license/CITCOM-project/CausalTestingFramework)\n\nCausal testing is a causal inference-driven framework for functional black-box testing. This framework utilises\ngraphical causal inference (CI) techniques for the specification and functional testing of software from a black-box\nperspective. In this framework, we use causal directed acyclic graphs (DAGs) to express the anticipated cause-effect\nrelationships amongst the inputs and outputs of the system-under-test and the supporting mathematical framework to\ndesign statistical procedures capable of making causal inferences. Each causal test case focuses on the causal effect of\nan intervention made to the system-under test. That is, a prescribed change to the input configuration of the\nsystem-under-test that is expected to cause a change to some output(s).\n\n![Causal Testing Workflow](images/schematic-dark.png#gh-dark-mode-only)\n![Causal Testing Workflow](images/schematic.png#gh-light-mode-only)\n\n## Installation\n\n### Requirements\n- Python 3.9, 3.10, 3.11 and 3.12\n\n- Microsoft Visual C++ 14.0+ (Windows only).\n\nTo install the latest stable release of the Causal Testing Framework:\n\n``pip install causal-testing-framework``\n\nor if you want to install with the development packages/tools:\n\n``pip install causal-testing-framework[dev]``\n\nAlternatively, you can install directly via source:\n\n```shell\ngit clone https://github.com/CITCOM-project/CausalTestingFramework\ncd CausalTestingFramework\n```\nthen to install a specific release:\n\n```shell\ngit fetch --all --tags --prune\ngit checkout tags/<tag> -b <branch>\npip install . # For core API only\npip install -e . # For editable install, useful for development work\n```\nFor more information on how to use the Causal Testing Framework, please refer to our [documentation](https://causal-testing-framework.readthedocs.io/en/latest/?badge=latest). \n## How to Cite\nIf you use our framework in your work, please cite the following:\n\n``This research has used version X.Y.Z (software citation) of the \nCausal Testing Framework (paper citation).``\n\nThe paper citation should be the Causal Testing Framework [paper](https://dl.acm.org/doi/10.1145/3607184), \nand the software citation should contain the specific Figshare [DOI](https://orda.shef.ac.uk/articles/software/CITCOM_Software_Release/24427516) of the version used in your work.\n\n\n\n<details>\n <summary><b>BibTeX Citations</b></summary>\n \n <details>\n <summary>Paper</summary>\n \n ```\n @ARTICLE{Clark_etal_2023,\n author = {Clark, Andrew G. and Foster, Michael and Prifling, Benedikt and Walkinshaw, Neil and Hierons, Robert M.\n and Schmidt, Volker and Turner, Robert D.},\n title = {Testing Causality in Scientific Modelling Software},\n year = {2023},\n publisher = {Association for Computing Machinery},\n url = {https://doi.org/10.1145/3607184},\n doi = {10.1145/3607184},\n journal = {ACM Trans. Softw. Eng. Methodol.},\n month = {jul},\n keywords = {Software Testing, Causal Testing, Causal Inference}\n }\n ```\n\n </details>\n \n <details>\n <summary>Software (example)</summary>\n \n ```\n @ARTICLE{Wild2023,\n 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},\n title = {CITCOM Software Release},\n year = {2023},\n month = {nov},\n url = {https://orda.shef.ac.uk/articles/software/CITCOM_Software_Release/24427516},\n doi = {10.15131/shef.data.24427516.v1}\n }\n ```\n </details>\n\n</details>\n\n## How to Contribute\n\nTo contribute to our work, please ensure the following:\n\n1. [Fork the repository](https://help.github.com/articles/fork-a-repo/) into your own GitHub account, and [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) it to your local machine.\n2. [Create a new branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository) in your forked repository. Give this branch an appropriate name, and create commits that describe the changes.\n3. [Push your changes](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository) to your new branch in your remote fork, compare with `CausalTestingFramework/main`, and ensure any conflicts are resolved.\n4. Create a draft [pull request](https://docs.github.com/en/get-started/quickstart/hello-world#opening-a-pull-request) from your branch, and ensure you have [linked](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls) it to any relevant issues in your description. \n\nWe use the [unittest]() module to develop our tests and the [pytest](https://pytest.org/en/latest/) framework as our test discovery, [pylint](https://pypi.org/project/pylint/) for our code analyser, and [black](https://pypi.org/project/black/) for our code formatting.\nTo find the other (optional) developer dependencies, please check `pyproject.toml`.\n\n\n\n## Acknowledgements \n\nThe Causal Testing Framework is supported by the UK's Engineering and Physical Sciences Research Council (EPSRC),\nwith the project name [CITCOM](https://gow.epsrc.ukri.org/NGBOViewGrant.aspx?GrantRef=EP/T030526/1) - \"_Causal Inference for Testing of Computational Models_\" \nunder the grant EP/T030526/1.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A framework for causal testing using causal directed acyclic graphs.",
"version": "8.1.0",
"project_urls": {
"Bug_Tracker": "https://github.com/CITCOM-project/CausalTestingFramework/issues",
"Documentation": "https://causal-testing-framework.readthedocs.io/",
"Source": "https://github.com/CITCOM-project/CausalTestingFramework"
},
"split_keywords": [
"causal inference",
" verification"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a7110b3d72e8a7c56be24c8e7299277d3b898f6233cbcff6e6f7304d63bb4c0a",
"md5": "28ad800ee5d7ef6c62e59f8ac155939d",
"sha256": "86998bad55f1b9dc5b50e9a5755ddfbb8f45e0c6b19d3c1a6f2d27f5de45c0ca"
},
"downloads": -1,
"filename": "causal_testing_framework-8.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "28ad800ee5d7ef6c62e59f8ac155939d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 1033899,
"upload_time": "2024-11-13T12:06:41",
"upload_time_iso_8601": "2024-11-13T12:06:41.097513Z",
"url": "https://files.pythonhosted.org/packages/a7/11/0b3d72e8a7c56be24c8e7299277d3b898f6233cbcff6e6f7304d63bb4c0a/causal_testing_framework-8.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b421067c9c6039b0648404093ba68aa451bdb3bba91fa53a7d3b8bf907d4c329",
"md5": "d8cf1dea5821e796e15baecd186531d9",
"sha256": "d629ac6592c92c0bc3f03f2fae0bda3cb55859a3436803a5ce7915e9c0bd9fe1"
},
"downloads": -1,
"filename": "causal_testing_framework-8.1.0.tar.gz",
"has_sig": false,
"md5_digest": "d8cf1dea5821e796e15baecd186531d9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 1003338,
"upload_time": "2024-11-13T12:06:43",
"upload_time_iso_8601": "2024-11-13T12:06:43.195039Z",
"url": "https://files.pythonhosted.org/packages/b4/21/067c9c6039b0648404093ba68aa451bdb3bba91fa53a7d3b8bf907d4c329/causal_testing_framework-8.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-13 12:06:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CITCOM-project",
"github_project": "CausalTestingFramework",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "causal-testing-framework"
}