Although sometimes this is true, most of the time you can't pass all the test because you have written a messed up code that you yourself can't understand. Learning to write the simplest code that works first time one of the most critical skills in programming and in real life also there are no test cases written for you.