Intro / sponsor read
Now, if you ever wondered why a test is slow or flaky, despite your best efforts, this next story might change how you think about the problem. This is a new blog post on Medium by Mona, who argues that testability is a core architectural property that determines both testing effort and software quality. Rather than focus only on writing tests, the article stresses design systems that are easy to test, observe, and control. Testability is defined how easily a system supports creating and running effective tests. Low testability doesn't always mean about quality. But it slows feedback, increases effort, and hides defects. High testability, on the other hand, delivers faster feedback and lower risk. And Mona breaks down testability into 3 main pillars. The first one is observability, seeking what happens inside the system through logging, tracing, like open telemetry, metrics, and health endpoints. Second is controllability, being able to set the system into known states via APIs, dependency injection, feature flags, or test hooks. And third is isolation, ensuring tests to run independently through mocking, in-memory database, containerized environments and seamless designs. She also goes over 8 architectural anti-patterns that reduce testability, like global state and independencies, tightly coupled services, non-deterministic behavior, weak logging, shared databases, un-mockable singletons and external systems without fallback. And to measure testability. This article suggests tracking test duration, set up complexity, flakiness, coverage, and time to diagnose failures. And finally, Mona recommends treating testability as a first class design concern, adding to the architecture review and checklist that covers observability, controllability, mockability, isolation, and cleanup mechanisms. And you can read more about it using the links down below.