3 ms·
Most of the code I have written in the last years has been request response centered. For these I find integration tests to be the best testing strategy. I'll a
by hkon 3y ago
Most of the code I have written in the last years has been request response centered. For these I find integration tests to be the best testing strategy. I'll add the occasional unit test for logic heavy operations.
- kypro 3y agoI think the real value in unit tests isn't validating your logic is accurate (although sometimes it is for logic heavy methods as you say), but in validating that subsequent changes (often made by other devs) don't break prior logic. In complex codebases it's easy to miss things when making changes and unit tests are great ways to catch issues in really simple bits of logic that have just later been overlooked. Integration tests are typically so heavy and multivariable they can only be used to validate the most common scenarios. They're great sanity checks, but provide terrible coverage whenever there exists nuanced logic.