3 ms·
> what's the point of asserting that add(2,2) will yield 4 if you've already been thinking about that You are probably thinking about unit tests here, and yes,
by marcosdumay 4y ago
> what's the point of asserting that add(2,2) will yield 4 if you've already been thinking about that
You are probably thinking about unit tests here, and yes, if it exercise a single point that you placed there by design, that test can only guarantee that somebody won't mess with it on the future.
On the other hand, I'm writing an interpreter in a side project, and the single most useful test there is literally and assert that eval("1 1 +") equals eval("2"). That is because it's not a unit test, and it touches a lot of different points. But for an outside observer, it looks exactly the same as a useless unit test.