Retired

Length of words (retired)

Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    It's not specified how to actually deal with non letters, until one enters the random test cases where this matters a lot.

  • donaldsebleung 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.

    • donaldsebleung Avatar

      And, please, add at least three more unique fixed tests before you even begin to add random tests. Although you do indeed have a lot of assertions due to the way that you are misusing Test.expect to compare two multidimensional arrays (see my suggestion below), it is apparent by reading your test cases that you only pass a total of 2 different strings to the user function which frankly isn't enough.

    • dlra Avatar

      Hi @donaldsebleung, thanks for the feedback

    • Voile Avatar
      Issue marked resolved by Voile 8 years ago
  • donaldsebleung Avatar

    Please, don't ever use Test.expect to compare any two values other than booleans - let alone multidimensional arrays! I spent about 10 minutes on this simple task simply because the feedback messages upon failure weren't informative at all and I had to constantly use console.log just to remotely get and idea of what was happening. For arrays, use Test.assertSimilar instead and for objects (which also works on arrays) use Test.assertDeepEquals instead.

  • smile67 Avatar

    Wow, always same input string (random tests with new same input - so 2 errors during tests), but different expected results - where's the trick;-)?

    : 432ms Passed: 28 Failed: 2
    Test Results:
     Log
     Input:A win is a win.
    ✔ Test Passed
     Log
     Input:A win is a win.
    ✘ Value is not what was expected
     Log
     Input:A win is a win.
    ✔ Test Passed
    
    • ZozoFouchtra Avatar

      I think tested value is not the returned array but each values of array, something like : Test.expect( arr[0][0] == 1 ) Test.expect( arr[0][1] == 1 ) ...and so on ; ) )

      EDIT: I confirm every returned values are individualy evaluated.

      Other than that if it can help ('cause it was not what I thought first) expected values are :

      [ [length_of_Word, number_of_words_of_this_length] , [other_length, ...] ... ]
      
      eg : "Hello Code world!" -> [ [4,1], [5,2] ] -> cause there is 1 word of 4 letters (Code) and 2 words of 5 letters (Hello & world)
      

      ; ) )

    • smile67 Avatar

      Hi and thanks;-)! Was too lazy to look deeper here... The description is unclear, the tests too, but now there's an issue reported too;-)...

      Question marked resolved by smile67 8 years ago
    • dlra Avatar

      Thanks for the feedback guys, some useful input

    • dlra Avatar

      Have added correct checking including random testing.

    • smile67 Avatar

      There are some mistakes in your random tests, look here:

      oQGV A 0Uq2qouf4t 0dry2F w cMygQSmA ACaKVqF X gHh 6 MAX3tIgbe6 llgWVMv T6b6k 2o45AtyIkY DA01BMd 1AH6Ww0 IkdFfSl2i pykHUYmGSs WIVuAT8e 0SucH6S yO TxwVZmgMnN Nh 
      ✘ Expected: '[[1, 3], [2, 2], [3, 2], [4, 3], [5, 2], [7, 6], [8, 2], [10, 2]]', instead got: '[[1, 3], [2, 2], [3, 2], [4, 3], [5, 2], [7, 5], [8, 3], [10, 2]]'
      

      For example [8,3] should be correct: cMygQSmA, MAX3tIgbe6= MAXtIgbe and IkdFfSl2i= IkdFfSli

    • dlra Avatar

      Hi @smile67, have removed a bug that I think was causing this problem.

    • smile67 Avatar

      Hi, seems to me that it works now;-)... thanks for fixing...