2 ms·
I 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 th
by kypro 3y ago
I 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.