News for hackers. Stuff that matters.
Re:Even Tetris is hard to test by nawitus on Sunday October 26, 2014 @10:16AM (#8511058)
On the other hand, you can "hide" the different code paths in a single algebraic statement, but even if your tests always execute that statement, you've lost information that you've actually tested the both "paths" of the algebraic statement.

I guess it's easier to use a boolean logic example (in JavaScript):

return myNormalObject || myDefaultObject();

Your code might always execute the myNormalObject half and return it, and even though your code coverage is 100% of the lines, your tests might miss myDefaultObject() code path.

Perhaps some code coverage tools can take this into consideration, though, but then you're back to the original problem..

Re:Even Tetris is hard to test by BrandonM on Sunday October 26, 2014 @05:15PM (#8512470)
That's not arithmetic, though. That's logic represented as a one-liner... Not the sort of change I'm talking about.
Re:Even Tetris is hard to test by judk on Monday October 27, 2014 @11:26AM (#8516029)
Most real world problems need extra logic attached to each case of the conceptually simple arithmetic.

All of coloring is just arithmetic, after all, but is rather complex