CSC 216 F09/debugRace

From Expertiza_Wiki
Jump to navigation Jump to search

Concept

Helps programmers grasp an idea of how debugging in Eclipse works.

Materials

A minimum of two groups, of which each group is to assign:

  • 1 Programmer
  • 1 Breakpoint
  • and the rest as Function
  • Flash cards for each round (a single method written on each card):

Round 1

int methodA(int a,int b,int c){
  return b*b;
}
int methodB(int a,int b,int c){
  return 4*a*b;
}

(The correct statement should be "return 4*a*c;")

int methodC(int a,int b,int c){
  return methodA(a,b,c) + methodB(a,b,c);
}

(The correct statement should be "return methodA(a,b,c) - methodB(a,b,c);")

Program

  int a = 1;
  int b = 4;
  int c = 4;

  int output = methodC(a,b,c);

  assertEquals(methodC,0);

How to Play

The game consists of 3 rounds, 1 buggy set of code per round.

For a team win the round, the team must complete debugging the set of code for that round. for example:

  • The first round can be on code that give incorrect output (due to wrong equations. See above section).
  • The second round can be on code that give incorrect output (due to data type mistakes (float<->int)).
  • The third round can be on code that give runtime errors (divide by zero exceptions and the like).
  1. The Programmer is the leader of the group, where he/she feeds an input to the Functions.
  2. The Functions compute the input and returns an output to the Programmer.
  3. If the output is not what was expected, the Programmer then sets the Breakpoint between Functions.
  4. The Programmer feeds in the same input into the Functions, but this time the Functions stops computing where the Breakpoint was set. In which case the Breakpoint then tells what the last output was.
  5. The Programmer will then identify incorrect mistakes if possible. Then reruns the program.
  6. Repeat until final output is what was expected.

The points are rewarded based on the order which the teams finish each round. 5 points for first place, 4 points for second, 3 for third, ...and so on where 0 points are rewarded for 5th and later.

However, the last round counts down from 10 points (10 for first place and down from there).

Acknowledgements

This exercise was created by Adam McConnell, Niko Nikas, Minori Ohashi