Skip to content

Sample work · Code & Bugs

Tests for an existing API that find real bugs

Tests for the logic and HTTP interface of a small shop API. Whether they are any good is shown by mutation testing: intentionally introduced bugs must be detected.

Sample work (demo), not a client job. Built as a trial task with invented example data; the check figures below come from the automatic test run and are not polished.

What was built

  • Tests for the calculation logic, the HTTP interface, and known error cases
  • Mutation testing: every intentionally introduced change must cause at least one test to fail
  • Runs with a single command: pytest

Download testsuite-projekt.zip

How it was checked

Automatic test run on 2026-10-31, taken from the log (test data invented, figures measured):

  • 6/6 green
  • 28/28 tests green
  • Tests: {'logik': 12, 'api': 13, 'regression': 3}
  • Mutants killed 8/8

Limits

What this sample does not cover, so nobody expects more:

  • Tests for Python/FastAPI via pytest + TestClient; browser interfaces are tested by the 'browsertest' sample (Playwright), load tests are not included
  • Mutation testing with 8 hand-picked mutants, no fully automated tool (mutmut/cosmic-ray not installed)
  • Coverage measurement (coverage) not installed - effectiveness is proven via killed mutants

Something like this for your business?

Describe briefly what you need. You get a fixed price before I start; nothing happens without your yes.

To the workshop