Ad
  • Custom User Avatar

    Well, if you're going to test the statistical properties of a random distribution, of course you'll need statistical methods to do this. Average and standard deviation are the basic. For more advanced ones you'll need to know the expected distribution and compare it with that (after sampling lots of runs, of course, otherwise the error would be too big).

  • Default User Avatar

    That is what the user is inherently doing. The issue seems to be to how to accurately write a
    nUnit test to test the accuracy of the created distribution. My simpleton unit tests only checked
    for minimum and maximum bounds of the return value.

  • Custom User Avatar

    The simplest way would be to have the user write a function that returns a distribution rather than a sample.

  • Default User Avatar

    Good point. However, how would you write a unit test to test a gaussian (normal) distribution?
    I would be very intested in seeing your approach using nUnit.
    Would you be willing to share?

  • Custom User Avatar

    If your tests doesn't enforce your requirement, the tests have failed to do what they ought to do, and so it's the kata author's fault for writing such tests.

    By the same logic, I can make a kata that tells people to solve a NP-hard problem, and then put a few trivial tests that does not test anything.

  • Default User Avatar

    Thanks for the message.
    What do you mean by distribution? Statistical distribution.
    It is NOT required to solve this Kata as the statistical distribution is
    acheived by correctly solving the Kata and passing the unit tests.

  • Custom User Avatar

    You're not even checking the distribution of the return value.