4 ms·
> If you have many methods in a class with only one basis path, what purpose does the class serve. It ties together related algorithms. You want "addDays(n)",
by mdpopescu 9y ago
> If you have many methods in a class with only one basis path, what purpose does the class serve.
It ties together related algorithms. You want "addDays(n)", "addHours(n)", "addMinutes(n)" and so on to be in the same class, even if they're one-liners.
- pacaro 9y agoClearly there are good examples either way. I'm more interested in the idea that this strong mismatch between the complexity of the code and the complexity of its tests is, in itself, a code smell that may point to an issue that is nothing to do with TDD. I note that the examples you give have trivial test cases - presuming you don't care about overflow, and if you do, then those methods now have basis paths, whether explicit or implicit depends on the language.