News for hackers. Stuff that matters.
Re:Is TDD Dead? (2014) by fiddlerwoaroof on Wednesday August 26, 2020 @11:44AM (#24283492)
Isn’t the point that internal functions often have a much smaller state space than external functions, so it’s often easier to be sure that the edge cases of the internal functions are covered than that the edge cases of the external function are covered?

So, having detailed tests of internal functions will generally improve the chances that your test will catch a regression.

Re:Is TDD Dead? (2014) by marcosdumay on Wednesday August 26, 2020 @12:26PM (#24284017)
> Isn’t the point that internal functions often have a much smaller state space than external functions

That's the general theory, and why people recommend unit tests instead of only the broader possible integration tests. But things are not that simple.

Interfaces do not only add data, they add constraints too. And constraints reduce your state space. You will want to cut your software over the smallest possible interface complexity you can find and test those, those pieces are what people originally called "unities". You don't want to test any high-complexity interface, those tests will harm development and almost never give you any useful information.

It's not even rare that your unities are composed of vertical cuts through your software, so you'll end up with only integration tests.

The good news is that this kind of partition is also optimal for understanding and writing code, so people have been practicing it for ages.

Re:Is TDD Dead? (2014) by bmh100 on Wednesday August 26, 2020 @01:13PM (#24284581)
I agree that they would help in the regression testing process, especially in diagnosing the cause. However, I think those are usually just called "unit" tests, not "regression" tests. For instance, the internal implementation of a feature might change, requiring a new, internal unit test. The regression test would be used to compare the output of the new implementation of the feature versus the old implementation of the feature.
Re:Is TDD Dead? (2014) by ska on Wednesday August 26, 2020 @12:09PM (#24283808)
Having regression tests greatly improves your chances of catching a regression.