Please read the new rule regarding the restriction on the use of AI tools. ×

sundar_svks's blog

By sundar_svks, 12 years ago, In English

I am a new to contest websites. I solved some problems before. But still I didnt get any confidence, Because I am just checking my solution by posting the code to codeforces practice section. I don't know how to test my solutions. I know one of my colleague who is solving contest problems.He is also just trying by submitting the code. while submitting the code, if my solution is failed, then I will enable flag based on the inputs/outputs. Based on this flag, I will print logs, So that only for the failure problematic scenario, my print logs will be printed. This is how I am testing. But Still sometimes i wont get what is the input scenario or problematic region. with this approach, I am not learning anything new.

I am interested to know how other people are testing their solution before submission.

How to overcome the scenario:

Once the contest is over, problem tester can post the input data for the problem in codeforces site for practice section. if it is not possible, then we have another way.

I strongly feel that for any problem, tester will prepare some test case description for

problems, the tester also should post the testcase description once the contest is over. This will gives more understanding for the missing testcases to the coders and coders also can improve their knowledge on testcases...

Please share your thoughts on how you will test your code and prepare testcases for the code
  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
»
12 years ago, # |
Rev. 2   Vote: I like it +7 Vote: I do not like it

I don't khow how others test their solutions, but I test this way :

  1. Egde tests. Like null, empty strings, maxtests, etc.
  2. My tests, which I checked on paper or something, when developing a solution.
  3. And some random tests, just to check for RE or TLE.
»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You can write some helpers for genereate tests and simply use them during contests (for gen random/ maxtest). This is very useful.