DEV Community

John Mitchell
John Mitchell

Posted on

Tests are a business investment

Tests are a business investment, of tech resources, to create business value.

It's good to study the Testing Pyramid. High level tests are slow and brittle, but connect the low-level code to business features. We can discuss their value with the business. Unit tests are fast and detail oriented -- I write a ton of these. Integration tests are useful to bring multiple modules together and check they work as expected.

In practice I write 1-2 high level tests (generally end to end, sometimes UI, or API/integration tests) to help focus development and have something that the business understands. Integration tests are great to iterate on, so that new code and tests actually work with real APIs correctly.

All tests are valuable. They are a high-level specification of the code. They "smooth the path forward" for the low-level implementation. Tests are not a tax, they are a way to think about the work and ensure it acts exactly as needed, no more.

Tests are not free. However they create a lot of value -- they create (business and tech) confidence that the system is working as expected. Tests assist refactoring, which makes the code much cheaper and easier to work with.

(disclaimer: writing a book about tech feedback loops, e.g. tests)

adapted from https://news.ycombinator.com/item?id=34469416

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay