# New Feature - WA Test cases

We have introduced a new feature on Practice for debugging your code. Whenever you get a WA, you can now click on ‘Debug my code’ and get the smallest test case where your code fails.

Why?

1. One of the most common requests is to understand the test case where their code is failing.
2. However, providing the test file is not of much use given the size of a typical test file and the way in which a test file is structured. Each test file can contain thousands of test cases. Eventually the user still has to identify the specific test case. And a code may fail on multiple test cases within a test file.
3. What is most helpful is to find the smallest test case where the code fails - since this can be interpreted by the user and the code can be fixed accordingly.

How to use?

1. Once you ‘Submit’ your code in Practice, if you get a WA, you will find the box ‘Debug my code’

2. Once you click on ‘Debug my code’ the system will fetch the smallest test case where the code fails, and display it as follows

1. This feature is currently live for a total of 1772 problems and for the programming languages C / C++14 / C++17 / Python 3.6 / Java / PyPy 3.
– This feature is ONLY for WA. It will not show up for other verdicts like TLE, RTE, Compilation error, etc.
– This feature will be live for problems in future contests immediately after the contest ends.
– We will gradually make this feature live for older problems and more programming languages. Currently the languages above cover 99%+ of the submissions on the platform
– This is currently not live for problems for problems with custom judges. Will get some of these fixed in the later iterations.

2. It will currently take approximately 5 - 10 seconds for the system to find the specific test case where your code fails.

3. Given that this is under our beta phase - we sincerely request you to report your feedback / any issues on this thread.

4. Currently, the ‘Debug my code’ feature is free for all users. At some stage, we will migrate this to our list of premium features to support and sustain the platform.

110 Likes

Nice Feature

5 Likes

Should be a thing in long contests. IMO this will make it easier for some people to get into CP

13 Likes

This feature will be very very helpful. Because sometimes it becomes very hard to find out that where our code is failing but the sample test cases gets correct output and we often waste a lot of time in constructing the test case where our code might fail. This feature is going to save a lot of time for sure…

6 Likes

17 Likes

WOW! I like this feature.
It’s a go feature for beginners

3 Likes

I really needed this feature, this saves time.

1 Like

Nice Feature.
It will be helpful for beginners to understand their mistake.

3 Likes

Cool feature, but I doubt if it works for some problems. Anyways, People will now stop spamming discussion forums when they get \text{WA} verdicts.

Edit: I tried to find a test case for which a solution fails a long time ago. Here’s the link: BURGER - Editorial - #22 by suman_18733097

I couldn’t find it even after a stress test for about 5 minutes. Your feature got it in 10 seconds . Awesome work .

7 Likes

This should always be free. Codeforces provide quality materials completely for free. Such platforms are a community where everyone helps each other, not some money-making machine. They have sponsors and even if they fall short then they can open a donation box where everyone can contribute.

9 Likes

That is one cool feature

Nice Feature,
It will save a lot of time,
but there is a bad or negative thing also such as participants may not think deeply about that problem if they get the expected output of that problem.

1 Like

Cool Feature !!

3 Likes

Yes

Much awaited feature
Thanks Chef

3 Likes

Good for newbies while struggling for finding testcase.

Running something for free is not always a feasible option. In the end, there are a lot of people working to run the platform who should be paid for their work.

2 Likes

Not working for recent contest problem.
UPD: Solution: 67954442 | CodeChef
Please help me with this. Feature can’t find a testcase where the solution fails , neither can I. If that’s not the case I think solution should be correct.

Consider this test case:

STDIN

1
9 2
8 6
8 2


Expected Output

7
4


7