Skip to content

b. Test Your Knowledge

Activity A - Multiple-Choice Review (1 mark each)

(Recall-style, Section A format)

1. Which naming convention uses underscores between words?

A. Camel case

B. Hungarian notation

C. Snake case

D. Pascal case

Answer

C. Snake case


2. Which type of comment is most useful?

A. A comment that repeats exactly what the next line of code says

B. A comment that explains why a complex section of logic was used

C. A comment made only to fill empty lines

D. A comment that replaces testing

Answer

B. A comment that explains why a complex section of logic was used


3. Which testing idea compares what should happen with what actually happened?

A. Naming convention

B. Expected and actual results

C. Scope statement

D. IPO chart

Answer

B. Expected and actual results


4. Which debugging technique pauses execution at a chosen line?

A. Boundary value

B. Breakpoint

C. Flowchart

D. Range check

Answer

B. Breakpoint


5. Which type of error occurs when code runs but produces the wrong result?

A. Syntax error

B. Runtime error

C. Logic error

D. Formatting error

Answer

C. Logic error


Activity B - Short Answer Practice (2-4 marks each)

(Section B format - active recall)

1. Explain one reason why meaningful naming conventions improve maintainability.


2. Describe one difference between a useful comment and a poor comment.


3. Explain why boundary values are important in testing.


4. Distinguish between syntax, runtime and logic errors.


5. Explain one advantage of using a breakpoint.


6. Describe one situation where a debugging statement could help.


Activity C - Scenario Application (3-6 marks each)

(Section C style - applied retrieval)

Scenario 1 - Age checker testing

A program only accepts an age between 15 and 17 inclusive.

Tasks:

  1. Suggest two appropriate boundary test values.
  2. Explain why each is useful.
  3. State what the expected result should be for each.

Scenario 2 - Poorly documented code

A student writes the following:

int x = 3;
double y = 7.50;
double z = x * y;
Console.WriteLine(z);

Tasks:

  1. Explain one naming problem.
  2. Explain one comment or documentation improvement that could help.
  3. Describe one way this code could be made easier to maintain.

Activity D - Extended Response (6-8 marks)

(Analytical / evaluation task)

Prompt:

Discuss why readable code, testing and debugging are all necessary parts of creating a quality software solution.

In your response, refer to:

  • naming conventions
  • internal documentation
  • test data and expected results
  • at least one debugging technique