-what kind of errors we can introduce in our test codes like only syntactical,logical,or both..also out of many other possible errors.
I'd go for some of each type, they each test a different skill.
-
How to make sure that after the code gets debugged it
is still is doing w
hat it was meant
to do (
I realise
that this
could b
e done using sample input cases.
But ho
w to decide the input cases)
.
Typos I can handle, but that looks like you're to lazy to even type out full words.
Well, if you want to give them what the out(?)put should look like, it's easy enough. Write a program, get your output, put in your errors.
Or else, just look at their final answer, see if it's a logical progression from the original. If you give them and they give you it looks pretty right to me. If instead they give you
Code:
printf("Hello World!");
that's wrong, and they get 0.
-in case two ppl debug the code in same time how to decide which one has done it in a better way?
Which is shorter, which is faster, or just give them both the same mark.
-can we introduce optimisation issues and if yes how in real scenario.
If you want to, it's your test. An example
Code:
if(x == 4 || x == 5)
{
if(x == 4) //something
if(x == 5) //something
if(x == 6) //something
}
if(x == 4 || x == 5 || x == 6) //something else
It's a crappy example, but it should be easy enough to come up with something better.
Some ideas might be sorting algorithms, prime number generation, whatever, maybe some variations so they just don't copy down something they remembered from elsewhere.
-how to frame questions.(taking an already existing codes and going in reverse way by introducing some errors or in some other better way..??)
That would probably be the easiest way, it gives you a definate end-point, what the code should look like and do. Remember to go through all the questions though, see if you can end up with something else.