Skip to content

Cambridge-ICCS/testing-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation





Workshop on Correctness and Testing

GitHub

This is an intensive 2h30 minute workshop on correctness and testing for scientific software, using Python as the demonstration language with the pytest framework. It assumes that the attendees have some programming skills, but are not necessarily Python experts. There is some emphasis on scientific computing, with the example being a simple 0D Energy Balance Model (EBM). It would therefore be beneficial if you have some experience in this field, though not strictly necessary.

The slides are included in this repository.

This material was first delivered at the 2025 ICCS summer school.

Session 1 - 1h

  • 10 minute intro about correctness and testing
  • 50 minutes explaining concepts about unit testing including
    • Parameterised tests
    • Fixtures
    • Negative tests
    • Approximation and floating point
    • TDD
    • Code coverage

Session 2 - 1h30

  • 20 minute unit test exercises
  • 40 minutes lecture
    • Integration and end-to-end tests
    • Property-based testing
  • 30 minutes exercises (property-based test exercises)

Example and exercises

The example folder provides a small 0-dimensional Energy Balance Model for a planet (with its main configuration being for Earth). See example/README.md for instructions on its usage. It contains a test suite in the example/tests directory which is used for demonstration and is the source material for the exercises in exercises.md, which also provides setup instructions.

About

Training material on testing developed by ICCS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages