News for hackers. Stuff that matters.
Re:Unit Testing is Overrated (2020) by AstralStorm on Thursday April 07, 2022 @07:43AM (#30943195)
Hence why you need automated integration tests, where possible. Especially for regressions.

They tend to have much higher value than pure unit tests.

Re:Unit Testing is Overrated (2020) by rectang on Thursday April 07, 2022 @11:21AM (#30945633)
I agree that automated integration tests typically offer higher ROI than equivalent unit tests written with mocks, because mock code is so difficult to write and fragile.

I disagree with your assertion that integration tests offer higher value than unit tests in general. Don't judge all unit tests by mock code.

Re:Unit Testing is Overrated (2020) by larkost on Thursday April 07, 2022 @07:23PM (#30951532)
I will counter that integration tests tend to have a much bigger footprint: one test covers a lot more ground and so per line of code will catch more things.

But, the failures from integration tests are often a lot harder to read. Even half-good unit tests tend to show exactly where the error is, and make the fix cycle much shorter. It is also much harder to write exhaustive integration tests for all of the inputs that might happen.

I, as a long-term qa-ish person (I usually write testing systems) see real value in having a mixture of both system, integration (multiple systems), and unit tests, as well as end-to-end manual tests. Anything big enough needs all of these.

Re:Unit Testing is Overrated (2020) by oxff on Saturday April 09, 2022 @02:46AM (#30965755)
If errors from your integration tests are hard to understand, that just means you need to improve the debugging information emitted by your software such that your developer can debug it properly using it, no?
Re:Unit Testing is Overrated (2020) by cush on Thursday April 07, 2022 @10:34PM (#30952728)
This is the point. Both are tools. They're both needed.