An open API service indexing awesome lists of open source software.

https://github.com/carpentries-incubator/byte-sized-rse-testing

Byte-Sized RSE: Unit Testing Code
https://github.com/carpentries-incubator/byte-sized-rse-testing

alpha byte-sized-rse carpentries-incubator english lesson python testing unit-testing

Last synced: 5 months ago
JSON representation

Byte-Sized RSE: Unit Testing Code

Awesome Lists containing this project

README

          

## Byte-Sized RSE: Unit Testing Code

This is a Byte-Sized RSE lesson on unit testing code, part of the [Byte-Sized RSE Series](https://github.com/carpentries-incubator/byte-sized-rse-overview/tree/main).

### Questions

- What is a unit test, and why is it important for improving the reliability and reproducibility of research code?
- How can we identify which parts of code should be tested?
- How do we write and run a simple unit test for a given function?
- How can we test that code handles errors or invalid inputs correctly?
- What makes a good, maintainable unit test?

### Learning Objectives

At the end of this lesson, learners should be able to:

- Describe what unit testing is and explain why it matters for software quality.
- Examine example code and identify where and how unit tests could be applied.
- Write a simple unit test for a function and integrate it into their project.
- Recognise common error/exception conditions in code and write tests that handle/expect such errors.
- Evaluate a test suite in terms of coverage.

### Slides

[Slides](https://docs.google.com/presentation/d/1qNyDV3VDwv6Z3RHwfn5hL0pFxzK_DsWN3bPMjwV7Uoc/edit?usp=sharing) available under CC BY 4.0 licence.