Maintaining & Sustaining Software Intermediate 1h 40m

Testing and Test-Driven Development

This lesson covers how to write tests for your code, understand test-driven development, and use testing frameworks like pytest in Python.

Learning outcomes

  • Explain the principles and benefits of test-driven development (TDD)
  • Demonstrate how to write unit tests using pytest
  • Apply TDD practices to improve code quality and design
  • Implement automated testing strategies for software projects
  • Recognize the role of testing in continuous integration workflows

Prerequisites

Git, Python

Cite this lesson

Metadata from CITATION.cff.

APA

CodeRefinery, Bast, R., Wikfeldt, K. T., Darst, R., Lindi, B., Hellsvik, J., Smart, P., van Vliet, M., Di Remigio Eikås, R., Wehner, J., Ruokolainen, T., Valberg-Madsen, J., Vathsavayi, S. H., Skrypnyk, R., Thiele, J. P., Rehnberg, V., Pfau, T. (2025). Automated testing. UC OSPO Network. https://coderefinery.github.io/testing/

BibTeX
@misc{testing_and_test_driven_development_2025,
  author    = {{CodeRefinery} and Bast, Radovan and Wikfeldt, Kjartan Thor and Darst, Richard and Lindi, Bjørn and Hellsvik, Johan and Smart, Poojan and van Vliet, Marijn and Di Remigio Eikås, Roberto and Wehner, Jens and Ruokolainen, Teemu and Valberg-Madsen, Janus and Vathsavayi, Sri Harsha and Skrypnyk, Rostyslav and Thiele, Jan Philipp and Rehnberg, Viktor and Pfau, Thomas},
  title     = {Automated testing},
  year      = {2025},
  publisher = {UC OSPO Network},
  url       = {https://coderefinery.github.io/testing/}
}