How to Make Testing More Sustainable
Our take

The growing conversation around software testing sustainability, as highlighted by Ben Linders’ recent article, isn't just a niche concern for environmentally conscious developers; it’s a necessary evolution reflecting a maturing understanding of software development practices. For years, the focus has been on *more* testing – more coverage, more edge cases, more automation. While thoroughness remains vital, the sheer volume of tests many organizations maintain is increasingly unsustainable, both from a resource perspective and a practical standpoint. Linders’ emphasis on skipping unnecessary tests, failing fast, and focusing on impacted tests aligns perfectly with principles of efficient development championed in articles like The Cost of Testing and reinforces the need to move beyond simply "checking" code to strategically *validating* it. This shift is particularly relevant as AI-native spreadsheet technologies handle more complex data flows and calculations; ensuring the integrity of those processes requires a smarter, not just a bigger, testing strategy.
The core of Linders’ argument – tracking energy use per test and leveraging static code analysis – is both pragmatic and surprisingly impactful. While the immediate cost savings of reducing test execution time are clear, the deeper implication lies in identifying systemic inefficiencies within the testing suite itself. High energy consumption often points to poorly written tests, redundant assertions, or areas where testing strategies are fundamentally misaligned with the codebase. This isn't about sacrificing quality for speed; it’s about optimizing the testing process to achieve higher quality with fewer resources. The concept resonates with the principles of test pyramid and hexagonal architecture, encouraging developers to prioritize unit tests and integration tests while minimizing the reliance on slow, end-to-end tests. Consider how these principles connect with discussions around test doubles and mocking, as detailed in Effective Software Testing.
Beyond the immediate technical benefits, embracing sustainable testing practices fosters a culture of mindful development. It encourages developers to critically evaluate the purpose and value of each test, leading to a more focused and maintainable codebase. This, in turn, reduces technical debt and makes it easier to adapt to changing requirements. In an era where agility and rapid iteration are paramount, a bloated and inefficient testing suite can become a significant bottleneck. The ability to quickly and confidently deploy new features relies on a testing infrastructure that is both reliable and responsive. Furthermore, a focus on sustainability aligns with broader organizational goals around environmental responsibility and resource optimization, showcasing a commitment to ethical and efficient software development.
Looking ahead, the integration of AI into testing sustainability presents exciting possibilities. Imagine AI-powered tools that automatically identify redundant tests, optimize test execution order based on code changes, and even predict the energy consumption of new tests. While tracking energy use per test is a valuable first step, the future may involve dynamic resource allocation, where testing infrastructure automatically scales up or down based on demand and environmental conditions. It will be fascinating to observe how these technologies evolve and whether the industry adopts standardized metrics for measuring and reporting on the environmental impact of software testing – a question that will likely become increasingly important as the computational demands of AI-powered applications continue to grow.

By using a sustainable testing strategy, you can skip unnecessary tests, ensure failing fast and early, and only run tests affected by code changes. Tracking energy use per test and using static code analysis can help spot inefficiencies and guide optimization efforts.
By Ben LindersRead on the original site
Open the publisher's page for the full experience