Skip to content

Commit 44daba4

Browse files
authored
Merge pull request #249 from CITCOM-project/doc-revamp
Update: docs revamp
2 parents a363dca + e997aac commit 44daba4

20 files changed

+473
-187
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
# Causal Testing Framework: A Causal Inference-Driven Software Testing Framework
1+
# Causal Testing Framework
2+
### A Causal Inference-Driven Software Testing Framework
23

3-
![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)
4+
5+
[![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)
6+
![example workflow](https://github.com/CITCOM-project/CausalTestingFramework/actions/workflows/ci-tests.yaml/badge.svg)
7+
[![codecov](https://codecov.io/gh/CITCOM-project/CausalTestingFramework/branch/main/graph/badge.svg?token=04ijFVrb4a)](https://codecov.io/gh/CITCOM-project/CausalTestingFramework)
8+
[![Documentation Status](https://readthedocs.org/projects/causal-testing-framework/badge/?version=latest)](https://causal-testing-framework.readthedocs.io/en/latest/?badge=latest)
9+
![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)
10+
![PyPI - Version](https://img.shields.io/pypi/v/causal-testing-framework)
11+
[![DOI](https://t.ly/FCT1B)](https://orda.shef.ac.uk/articles/software/CITCOM_Software_Release/24427516)
12+
![GitHub License](https://img.shields.io/github/license/CITCOM-project/CausalTestingFramework)
413

514
Causal testing is a causal inference-driven framework for functional black-box testing. This framework utilises
615
graphical causal inference (CI) techniques for the specification and functional testing of software from a black-box
@@ -12,10 +21,9 @@ system-under-test that is expected to cause a change to some output(s).
1221

1322
![Causal Testing Workflow](images/workflow.png)
1423

15-
1624
## Installation
1725

18-
See the readthedocs site for [installation
26+
See the Read the Docs site for [installation
1927
instructions](https://causal-testing-framework.readthedocs.io/en/latest/installation.html).
2028

2129
## Documentation

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The documentation is accessible on [Read the Docs](https://causal-testing-framew
66

77
## Locally building
88
To build locally, the requirements in `docs/source/requirements.txt` will need to be installed.
9-
9+
[README.md](README.md)
1010
Within `docs/`, run `make html` to create or update the .html files in the `docs/build` directory.
1111

1212
Running `make clean` will clean the `build` folder.

docs/source/_static/css/custom.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* Custom CSS */
2+
3+
/* Note: /*
4+
The CSS below will only work if 'logo_only':True in conf.py, but will require adjusting if False.
5+
*/
6+
7+
.wy-side-nav-search a .logo {
8+
max-width: 200px;
9+
max-height: 170px;
10+
height: auto;
11+
width:auto;
12+
}
13+
14+
15+
16+
.wy-nav-top a {
17+
color: #131E29; /* Change the colour of the homepage navigation title on mobiles */
18+
}
19+
20+
.wy-menu-vertical p.caption {
21+
22+
color: #9ADBE8; /* Change the colour of captions*/
23+
}
24+
25+
26+
.rst-content code.literal, .highlight .s2, .highlight .s1, .rst-content tt.literal{
27+
color: #440099;
28+
font-weight: bold;
29+
}
19.8 KB
Loading

docs/source/conf.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@
1212
#
1313
import os
1414
import sys
15+
from datetime import date
1516

1617
# Include root directory of project
1718
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
1819

1920

2021
# -- Project information -----------------------------------------------------
2122

22-
project = "Causal Testing"
23-
copyright = "2021, Andrew Clark, Michael Foster, Neil Walkinshaw, Rob Hierons, Bob Turner"
24-
author = "Andrew Clark, Michael Foster, Neil Walkinshaw, Rob Hierons, Bob Turner"
23+
project = "Causal Testing Framework"
24+
copyright = f"{date.today().year}, The CITCOM Team"
25+
author = "Andrew Clark, Michael Foster, Neil Walkinshaw, Rob Hierons, Bob Turner, Christopher Wild, Farhad Allian"
2526

2627

2728
# -- General configuration ---------------------------------------------------
@@ -49,7 +50,24 @@
4950
# Add any paths that contain custom static files (such as style sheets) here,
5051
# relative to this directory. They are copied after the builtin static files,
5152
# so a file named "default.css" will overwrite the builtin "default.css".
52-
# html_static_path = ['_static']
53+
html_static_path = ['_static']
54+
55+
html_css_files = ['css/custom.css']
5356

5457
# Path to generate documentation from using sphinx AutoAPI
5558
autoapi_dirs = [os.path.abspath(os.path.join("..", "..", "causal_testing"))]
59+
60+
autoapi_generate_api_docs = True
61+
autoapi_keep_files = True
62+
63+
# Suppress label warnings
64+
suppress_warnings = ['autosectionlabel.*']
65+
66+
67+
html_logo = '_static/images/CITCOM-logo.png'
68+
69+
html_theme_options = {
70+
'style_nav_header_background': '#9ADBE8', # Set the colour using CSS
71+
'logo_only' : True,
72+
}
73+

docs/source/credits.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Acknowledging CITCOM
2+
*********************
3+
4+
If you use the Causal Testing Framework for your work, please add the following line within your paper to acknowledge
5+
our work:
6+
7+
.. admonition:: Important
8+
:class: important
9+
10+
This research has used version X.Y.Z (software citation) of the Causal Testing Framework (paper citation).
11+
12+
The paper citation should be the Causal Testing Framework paper_, and the software citation should be the specific
13+
Figshare DOI_ for the version used in your research.
14+
15+
.. _paper: https://dl.acm.org/doi/10.1145/3607184
16+
.. _DOI: https://dl.acm.org/doi/10.1145/3607184
17+
18+
.. code-block:: latex
19+
20+
@ARTICLE{Clark_etal_2023,
21+
author = {Clark, Andrew G. and Foster, Michael and Prifling, Benedikt and Walkinshaw, Neil and Hierons, Robert M.
22+
and Schmidt, Volker and Turner, Robert D.},
23+
title = {Testing Causality in Scientific Modelling Software},
24+
year = {2023},
25+
publisher = {Association for Computing Machinery},
26+
url = {https://doi.org/10.1145/3607184},
27+
doi = {10.1145/3607184},
28+
journal = {ACM Trans. Softw. Eng. Methodol.},
29+
month = {jul},
30+
keywords = {Software Testing, Causal Testing, Causal Inference}
31+
}
32+
33+
The CITCOM Team
34+
***************
35+
36+
- Andrew G. Clark, Michael Foster, Richard Somers, Christopher Wild, Farhad Allian, Neil Walkinshaw.
37+

docs/source/description.rst

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
Framework Overview
1+
Background
22
=====================================
33

4-
CTF Components
5-
--------------
4+
The Causal Testing Framework consists of 3 main components: 1) Causal Specification, 2) Causal Test Case and 3) Data Collection.
65

76
#.
8-
:doc:`Causal Specification <../modules/causal_specification>`\ : Before we can test software, we need to obtain an
9-
understanding of how it should behave in a particular use-case scenario. In addition, to apply graphical CI
7+
:doc:`Causal Specification <../modules/causal_specification>`\ : To apply graphical CI
108
techniques for testing, we need a causal DAG which depicts causal relationships amongst inputs and outputs. To
119
collect this information, users must create a *causal specification*. This comprises a set of scenarios which place
1210
constraints over input variables that capture the use-case of interest, a causal DAG corresponding to this scenario,
1311
and a series of high-level functional requirements that the user wishes to test. In causal testing, these
1412
requirements should describe how the model should respond to interventions (changes made to the input configuration).
1513

14+
15+
1616
#.
1717
:doc:`Causal Tests <../modules/causal_tests>`\ : With a causal specification in hand, we can now go about designing
1818
a series of test cases that interrogate the causal relationships of interest in the scenario-under-test. Informally,
19-
a causal test case is a triple (M, X, Delta, Y), where M is the modelling scenario, X is an input configuration,
20-
Delta is an intervention which should be applied to X, and Y is the expected *causal effect* of that intervention on
21-
some output of interest. Therefore, a causal test case states the expected causal effect (Y) of a particular
22-
intervention (Delta) made to an input configuration (X). For each scenario, the user should create a suite of causal
19+
a causal test case is a triple ``(M, X, Delta, Y)``, where ``M`` is the modelling scenario, ``X`` is an input configuration,
20+
``Delta`` is an intervention which should be applied to ``X``, and ``Y`` is the expected *causal effect* of that intervention on
21+
some output of interest. Therefore, a causal test case states the expected causal effect (``Y``) of a particular
22+
intervention (``Delta``) made to an input configuration (``X``). For each scenario, the user should create a suite of causal
2323
tests. Once a causal test case has been defined, it is executed as follows:
2424

25-
26-
#. Using the causal DAG, identify an estimand for the effect of the intervention on the output of interest. That is,
25+
a. Using the causal DAG, identify an estimand for the effect of the intervention on the output of interest. That is,
2726
a statistical procedure capable of estimating the causal effect of the intervention on the output.
2827
#. Collect the data to which the statistical procedure will be applied (see Data collection below).
2928
#. Apply a statistical model (e.g. linear regression or causal forest) to the data to obtain a point estimate for
@@ -35,6 +34,8 @@ CTF Components
3534
test should pass or fail based on the results. In the simplest case, this takes the form of an assertion which
3635
compares the point estimate to the expected causal effect specified in the causal test case.
3736

37+
38+
3839
#.
3940
:doc:`Data Collection <../modules/data_collector>`\ : Data for the system-under-test can be collected in two
4041
ways: experimentally or observationally. The former involves executing the system-under-test under controlled
@@ -48,22 +49,3 @@ CTF Components
4849
provide instructions for an execution that will fill the gap (future work).
4950

5051
For more information on each of these steps, follow the link to their respective documentation.
51-
52-
Causal Inference Terminology
53-
----------------------------
54-
55-
Here are some explanations for the causal inference terminology used above.
56-
57-
58-
* Causal inference (CI) is a family of statistical techniques designed to quantify and establish **causal**
59-
relationships in data. In contrast to purely statistical techniques that are driven by associations in data, CI
60-
incorporates knowledge about the data-generating mechanisms behind relationships in data to derive causal conclusions.
61-
* One of the key advantages of CI is that it is possible to answer causal questions using **observational data**. That
62-
is, data which has been passively observed rather than collected from an experiment and, therefore, may contain all
63-
kinds of bias. In a testing context, we would like to leverage this advantage to test causal relationships in software
64-
without having to run costly experiments.
65-
* There are many forms of CI techniques with slightly different aims, but in this framework we focus on graphical CI
66-
techniques that use directed acyclic graphs to obtain causal estimates. These approaches used a causal DAG to explain
67-
the causal relationships that exist in data and, based on the structure of this graph, design statistical experiments
68-
capable of estimating the causal effect of a particular intervention or action, such as taking a drug or changing the
69-
value of an input variable.
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
Github Actions and Webhooks
22
===========================
33

4-
Github Actions
4+
Actions
55
--------------
66

7-
Currently this project makes use of 3 `Github Actions <https://github.com/features/actions>`_, which can be found in the `.github/workflows <https://github.com/CITCOM-project/CausalTestingFramework/tree/main/.github/workflows>`_ directory
7+
Currently, this project makes use of 3 `Github Actions <https://github.com/features/actions>`_,
8+
which can be found in the
9+
`.github/workflows <https://github.com/CITCOM-project/CausalTestingFramework/tree/main/.github/workflows>`_ directory.
810

911
They are:
1012

11-
#. ci-tests.yaml, which runs CI tests on each PR
13+
#. ``ci-tests.yaml``, which runs continuous integration (CI) tests on each on each pull request.
1214

13-
#. lint-format.yaml, runs linting on each PR
15+
#. ``lint-format.yaml``, which runs linting on each pull request.
1416

15-
#. publish-to-pypi.yaml, runs when a new version tag is pushed and publishes that tag version to pypi
17+
#. ``publish-to-pypi.yaml``, runs when a new version tag is pushed and publishes that tag version to PyPI.
1618

17-
Github Webhooks
19+
Webhooks
1820
---------------
1921

20-
The project also uses 3 `Webhooks <https://docs.github.com/en/webhooks-and-events/webhooks/about-webhooks>`_, which can be found in the `project settings <https://github.com/CITCOM-project/CausalTestingFramework/settings>`_ on Github
22+
The project also uses 3 `Webhooks <https://docs.github.com/en/webhooks-and-events/webhooks/about-webhooks>`_, which can
23+
be found in the `project settings <https://github.com/CITCOM-project/CausalTestingFramework/settings>`_ on Github. These
24+
include:
2125

22-
#. To codacy
26+
#. `Codacy <https://github.com/codacy>`_
2327

24-
#. To codecov
28+
#. `Codecov <https://github.com/codecov>`_
2529

26-
#. To readthedocs
30+
#. `Read the Docs <https://github.com/readthedocs>`_

docs/source/dev/documentation.rst

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
Project Documentation
22
=====================
33

4-
This page aims to describe:
4+
This page describes:
55

6-
#. The projects documentation style
6+
#. The projects documentation style,
77

8-
#. The tools used for documentation
8+
#. The tools used for documentation,
99

10-
#. ReadTheDocs where the documentation for this project is hosted
10+
#. Read the Docs where the documentation for this project is hosted.
1111

1212

13-
Documentation Style
13+
Style and Tools
1414
-------------------
1515

16-
The `Sphinx docstring format <https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html#the-sphinx-docstring-format>`_ is used throughout the projects codebase to allow for the easy understanding of classes, methods, functions, etc.
17-
This format allows for the easy generation of html documentation pages.
16+
The `Sphinx docstring format <https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html#the-sphinx-docstring-format>`_ is used
17+
throughout the projects codebase to allow for the easy understanding of classes, methods, functions, etc. This format
18+
allows for the easy generation of html documentation pages. It also checks for docstrings that have been added to the projects PyLint configuration.
1819

19-
Checks for docstrings have been added to the projects Pylint configuration.
20-
21-
Documentation Tools
22-
-------------------
23-
24-
To install the packages required to work with the documentation please ensure the projects **dev** dependencies are installed::
20+
To install the packages required to work with the documentation, please ensure the projects **dev** dependencies are installed::
2521

2622
pip install causal-testing-framework[dev]
2723

@@ -42,20 +38,25 @@ To cleanup the compiled docs you can run::
4238
make clean
4339

4440

45-
Situation within `docs/source` are the reStructuredText files (.rst) which contain the handwritten doc pages, which get compiled by the make commands.
4641

47-
Autodoc & Autoapi
42+
The source reStructuredText files (.rst) files can be found within `docs/source` directory, which contains the
43+
handwritten documentation pages and get compiled by the ``make`` commands.
44+
45+
Autodoc & AutoAPI
4846
*****************
4947

50-
`Autodoc <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`_ is an extension to sphinx that can import code modules and compile documentation from their docstrings.
48+
`Autodoc <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`_ is an extension to Sphinx that can import
49+
code modules and compile documentation from their docstrings.
5150

52-
`AutoAPI <https://sphinx-autoapi.readthedocs.io/en/latest/>`_ is a third party sphinx tool for recursively discovering code modules and compiling them into a logical doctree structure
51+
`AutoAPI <https://sphinx-autoapi.readthedocs.io/en/latest/>`_ is a third party Sphinx tool for recursively discovering
52+
code modules and compiling them into a logical doctree structure
5353

54-
The configuration for Sphinx, Autodoc and AutoAPI are all found in `/docs/source/conf.py <https://github.com/CITCOM-project/CausalTestingFramework/blob/main/docs/source/conf.py>`_.
54+
The configuration for Sphinx, Autodoc and AutoAPI can all be found in `/docs/source/conf.py <https://github.com/CITCOM-project/CausalTestingFramework/blob/main/docs/source/conf.py>`_.
5555

5656
ReadTheDocs
5757
-----------
58-
`Read the Docs <https://readthedocs.org/>`_ is a documentation hosting site that hosts, versions and builds documentation for free for open source projects.
58+
`Read the Docs <https://readthedocs.org/>`_ is a documentation hosting site that hosts, versions and builds documentation
59+
for free for open source projects.
5960

60-
This project makes use of a Github Webook to trigger the build in ReadTheDocs, further reading on this can be found :doc:`here <../dev/actions_and_webhooks>`\
61+
This project makes use of a Github Webhook to trigger the build in ReadTheDocs, further reading on this can be found :doc:`here <../dev/actions_and_webhooks>`\
6162

docs/source/dev/version_release.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@ Version Releases
22
================
33

44
This project follows the `Semantic Versioning 2.0.0 <https://semver.org/>`_ style for code releases.
5-
This page aims to describe the release process for a new code version on the `Project Github <https://github.com/CITCOM-project/CausalTestingFramework>`_
5+
This page describes the release process for a new framework version on the `Project Github <https://github.com/CITCOM-project/CausalTestingFramework>`_.
66

77
How to release
88
--------------
99

10-
#. Once your PR(s) are merged, navigate to https://github.com/CITCOM-project/CausalTestingFramework/releases, which can be found on the right hand side of the projects Github main page by clicking on 'Releases'
10+
#. Once your PR(s) are merged, navigate to https://github.com/CITCOM-project/CausalTestingFramework/releases, which can be found on the right hand side of the projects Github main page by clicking on 'Releases'.
1111

12-
#. Press the **Draft a new release** button in the top right of the releases page
12+
#. Press the **Draft a new release** button in the top right of the releases page.
1313

14-
#. Press the **Choose a tag** button and add the new version following the Semantic Version guidelines. Please include the 'v' before the tag, e.g. **v0.0.0**
14+
#. Press the **Choose a tag** button and add the new version following the Semantic Version guidelines. Please include the 'v' before the tag, e.g. **v0.0.0**.
1515

16-
#. Enter the same tag name into the **Release Title** box
16+
#. Enter the same tag name into the **Release Title** box.
1717

18-
#. Press **Generate Release Notes** button
18+
#. Press **Generate Release Notes** button.
1919

2020
#. Add any additional information that may be helpful to the release notes. If there are breaking changes for example, which modules will they affect?
2121

22-
#. Ensure the **Set as the latest release** checkbox is selected
22+
#. Ensure the **Set as the latest release** checkbox is selected.
2323

24-
#. Press publish release
24+
#. Press publish release.
2525

26-
#. Check that the Github Action worker, found in the `Actions tab <https://github.com/CITCOM-project/CausalTestingFramework/actions>`_ on the github, has successfully completed. Typical time to publish to PyPI is around 2 minutes.
26+
#. Check that the Github Action worker, found in the `Actions tab <https://github.com/CITCOM-project/CausalTestingFramework/actions>`_ has successfully completed. The typical time to publish to PyPI is around 2 minutes.
2727

2828
#. Check on the projects `PyPI page <https://pypi.org/project/causal-testing-framework/>`_ that the latest release is ready!
2929

0 commit comments

Comments
 (0)