Hello! Today, let’s discuss an innovative and relatively unknown approach to software testing: Eventually Green Tests (EGT). We will explore the concept itself and the core principles.
Concept
In the world of distributed systems, many applications have embraced eventual consistency, a model where data doesn’t have to be correct right now but rather eventually converges towards correctness over time.
But why limit this approach to data? Introducing Eventually Green Tests (EGT), an innovative and modern approach to software testing. With EGT, we acknowledge that failing tests will eventually resolve themselves in one of the following ways:
With enough time and code changes → The implementation will eventually align with the test. If the business logic doesn’t match the test today, maybe the test is just predicting the future!
With enough time and shifting priorities → The feature being tested will become obsolete, allowing us to simply delete the corresponding tests. Why fix something that may not exist in the next sprint?
With enough time and technical leadership change → The entire codebase will be rewritten in a different language. At that point, all existing tests become irrelevant and can be conveniently ignored.
With enough time and organizational reshuffling → The whole application will eventually be deprecated, eliminating all concerns about failing tests.
This insight is backed by a recent study conducted in FAANG companies, showing that 97% of failing tests will eventually pass or become irrelevant. So why stress about failing tests today when time will eventually fix them for us?
EGT Core Principles
To fully embrace this revolutionary paradigm, let’s explore some core principles:
Adopt Schrödinger’s tests: Let’s be pragmatic: failing tests shouldn’t be considered as failing tests if no one actually look at the testing reports. Hence, until a report is not inspected, we should consider tests both passing and failing at the same time
Flakiness as a feature, not a bug: Tests that fail intermittently are realistic simulations of production behavior. It ensures software engineers never fully trust the test suite, keeping them sharp and vigilant.
Lazy assertions: Why enforce strict assertions when reality is subjective? Embrace subjectivity with flexible assertions that favor optimism by silently ignoring mismatches.
Coverage as a vision, not a metric: Instead of measuring actual code coverage, set a realistic visionary goal (e.g., 100% coverage) and assume that we will get there, eventually.
Test failure expiration policy: If a test fails long enough, assume the feature has been deprecated, removed, or rebranded. Delete the test and move forward.
A 10x engineer following EGT principles. Credits.
Conclusion
Eventually Green Tests (EGT) offer a revolutionary approach to software testing, enabling teams to declare alignment with modern software principles such as agility, quality-driven development, and efficiency.
If time heals all wounds, why not tests too?
💬 Thanks for reading! Next week, we will explore Eventually Correct Documentation (ECD) a groundbreaking approach where we simply wait until the implementation aligns with our incorrect documentation, avoiding the burden of maintaining docs that nobody reads.
❤️ If you made it this far and enjoyed the post, please consider giving it a like.
Explore Further
Otherwise, you can explore the Testing section of The Coder Cafe and navigate through a list of real (😉) concepts we have already discussed, such as:
still better than tdd
Giving me vibe coding vibes