Ad
  • Custom User Avatar

    it's probably also a duplicate of another kata that teaches us about the use of streams in Java

  • Custom User Avatar

    Passing in streams and expecting streams back would be better. Oh wait, the result is an int, not a stream.

  • Custom User Avatar

    Thanks for your fast and constructive feedback. I appreciate it in a high manner.
    The odd numbers issue should be fixed now.
    In terms of enforce stream usage, do you suggest to pass or return a stream directly?
    Kind regards. Cheers!

  • Custom User Avatar

    Hi, some issues:

    • sum of odd numbers is not correct -> you don't take into account negative numbers
    • you don't enforce the use of streams (can you enforce it?)
  • Custom User Avatar

    I totally agree on the harcoded aspect. That's what's drives the TDD approach anyway. Finding a test that forces you to change the hardcoded solution.
    I appreciate your feedback and the time you spent to reply on my thoughts. Cheers!

  • Custom User Avatar

    I agree, fixed tests should be extensive enough to not allow incomplete solutions to pass. The need for random tests is to not allow hardcoded solutions to pass.

  • Custom User Avatar

    The guidelines of codewars recommend random tests. I had some random ones in my kata. So I thought that monadius pointing with his statement towards bad practice.
    In a real life setup the core test suite should consist of deterministic test cases. To test edge cases it is also widely recommended to use deterministic and meaningful
    values. Randomness is more common in black box testing. Other test strategies like using property basesd testing or even permutation testing could help to reveal bugs or gaps of the test suite. Failing tests of this kind should envolve into deterministic tests anyway and be part of the core test suite later. In some Katas I could already watch people struggling with given random tests cause of missing meaningfulness. I had this experience myself already. The effect might be that people pushing the attempt button as long as the test passes. Shure, in some cases TDD might force you to write a test with some random value (e.q. to extract a member). But even then a well named and deterministic test is the better choice. Please don't get me we wrong. This is what I have learned and experienced so far. And I am here to continuous improve and learn. I appreciate your feedback. Kind regards. Cheers!

  • Custom User Avatar
    1. What? You should add random tests, not remove them. Since when random tests are a bad practice?

    This kata was retired, but keep in mind that. Closing the issue.

  • Custom User Avatar
    1. -> It's kyu8 -> fundamentals -> e.q. Math class
    2. -> I know that random tests are bad practice (on the other hand used in a lot of katas here) -> I will remove the random ones
    3. -> So how many decimal places to you suggest?

    I appreciate your constructive feedback. I will be grateful for any help, cause it's my first own kata.
    Cheers!

  • Custom User Avatar
    1. The problem is trivial.
    2. No random tests.
    3. Approximate equality should be used to compare floating-point results.
  • Default User Avatar

    yeah sorry lol i was just experimenting with javadoc comments
    edit: also the description was kinda a joke it referenced "this" cuz i removed the this keywords it wasnt about anything else

  • Custom User Avatar

    Btw, I have made the variable names and method names clear to avoid adding comments.

  • Custom User Avatar
  • Custom User Avatar

    You got a point here. The aspect we often not intuitively think about, but we should care with high standards.
    Often voted best practices are not very explanatory at all. I have a lot to learn too. At the end of the day that's the reason why we are here. Share knowledge. I appreciate your commitment.

  • Custom User Avatar

    sort may not be better all the time. Go for readability and maintainability.

  • Loading more items...