Fork me on GitHub

Automated testing

In this lesson we will discuss why testing needs to be part of the software development cycle and how such a cycle can be implemented. We will exercise a collaborative testing/code review workflow.


  1. You need pytest (as part of Anaconda or Miniconda or Virtualenv).

  2. Basic understanding of Git.

  3. You need a GitHub account.

  4. You will also need a Travis CI account but you can sign into it with your GitHub account.


10 min Motivation Why should we write tests?
10 min Concepts What are unit tests, regression tests, and integration tests?
What is test coverage?
How should we approach testing?
10 min Tools What tools are out there?
15 min Exercise: Testing with pytest How can we implement a test suite using pytest?
I am a Fortran developer, do I need to care about pytest?
15 min Exercise/discussion: Testing using hooks How can we use Git hooks to make sure we do not commit broken code?
40 min Exercise: Automatic testing with Travis CI How can we implement automatic testing each time we push changes to the repository?
Why is it good to autoclose issues with commit messages?
25 min Exercise/discussion: Test design
5 min Conclusions and recommendations What can we take home from this lesson?