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
- Host: GitHub
- URL: https://github.com/carpentries-incubator/byte-sized-rse-testing
- Owner: carpentries-incubator
- License: other
- Created: 2025-10-23T12:16:29.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-12-30T01:43:20.000Z (6 months ago)
- Last Synced: 2026-01-02T10:17:21.310Z (6 months ago)
- Topics: alpha, byte-sized-rse, carpentries-incubator, english, lesson, python, testing, unit-testing
- Language: Dockerfile
- Homepage: https://carpentries-incubator.github.io/byte-sized-rse-testing/
- Size: 7.29 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
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.