Ad
  • Default User Avatar
  • Default User Avatar

    A first step towards randomized tests could be to create an input set, which you could then let the test randomly choose from. I have myself no idea how to generate a valid magic square (but have a look at e.g. wikipedia).

  • Custom User Avatar

    Hi thanks for the feedback! Thats a very good point however I am slightly unsure how to create a random test generator? Obviously I need to randomly create the input and then compare the user solution to my own solution! However this being my first kata I am still learning and don't know how to do this yet? Can you point me in the right direction to anything that might help me write my random tests please?

  • Custom User Avatar

    Please, don't ever use Test.expect() without a customized error message upon failure. The default error message shown to the user when Test.expect() fails is "Value is not what was expected" which provides no useful feedback whatsoever for debugging. Even adding a simple message as "The 3 by 3 matrix [[1,1,1], [1,1,1], [1,1,1]] is not a magic square!" (upon failure) would be helpful.

  • Custom User Avatar

    Your Kata needs more extensive test coverage to prevent easy cheap-cheat solutions and/or logically flawed solutions. The most common way to increase test coverage is through the inclusion of randomly generated test cases at runtime so please add these. The lack of test coverage in a Kata as an Issue is recognised as an official CW stance.

  • Custom User Avatar

    Think about the fact that your counter is a global variable