Retired

Validate NIF (retired)

Description
Loading description...
View
AllIssues2Questions2SuggestionsShow Resolved
  • Please sign in or sign up to leave a comment.
  • Blind4Basics Avatar

    Hi,

    A fixed tests with a number of digits different of 8 but everything else consistent is missing. Currently, the tests with wrong lengths can be spotted using other requierments.

    Cheers

    • Unnamed Avatar

      According to the description, this input isn't even valid:

      Given an string of exactly 8 digits and 1 letter, in that order

    • ToniFeliu Avatar

      You are right, I removed 'of exactly 8 digits and 1 letter' from the sentence. Thank you.

    • ToniFeliu Avatar

      Hi @Blinf4Basics, I added those extra cases. Thank you!

    • Blind4Basics Avatar

      nope, not good: this should pass the fixed tests (btw, if you're the one who upvoted my shitty solution, please remove the vote: I totally messed up the last part (see the initial fork of the solution for a correct approach)

    • ToniFeliu Avatar

      I'm trying to understand your solution and I think it assumes the given string 'nif' is always going to be 8 numbers and 1 letter, which was correct because the description I wrote in the first place said that, my bad. Now I have changed the description and some test cases so that you have to validate the length. I added cases where letters are inserted between the digits. Also, added cases with lowercase letters. Maybe I'm wrong again.

      I did'nt upvote your solution but I will upvote your fork since I learned the unpackage thingy which seems so useful :)

    • Blind4Basics Avatar

      yeah, that's it. And to make it fail, you need an input that satisfies all other criteria. For instance, something like this:

          test.assert_equals(nif_validation('3A'), False)
      
    • ToniFeliu Avatar

      Makes sense, I have added fixed ones. I will be adding random ones of those too asap. Thank you so much for the feedback, it's my first time creating a kata or tests in general (outside of very simple college activities) an this is truly helping me understand what good tests are. ^^

    • ToniFeliu Avatar

      Random cases added too.

      Issue marked resolved by ToniFeliu 16 months ago
    • yrprth Avatar

      My solution passed tests but it doesn't check length. Probably it will be good to add tests for something like valid NIF + letters/digits/etc e.g. '49921020A1D'

    • ToniFeliu Avatar

      Hey, I was sometimes checking those cases on the random cases but not always were generated since it needed to highroll lol. I have added fixed cases to make it functional by now but I will refactor the entire random tests generation to make sure it works there too 100% of the times.

      Thank you!

    • ToniFeliu Avatar

      Hi @Blind4Basics, may I know the exact reason the kata was retired? Just so that I can improve next time. Was it the poor tests, was the kata concept itself? Apart from that, was'nt the kata retired too fast? I mean, is the first kata I try to release, but I tried my best to be working on its fixes and I was thinking about refactoring the entire tests this weekend, free of college, but not even 48 hours past before it was retired. I feel like I needed more feedback about how much time I had to fix it + what can I improve.

      Thank you.

    • Blind4Basics Avatar

      Hi,

      In the present case, the retirement comes from a rule saying that if the kata requires more than X very satisfied votes in a row to reach approval state (iirc, X=10), it's just retired. The odds are really low that approval will ever happen in such situtation, and the kata would acutally just linger in beta state forever.

      So, in the end, quality was correct, interest was at least average, but it suffered from its early days mistakes, and probably the fact the idea is very close to Luhn algorithm (but simplified), meaning it probably gave a "meh/déjà-vu" vibe to the beta testers.

      Your kata might also have been just a bit out of luck: it didn't get 2 simultaneously active issues, which are automatically pushing the kata back into draft and forbid new completions (hence, votes) until it's fixed and republished. But again, I think the general idea behind the task was its main problem (imo, at least).

      Cheers

  • HerrWert Avatar

    Why does "T" occur twice in the list-which-is-actually-a-tuple? And why is there a comma after the second occurrence of "T" in that tuple?

    • ToniFeliu Avatar

      Hey, I used the word 'list' to refer to list as a concept, not the python keyword, I don't even use tuple or list in my solution, but instead an string version of it. I thought it would look more clear if I separated the chars with comas and parenthesis on the markdown, bad decision. The 'T' and the comma was a mistake. I will fix all things, thank you for the feedback.

  • rowcased Avatar

    No Sample Tests

  • JohanWiltink Avatar

    this list: ("T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E","T",)

    Did you just reinvent the String here? Would "TRWAGMYFPDXBNJZSQVHLCKET" work just as well?

    • ToniFeliu Avatar

      Hey, I'm using String in my solution, I just thought it would look more clear on description, bad decision. I will fix it so that it looks more clear. Thank you for the feedback.