Recently, I've gone through Uncle Bob's bowling scoring kata a couple times (http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata), and... I'm extremely disappointed with his solution. There are two big issues I have with his solution that I would like some feedback on.
Problem 1 (TDD): The third and fourth tests are garbage.
The way I understand it, and the way I've practiced it, when you're doing TDD, you make your test pass with the simplest possible code, and if the simplest code to make a test pass is some very stupid code, then you need to either write a better test or write more tests. For his third test to test spares (and he does the same thing for strikes), he is testing the scoring of spares by making a game where the first two frames are [5,5][3,0] with the remaining frames being all zeroes. He proceeds to take this and go on to write the code for scoring spares, but... the simplest code to solve this is "if roll == 3 then score += 3." Now, that's some dumb code, and you don't want to actually put that in, but that doesn't mean you just ignore it and go on to write the code you're trying to get to. It means you stop and write a better test, whether that means making a more complex game with multiple spares or whatever other thing you might have. Am I missing something here?
Problem 2 (OOD): How is it that he never breaks out a Frame class?
When I look at the Game class, and I see that all 5 of its private methods are passed in the exact same thing, a reference to every other roll (the start of a frame), it seems very straightforward to me that a Frame class needs to be broken out. The Frame just needs to be given its rolls and told about the next Frame, then it can return a score, which the Game class can then sum.
So... what am I missing here that makes these things actually make sense?