Will CodeChef provide test cases

No, providing the test cases restricts our thinking as in which condition our code will fail.

If you are really in a need of test cases generate it yourself. Write a script which will generate random test cases for your program and test your code and figure it yourself what should be the result of those cases.

This method will really help you a lot, also brainstorming for generating your own test cases will help you to develop a better understanding of failure situations.

Also remember usually our codes fails on edge cases so remember to run your code on randomly generated edge cases to test the result.

4 Likes

I don’t understand this reason! Just think of the situation when you have 150-200 or perhaps even bigger lines of code in your programme and you expect to sit for days to find a corner case! :frowning: Then why don’t Topcoder cover this so called “precious data”. If Codeforces and Topcoder can give the test cases then why don’t Codechef also give! :frowning: It is time to change this rule!!

5 Likes

i agree with nsghumman, if i have complete different algorithm then looking at someones’s code and editorial doesn’t help and after the contest is done there is no harm in revealing failed test cases.

2 Likes

Guys please provide the test cases it is very important to know where the code is failing…The thing about coding is that we learn about the mistakes we make and correct ourselves.Without knowing the test cases everyone is bound to make a mistake.The novice programmers don’t get a chance to correct themselves and make lots of mistakes in the future it is my sincere request that you provide the test cases where the code is failing at least in the practice section of the web site.That will make things much easier.

5 Likes

The site administrator is a dumb person. For 4 years people are telling but he doesn’t do anything. I think he doesn’t want to change anything good in his (stable) website. He doesn’t want to introduce any new thing and he doesn’t need to change because codechef is already an established site.

2 Likes

@admin we will highly appreciate it if you give us the test cases on which our code got WA for practice problem it will be a great help for all.thanks

5 Likes

I am really glad to see that codechef doesn’t reveal the hidden test case even in practice session. Definitely it is right that it will kill the curiosity of debugging your code more and more and make to generate random test cases again and again. Other sites provide test cases like hackerearth, hackerrank etc, but these one makes you dumb and doesn’t make you think more enough like in codechef! I still remember the time when i wasted the whole day for finding the one corner test case in which my code was failing!.. but at that time i really enjoyed very well!

2 Likes

I joined this site today looking forward to trying the problems, I find it deeply disappointing the totally inadequate attention paid to providing test cases. I have no interest in carefully generating masses of my own test data, hardly the point of this site, nor I’m interested in playing guess the bug. Having implemented many encryption algorithms myself the idea of doing this without proper test cases is laughable. I won’t be attempting any more problems here until this issue is addressed.

2 Likes

@grunch

Well, you must appreciate that every site has its own method and approach. Codechef’s is not providing the exact test cases, but it does provide every solution.

You may not appreciate it now, but guessing the bug yourself is very crucial in becoming a successful coder as you can give your code a new shade of accuracy with these skills.

Hope I put across my point clearly :slight_smile:

1 Like

Below is my code for this problem

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class SignLanguage
{

	public static void main(String[] args) throws Exception
	{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		PrintWriter pw =  new PrintWriter(System.out);
		
		int totalNumbers = Integer.parseInt(br.readLine());
		int number;
		String s;
		int i;
		
		while(totalNumbers-- > 0)
		{
			number = Integer.parseInt(br.readLine());
			s = br.readLine();
			char[] c = s.toCharArray();
						
			for (i = 0; i < number; i++)
			{
				if(c[i] == 'Y' || c[i] == 'I')
					break;
				
				if(c[number - 1] == 'N')
					break;
			}
			
			if(c[i] == 'Y')
			{
				pw.println("NOT INDIAN");
				
			}

			else if(c[i] == 'I')
			{
				pw.println("INDIAN");
				
			}
			
			else
			{
				pw.println("NOT SURE"); 
			}			
			
		} 
		pw.flush(); 
	}
}

This code works perfectly for the sample inputs given on the problem page but while executing it on the code chef Total Score as 0.00%.

There is no way to find for which testcase my code is failing as when tried with the sample testcase on the problem page it works perfectly fine.

Please advise what to do in such scenario and how to find where my code is going wrong.

@vipin16 bro I think codechef people are doing good by hiding test cases. It forces us to think about spoiler cases. If you want to learn by analysing the failed test cases better to practice on hackerrank and don’t say good bye to codechef just feel the signature taste of codechef.

plz tell me whats wrong with my code : CodeChef: Practical coding for everyone
I made solution according to problem ,it works for testcase displayed,but still wrong

I agree with you, that learning is easier with test cases, unfortunately almost no contest page shows test cases, thre are 2 exceptions that I know TopCoder and CodeForces.

3 Likes

@bhampton: There is a frame of reference. We reveal all the solutions of all the problems after the contest and the problems are also moved into the practice section for the users to try at leisure. And you can see other’s solutions too. Check this: http://www.codechef.com/submissions. Revealing test data is a spoiler and short cut to correcting your solution. Its the pursuit of finding the unknown that makes it exciting.

3 Likes

We can also have partial scoring test data on CodeChef. The online judge has the capability. But that does not yet convince us to reveal test data. Ad mentioned before, even in the practice section, we believe that revealing test data is a spoiler.

2 Likes

Even if we dont get partial scoring, providing just the detail like what was the status for each test file would be great help. It gives a hint if we are going totally wrong or somewhat in right direction.

If revealing test data is a spoiler then certainly revealing hundreds of examples of correct code is a spoiler!

It’s so frustrating to as few as one input example from the problem definition. What is one to do when one’s code seems correct but a simple “Wrong Answer” message is returned?

Google Code Jam gives you more test data for the “small” version of each problem. At least you get to try your code with some data.

This is really a dealbreaker for me. I like the CodeChef site and the amount of problems available, but it’s just too frustrating to get such small input sets. I’m moving on.

2 Likes

yea…this system is followed in codeforces

Not revealing failing test cases during contests is justifiable, However illogical if i’m solving problems from problem banks . Spoiler? How? After repeated failing if i’m not able to figure out theres no learning its just time spent to waste. As for editorials,LOOK-i have a completely different algorithm of my own and i want to know here i went wrong if i do-THAT’S LEARNING.“where you went wrong”-thats learning. Editorials are just a way to see the problem through somebody else’s mind and follow their algorithm and techniques. I don’t see it any different from copying others solutions.

39 Likes

BUT ATLEAST AT THE END OF THE CONTEST ,YOU CAN PROVIDE PROVIDE THE PARTICULAR TEST CASE WHERE A PARTICULAR CODE FAILS.THIS WILL HELP A LOT OF PROGRAMMER TO IDENTIFY THEIR MISTAKES INSTEAD OF LEARNING IT FROM EDITORIALS.

11 Likes