3 ms·
After many years of experience, I agree. Tests are a business investment, of tech resources, to create business value. It's good to focus on the Testing Pyram
by john-tells-all 4y ago
After many years of experience, I agree.
Tests are a business investment, of tech resources, to create business value.
It's good to focus on the Testing Pyramid [1]. High level tests are slow and brittle, but connect the low-level code to business features. Unit tests are fast and detail oriented.
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. Unit tests are helpful to "smooth the path forward" to ensure the code works as expected. Integration tests are great to iterate on, so that new code and tests actually work with real APIs correctly.
Tests are not free. However they create a lot of value -- they create (business and tech) confidence that the system is working as expected. Like you mentioned they assist refactoring, which makes the code much cheaper and easier to work with.
[1] https://martinfowler.com/articles/practical-test-pyramid.html https://martinfowler.com/articles/practical-test-pyramid.htm...
(disclaimer: writing a book about tech feedback loops, e.g. tests)