Ad
  • Custom User Avatar

    Frank,
    Thanks for the response. I don't think the Kata is that bad on its own. But I guess if you were trying to create the Kata for an exercise in TDD with dependency injection, then yeah, injecting a random number generator might not be the best way to go. It might make more since for something like a craps simulator, where you can just use the randomly generated result as the value shown by the dice. Anyway, thanks for creating Kata for the rest of us!

  • Default User Avatar

    Hi Lawnboy!

    I stop explaining anything about this kata. Nothing personal, but if you really had read my responses than you should already have known that I don't consider this kata a good kata.

    Feel free though to respond to all of my 13 other kata's! Those I am proud of... :D

    Cheers,

    Frank

  • Custom User Avatar

    I'm reading all the responses to the complaints about the first few tests and I think the responses miss the point. Test Driven Development is about starting with tests that represent the requirements. The requirement that the random number returned by the generator be used as the return value is an implementation detail. But to go further, unless I'm too dense to see it, it's not even possible to implement the solution that way. Random number generators won't exclude a value once it's been used, so you have to come up with some other way to use the random numbers generated to even solve the problem. For example, if the random number generator returns 50, there is a non-zero probability that it will return 50 again before you have selected all 75 numbers. So you can't just return the random number as the result. In my implementation, these tests only pass because they only test the first number returned. In order to get them to pass, I had to jump through a hoop that was totally irrelevant to the requirements. Am I missing something?