|
|
|
|
|
by magicalhippo
435 days ago
|
|
While I agree testing in general is a must, I'm still not sold on unit testing as a general tool. For stuff like core libraries or say compilers, sure, unit tests are great. But for the levels above I'm leaning towards integration tests first, and then possibly add unit tests if needed. After all, you can't not have integration tests. No matter how perfect your Lego bricks are, you can still assemble them together the wrong way around. |
|
So shared functions get unit tested, but if there is a non shared function that gets triggered only from few layers up via user click, it is better to simulate that click and assert accordingly. However the exceptions are when the input can have tons of different permutations, when unit test might just become more optimal then.