06. Testing

Introduction to testing concepts and automated unit testing.

You are getting the first edition of all these pages. Please let me know if you find an error!

Testing is integral to all forms of engineering. Software developers often write as much test code as they do product code! This set of labs introduces testing concepts and automated testing.


Assertions

The building block of testing.

Unit testing

Using assertions to test a file.

Structuring test code

Organizing the test code has benefits, just like organizing program code.

pytest

Use a test framework, pytest, to run tests and collect results.

Testing for exceptions

How to test for expected exceptions.

Test coverage

Computing an objective measure of test quality.

Last modified September 9, 2024.