← Graph

Setup Code Reveals System Quality

takeaway 2 connections

Scott's rule of thumb: the whole point of TDD isn't `expect` or `should_equal` — those are just checks — it's the setup code. The more things you have to set up, the lower-quality the system. If you have to stand up inventory data to test pricing, you've hidden coupling, and Rails tools like factory_bot make this invisible by adding inventory defaults the moment a validation demands them. Developers are often happy with their tests for the wrong reasons; showing the tests to business people would expose cross-domain bleed. The fix is decoupling domains via events.

type
insight
takeaway Setup Code Reveals System Quality
about
Reframes TDD as being about setup minimization, not assertion syntax.
takeaway Setup Code Reveals System Quality
from_talk
Scott's heuristic explained during the callbacks/testing discussion.

Provenance