Skip to content

Lab 4 — Automated Testing

Goal

Design tests that reveal faults, not merely execute lines.

Tasks

Choose one non-trivial function/service and create tests for:

  • A normal case.
  • A lower and upper boundary.
  • Invalid input.
  • A dependency failure or unavailable resource.
  • A previously observed bug (regression test).

If test doubles are used, explain why the dependency is being replaced.

Mutation thought experiment

For each test, identify a small implementation defect that should cause the test to fail. If you cannot identify one, the assertion may be too weak.