Ad
  • Custom User Avatar

    I should indeed be fixing my solution if it is incorrect. It's still not clear to me how a random test is going to help me identify an issue with my solution. The parameters I put into building valid random problems are going to be the same ones I use to build my deterministic tests. Specifically, the limits I place on the random numbers generated are the same limits I use for my edge cases.

    Anyway, I'll think about it a little more.

  • Custom User Avatar

    I'm really having trouble seeing the value of random tests, at least for this kata. Seems like they would be meant for testing my solution more than other folks', right? The implication is that there are classes of tests that are not covered by the existing (deterministic) tests and the random test might hit one such class of tests. Is that correct?

    Any insight appreciated.

  • Custom User Avatar

    yep... will keep adding. these are good ones.

  • Custom User Avatar

    assertEquals(true, sc.isSurreal("", "")); => should be false (that is... if you keep it... ;) )

    Is correct as written. In the def'n of surreal numbers, the empty set on either (or both) sides has special meaning. Note the definition of the form in the description... intersection is the empty set and all elements of L are less than all elements of R. Empty set on both sides satisfies this, but "1" on both sides does not. Empty set on both sides is extra special as it defines "0" in this number system (the first number that is possible to generate).

    So, I'm happy to keep the empty string to represent the empty set and follow rules of surreal numbers.

    Note that I had added the text:

    "One or both strings may be empty and in this case the form represents a valid surreal number and isSurreal should return true."

    prior to adding those tests.

    Hope this clarifies. Thanks again for the feedback.

  • Custom User Avatar

    Added max(L) == min(R) cases to tests.

    Added empty set ("") tests.

    Will leave this open until I get around to writing random tests.

    Any pointers to writing random tests? I have never written one. Assuming I have to generate reasoanble random strings of numbers, then use my solution as truth for the return value. Is that about it?

    Thanks.

  • Custom User Avatar

    Thanks for feedback. Will work on that.