Ad
  • Custom User Avatar

    Nice and quite intuitive kata to have some fun with.

  • Custom User Avatar

    Thanks, I adjusted tests and solution

  • Custom User Avatar

    In this kata, we consider that the hour hand immediately jumps to its next position at each new hour; for instance, it remains at 10 o'clock from 10:00 to 10:59 and then moves to 11 o'clock at 11:00.

    Oh dear this is strange. I've never seen a wall clock to work like this.

    [...] "12:5"

    ...nor like this.

  • Custom User Avatar
  • Custom User Avatar

    I can remove round from tests and solution, however what exactly wrong with rounding results?

  • Custom User Avatar

    Don't round float results!

  • Custom User Avatar
  • Custom User Avatar

    approval time then :)

  • Custom User Avatar
  • Default User Avatar

    Fixed test error messages are wrong and inconsistent.

    The first error message says the initial number is 7 but it is -7. Tests 2 and 5 only provide the results and not the initial conditions.

  • Custom User Avatar

    Okay so I re-read the description more carefully and I see that I initially misunderstood the task. I thought that it's just another case of "spray randomly to get any useful inputs". I'm sorry for the confusion!

  • Custom User Avatar

    If out of 100 tests only 20 tests test anything

    All 100 tests are testing something though, lopsided distribution or not; even if 80% of the tests are returning 0, you still have to solve the problem (or one of its subproblems, including, granted, more trivial ones like contradictions between must_avoid and must_include) to know which ones do.

    I think monadius's suggestion is a good, practical way to improve the random tests though. There are probably other properties that could be used to generate random tests with a nonzero result but that's a kata in itself. The test suite could also just run a reference solution against the randomly generated params and discard all above a certain quota that result in zeros, but I'm not convinced there's value in that.

    EDIT: Annnnd the point is moot.

  • Custom User Avatar

    Slightly chaged tests, so they should be better now
    Half of them (150) are completly random and half have non-zero solution. Also must_include and must_avoid don't intersect now

  • Custom User Avatar

    The problem is that it is difficult to generate meaningful tests (I don't know how to do that without increasing target_num). So the easiest strategy is to generate many of them and hope that some tests will be good enough to catch incorrect solutions. I also don't see any potential mistakes which can be undetected by current tests.

    I propose to increase the number of random tests to 300 and also generate non-overlapping must_avoid and must_include (it does not help a lot but it removes trivial tests).

  • Custom User Avatar

    If out of 100 tests only 20 tests test anything, then how many of them test something interesting? With only 20 effective tests, it's possible that solutions which have a hole in one place, or another, or another one, will never get detected.

    Another thing is that if you think that 20 tests is enough, then why have 100 of them? Just... run 20 tests. Is there really a need to run 80 no-tests?

  • Loading more items...