← Graph

Event Logging for Testability

concept 2 connections

Technique of appending an entry to an events/audit log on every state change (dice rolls, winner assignment, etc.) so tests — and operators using tools like Sumo Logic, Datadog, or a database — can assert on the full execution trace instead of only the final return value. In Rodzik's talk, adding `events << ...` after each roll let tests prove *why* a player won, not just that they won. Rodzik notes event sourcing gives this for free, but warns about readability cost in domain code and potential bill increases under heavy traffic if logs go to expensive SaaS — pick the right tool (maybe a Datadog metric or the database). Particularly useful against legacy 'big ball of mud' code.

category
practice
about
Event Logging for Testability concept
Fourth iteration adds an events log on every state change so tests can assert on the execution trace.
about
Event Logging for Testability concept
Recommendation is the practice itself.

Provenance

Read by
1 extraction