Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thanks for taking the time to answer. I'm a newcomer at Codewars so I probably need to tune in with the philosophy. That said, I don't understand why people would want to cheat the solutions (maybe to show a "strong" profile in a job interview?). In the end they are lying to themselves.
Nothing better than delegating on the standard libraries! ;)
Reading the first post I don't get that. About all you said, I agree too, fixed tests should be complete including edge case tests and random tests should be used only to avoid hardcoding solutions.
If what you said was the OP's intent, then asking for better fixed tests should have been there instead of asking for random tests being forbidden or justified.
What I take from OPs complaint is that "main" tests should be fixed tests, which should fail an incorrect solution consistently and repeatably, and potential issues with user solution should be found by fixed tests and not only by random tests. If this is what the OP means, then I completely agree. In many, many kata, and I think that it's a general authoring practice, fixed tests are neglected and all testing of coverage, and of edge cases, is expected to be done by random tests. Tests which, in turn, are often not even designed with coverage in mind, just spray a bunch of random data around hoping to hit something .
Codewars needs random tests mainly to prevent hardcoding. Random tests can also serve as a replacement for property-based random testing, sure. But in vast amount of cases it's neither. It's usually just three lousy fixed tests and a random spray which is hoped to be as complete as possible, but in practice it might, or might not, verify correctness of a user solution, depending on a random chance. And even if it does find problems with a user solution, it's done in a way which is not always helpful. Whenever possible, it should not be only random tests which fail when a solution is wrong.
Sorry but I don't see your point against random tests, if your code is fine, it should pass them with no problem. Do random test cover all possibilities? No, they don't, they sometimes generate edge cases, and those should be part of fixed tests too to ensure good tests coverage. About repeatability, read Madjosz answer, it tells you how you can repeat a random test your code failed. Also read this: https://docs.codewars.com/training/troubleshooting#print-input
Without random tests all katas could be solved with if/else, do you think that would be fine?
OK, I know this is not strict unit testing, but using random data to validate solutions might leave room for incompleteness (either the solution or the validation code).
Fraud can come in a wide variety of forms (copy-pasting from other sites, hardcoding results, AI generated solutions...). Should the katas codebase quality be impacted because of this?
Regulatory measures should be separated from the kata's logic. Otherwise, in the long run, the code base will be formed with (in this case) a lot of non-repeatable tests (which, IMHO, is not very high-quality code, so to say :) ).
Perhaps users should have the means to mark other's solutions as "hardcoded", with an impact on "honor".
Random tests are there so you can't hardcode your solution. For repeatability you have fixed tests.
Random tests defeat one of the main purposes of testing: repeatability. Codewars should forbid use of random tests (unless VERY well justified). In this specific kata I don't see the justification at all.