Testing of Scientific software
Content
High quality software often is a prerequisite for successful and sustainable research. Software testing is one of the most crucial steps to ensure good and correct software.
This course teaches the basics of testing scientific software, such as unit testing or regression testing. We will introduce established software testing methodologies and see how they apply for scientific software. Problems arising when testing scientific software in particular will also be covered as well as strategies to circumnavigate them.
As scientific software is exploratory in nature, it can be hard to come up with resonable testcases. We will also focus, how testing can still be employed to gain more confidence in the software in theese cases.
In hands-on sessions participants will write some tests in Python code to learn the usage of testing frameworks in practice.
Requirements
General prerequisites:
- Programming experience
Prerequisites for hands-on sessions:
- Basic knowledge of Python
- Basic knowledge of linear algebra
Participants are expected to have a computer at their disposal to be able to set up a a working Python environment (we suggest using the Anaconda distribution) to follow the hands on session.
Below you can find the instructions for setting up isolated Python environments that contain all packages needed to work on the course material.
If you have your own environment please note that we assume you to use Python >= 3.9.x
Python Anaconda distribution
-
For a UNIX-like operating system open a command line; for Windows open a Anaconda Prompt.
- Create the environment and install packages (this may take a while):
$ conda create --name software_testing python numpy pytest hypothesis $ conda info --envs # check if environment is available
- Activate the environment:
$ source activate software_testing
Python virtual environments
- Follow the instructions for setting up a virtual environment for your operating system and activate your environment: https://docs.python.org/3/library/venv.html
- Activate the environment:
$ source /path/to/your/environment/bin/activate
- Install packages (this may take a while):
$ pip install numpy pytest hypothesis