Back to all work
TDD Kata / algorithm & visual time encoding
Berlin Clock (Mengenlehreclock)
A precision implementation of the Berlin Clock (Mengenlehreclock) in Swift built with strict Test-Driven Development (TDD) and illuminated colored time blocks.
100% Test CoverageGitHub Open SourceStrict TDD
Real-time Berlin Clock time encoding algorithm in action
Methodology 100% Strict TDD
Coverage 100% Code Coverage
Encoding Yellow / Red / Off
The situation
What the project needed.
The Berlin Clock tells time using illuminated colored blocks read top-to-bottom: 1-second blinking yellow lamp, five-hour red blocks, single-hour red blocks, five-minute red/yellow blocks, and single-minute yellow blocks.
The work
What I shipped.
- Implemented the complete Mengenlehreclock time-encoding algorithm using Red-Green-Refactor TDD.
- Separated string-based time representations (Y/R/O) from rendering logic for flawless testability.
- Created a smooth visual interface mapping string states into animated illuminated colored blocks.
Personal contribution
Technical architecture & leadership.
- Authored the mathematical test suite and decoupled the presentation layer from the clock domain logic.
Outcome & Impact
Results in production.
- Clean reference example of applying TDD to algorithmic and visual state problems in Swift.
Your product
Have a similar challenge?
Whether you are architecting a new Apple product, optimizing video/AVFoundation pipelines, or enforcing strict TDD, tell me what needs to be solved.