Education project

TDD in Six Languages

Write the test first, six times

The same CRUD written test by test in C#, Python, React, PHP, Rust and Go, plus the JUnit 5 exercises, in eight suites and 137 test cases that run in Docker.

What it is about

The first assignment of Testing and Configuration Management asked for the JUnit 5 exercises, a unit testing exercise and a CRUD built with TDD in three languages other than Java and Kotlin. I delivered six, the three required ones in C#, Python and React, plus PHP, Rust and Go.

Since all six solve the same problem, the only thing that changes between them is the language and its testing ecosystem. In total there are eight projects and 137 test cases, 111 of them in the CRUDs.

What it does

  • A playlist CRUD built with TDD in six languages, which are C# with xUnit, Python with pytest, React with Vitest, PHP with PHPUnit, and Rust and Go with their own test tools.
  • All six share the model, with a validated entity, an in-memory repository, ids assigned by the repository and two kinds of error, and tests named the same way everywhere.
  • The JUnit 5 guide exercises in Java and Kotlin, and unit versus integration tests with Mockito.
  • A docker-compose file with one service per language that runs the eight suites without installing any SDK.
  • A presentation page with the code, the tests and their runs, which can also run each suite live, locally or in Docker.

Decisions and their costs

  1. Fix the problem to compare languages

    Six implementations cannot be compared if each one solves something different.

  2. Docker so the demo does not depend on the classroom computer

    Installing six SDKs on the classroom computer was the biggest risk.

Repositories

Every public repository of the project, with what it holds.

  • 2026

    PGCEngineeringSebastian-s

    Testing and configuration management, with CRUDs written test first in six languages, 111 tests on top of the JUnit exercises and a script that runs all eight suites in Docker.

    Java, Kotlin, C#, Python, PHP, Rust, Go, React
GitHub organization: EngineeringSebastian-s

Stack

Pick a technology to see the projects that use it.