Exercises
We assume that you have attended/watched the live lecture on Software Testing and now have a good idea about what Test Driven Development (TDD) is about.
While the lecture focussed on the pytest
library, Python also provides a Unit Testing framework unittest
out of the box. Conveniently, pytest
is compatible with and can run unittest
s. Choose what suits your needs.
Task 1
Obtain the skeleton code from the live lectures here. Then try to reproduce whatever Ivan did during the live demo with pytest
, and try to understand what he did. Because trying things out yourself is always different from just watching someone else code on the screen!
Task 2
Choose from some of these exercises, and write unit tests (with pytest
) to check the correctness of the functions in the following exercises. And if you still have your solutions, test them!