What is the test pyramid vs the testing trophy?

Answer

The Testing Pyramid (Martin Fowler, Mike Cohn): many unit tests at the base, fewer integration tests in the middle, very few E2E tests at the top. Emphasizes unit tests as the foundation. The Testing Trophy (Kent C. Dodds, popularized in the JavaScript/React community): static analysis at the base, fewer unit tests, a wide middle layer of integration tests, and a small top layer of E2E tests. Key insight: "Write tests. Not too many. Mostly integration." The trophy argues that integration tests (which test components working together) provide more confidence per test than pure unit tests (which may over-mock and test implementation details). Pure unit tests with extensive mocking can give false confidence and break on refactoring that doesn't change behavior. The right balance depends on the project: backend business logic → emphasize unit tests (clear units of work); frontend/API → integration tests give better confidence (test the whole request lifecycle). Both agree: too many E2E tests = slow, brittle pipeline.