Small Group Tutorials

Here to help students catch up, keep up, and move ahead. Book a consultation here.

What Is the SEAB MOE G3 Computing Syllabus? | My Child Can Trace the Code. Which Test Will Explain a Wrong Result?

Escalator at Punggol Coast Mall and connecting pedestrian bridges towards the SIT campus.

A teenager can follow every instruction in a program, correctly predict that it will print 2 and still be unable to explain why the answer should be 3. In G3 Computing, tracing means working out what the instructions actually do. Debugging also requires an independent idea of what they ought to do. For the 2027 Singapore-Cambridge Secondary Education Certificate (SEC), school candidates taking G3 Computing sit syllabus K349. Testing a proposed explanation is a skill families can practise on paper before opening a laptop.

Start with a real choice. If a music-practice counter misses a streak, did it reject a day with exactly ten minutes of practice, or did it forget to count a streak that continued to the end of the list? Give your child a pencil and ask them to invent a small input that would produce different answers under those two explanations. That question reveals more about their understanding than asking them to read the same six lines a little faster.

  • Agree what the output means and work out one expected answer by hand.
  • Keep the wrong result. It gives you a case to explain and reuse after a correction.
  • When two explanations fit, pick an input for which they make different predictions.
  • After a change, try a case that already worked as well as the original failure.
  • For K349, the written paper covers all five modules. The lab-based paper assesses programming and spreadsheets.

Where does debugging fit into the G3 Computing syllabus?

Contents · Next section

Imagine two students finishing the same class exercise. One writes the correct answer on sight. The other spots that the provided example passes even when an important part of the rule is missing. Both have noticed something, but the second student has asked a question that will matter the next time the data change. MOE’s G3 Computing curriculum includes algorithm design, testing and debugging. SEAB’s 2027 syllabus expects students to trace code, investigate unexpected behaviour and select test cases. MOE’s G3 Computing teaching syllabus and SEAB’s K349 syllabus, pages 7–9

2027 school-candidate paper What students do Duration, marks and weight
Paper 1, written Answer compulsory questions across computing fundamentals, algorithms and programming, spreadsheets, networking and the impact of computing. 2 hours, 80 marks, 60%
Paper 2, lab-based Complete one spreadsheet question and four to five programming questions. All are compulsory. 2 hours 30 minutes, 70 marks, 40%

The lab computer provides spreadsheet software, Python and JupyterLab. A Python quick reference is supplied. Students save and submit their work electronically, and the time for saving it is included in the paper. At home, a dry run with pencil and paper can reveal exactly where understanding breaks down. At school, the student also needs experience making and checking an actual change in the working environment. SEAB’s K349 assessment scheme, pages 3–5

To interpret a low school mark, first ask what the student had to produce. Did they have to predict an output, explain a condition, build a program or repair one? “He struggles with Python” can cover all four. If he traced the code correctly but chose a test that told him nothing new, he already has a skill worth keeping. The next job is designing a question for the program to answer. That skill also matters in spreadsheets, where a formula can calculate a quite plausible number for the wrong group of cells.

What exactly is the music-practice program supposed to count?

Previous section · Contents · Next section

Here is an original practice exercise. A student records one whole number for each day, in calendar order. The number is how many minutes they practised music. A day with ten minutes or more qualifies. The program should report the longest uninterrupted run of qualifying days. A zero means a recorded day with no practice. All inputs in this exercise are non-negative whole numbers. If the list is empty or no day qualifies, the answer is zero.

Work through this six-day list aloud before reading any code: 15, 12, 0, 10, 11, 13. The first two days form a run of two. The zero breaks it. The last three days form a run of three. The answer is three days. Five days qualify altogether, thirteen minutes were recorded on the last day and fifteen minutes was the longest individual session. Those numbers answer sensible questions, but the person who specified the program asked for the longest run of days.

Give your teenager six small pieces of paper, one number on each, and slide the zero along the row. If the zero comes first, the five remaining cards form a single run. If it sits between the second and third qualifying days, the longest run is three. The amount of practice over the week is identical. The answer changes because the position of the break matters. This makes a good home conversation for a parent who has never written a line of Python.

Now choose a case where ordinary shortcuts would give the right answer by coincidence. On the list 12, 14, 16, the total number of qualifying days, the length of the last run and the length of the longest run are all three. A program which counts all qualifying days looks excellent on that particular input. The input has an easy expected result, but it provides little evidence about how the program treats a break. Ask your child what one extra card they would put into the row to reveal the difference.

For an assessment question, the wording decides what is required. If the rule were “more than ten minutes”, a day of exactly ten would fail to qualify. If the program were supposed to report the current streak, an earlier longer streak might be irrelevant. Ask the student to underline the phrases that settle those decisions. A neat trace cannot repair an answer to a different problem.

What do the two variables remember?

Previous section · Contents · Next section

Here is the deliberately faulty practice program. It runs and prints 2 for the six-day example. Read its indentation as part of its meaning. The lines beneath the alternative branch run only when that day falls short of the threshold.

def longest_streak(daily_minutes):
    current_run = 0
    longest_run = 0
    for minutes in daily_minutes:
        if minutes >= 10:
            current_run += 1
        else:
            if current_run > longest_run:
                longest_run = current_run
            current_run = 0
    return longest_run

print(longest_streak([15, 12, 0, 10, 11, 13]))

Give the variables informal names while talking. One is “how many consecutive days I’m on just now”. The other is “the longest run I have put on record”. They can hold different numbers for a good reason. A previous record of four can survive a poor practice day, even though the current run drops back to zero. The important question is when a run becomes eligible to go on record. The faulty program waits for a day below the threshold before comparing the two values.

Day just processed Minutes Current run Longest run stored
Before day 1 — 0 0
Day 1 15 1 0
Day 2 12 2 0
Day 3 0 0 2
Day 4 10 1 2
Day 5 11 2 2
Day 6 13 3 2

Read day 3 carefully. The program first compares the previous current run of two with the record of zero. It stores two and only then clears the current run. A child who writes zero in both columns may have reset the run too early in their head. Ask them to cover the reset line and read only the comparison above it. Then uncover the reset. That correction addresses tracing, before you ask them to debug anything.

At the bottom of the table the number three already exists. The program has counted the last three qualifying days correctly, including the day with exactly ten minutes. Its return instruction reads the variable holding two. This is a much narrower description of the problem than “the loop is wrong”. A sensible question to ask next is when the last run would have been compared with the stored record. The answer is that the loop reached the end of the list before another low-practice day could trigger the comparison.

Two children can now have the same correct trace and need different conversations. One may think a program should automatically return whichever variable contains the largest value. Invite them to point to the name after the return instruction. Another may understand the return perfectly but suggest changing it to the current run. Keep that suggestion. It works on this particular six-day case, and the next exercise shows whether it works in general.

Which test tells two possible causes apart?

Previous section · Contents · Next section

Before showing the faulty code to a second learner, tell them only the result. On 15, 12, 0, 10, 11, 13 the program reports two. The learner suspects the ten-minute day was left out. A friend suspects the final streak was never entered into the record. Both stories fit the observed answer. Repeating the same test will confirm the same symptom. To choose between these stories we need a case on which they predict different outputs.

Pick 10, 11, 13, 0. The zero closes the three-day run. Under the first explanation, a program otherwise following the rule would count only 11 and 13, giving two. Under the second, it treats ten correctly and reaches a break, giving three. The faulty program above returns three. We have learnt something quite precise. It can count an exact ten in this position. Blaming the comparison with ten no longer fits the evidence from this case.

Try 11, 12, 13. No value is near the disputed threshold. Under the first explanation all three days qualify and a correct ending would report three. Under the second explanation the run reaches the end with no chance to be registered, so the program returns zero. The faulty program returns zero. At this point the two actual results line up with the missing final comparison. We can inspect the lines responsible with a clear idea of what we expect to find.

Input Expected by the stated rule If only exact tens were wrongly excluded If only the last unfinished run were left out
15, 12, 0, 10, 11, 13 3 2 2
10, 11, 13, 0 3 2 3
11, 12, 13 3 3 0

These predictions describe two specific explanations, each taken on its own. A program with several mistakes could produce a different pattern. For a parent, the revealing moment comes before the child presses Run. Can they say, “If I see two, that supports this explanation. If I see three, that supports the other one”? A three-day test can expose a mistake that a week of practice times hides.

Can your teenager design the shortest list that distinguishes the two explanations? One day of eleven minutes is enough. A program that mishandles only exact tens would return one. A program that forgets the open run at the end would return zero. One day of exactly ten serves another purpose, because both faulty versions would return zero. A boundary value is valuable when it answers the question you are investigating.

Which correction still works when the longest run comes first?

Previous section · Contents · Next section

One possible correction is to let the loop finish exactly as written, then compare the remaining current run with the record once more before returning. Replace the single return line with these lines inside the function, aligned with the start of the loop. The assignment beneath the new condition is indented one level further.

    if current_run > longest_run:
        longest_run = current_run
    return longest_run

Look at the six-day example again. When the loop ends, the current run is three and the stored record is two. The comparison stores three, then the return passes three back to the caller. If the week ends on a low-practice day, the current run is zero and a previous record survives. If the list is empty, both variables have their original value of zero. The correction therefore also has a sensible meaning when there are no data to process.

Return to the student’s suggestion to replace the return value with the current run. Try the practice record 14, 15, 16, 0, 12. The longest streak is three, achieved before the zero. The current streak when the list ends is just one. Returning the current run would solve the first visible failure and introduce a wrong answer here. Resist the temptation to call it a silly suggestion. It was reasonable given the one case the student had seen. Their new test has shown exactly what the suggestion overlooks.

Another sound design is to update the record as soon as a qualifying day makes the current run larger than the previous record. Then even a run lasting right up to the last day has already been counted. A child who proposes this can explain a slightly different meaning for the stored value: after every processed day it is the longest streak seen anywhere so far. Ask them to show where the update belongs in their design and what happens on a low day. They need only implement one coherent correction.

A useful explanation of either repair has three parts. The student can name the event the old program waited for, say why it might never arrive and show when the new program saves the last streak. An output of 3 alone leaves you guessing how well the correction works on a different input.

What checks should survive the repair?

Previous section · Contents · Next section

Keep a short record with the input, the expected result and what the program actually returned. Write the expected result before you run it. This protects against a peculiar effect familiar to teachers: once a plausible number appears on a screen, it can become difficult to remember what the task originally asked. The parent can be the person who works out the answer with the paper cards, while the student runs the test and explains any difference.

Practice record Expected longest streak Why this example earns its place
An empty list 0 Checks the rule when there are no days.
0, 9, 1 0 Covers several recorded days with no qualifying practice.
10 1 Requires the boundary day and the final day to count.
12, 13, 0, 11 2 The longest run finishes before the list ends.
11, 0, 12, 13 2 The longest run finishes on the last day.
10, 11, 0, 13, 12 2 Two different runs tie for the longest length.

Some of the checks look almost too easy. A single day of ten minutes, for example, is a poor test for distinguishing the two original explanations because both produce zero. Yet it is an excellent check to keep after a repair. Getting one now shows that the repaired program handles both the inclusive threshold and the end of the list in that example. The purpose of a test can change during an investigation.

Ask what should happen if we append a zero to any valid record. A new day without practice cannot increase the longest qualifying run. It also cannot erase a previous run. The correct output must stay the same. The faulty program returns zero on 11, 12, 13 and three on 11, 12, 13, 0. That change is curious even without knowing the expected three in advance. A student who thinks of this question has found a way to test the meaning of the program, beyond repeating a known example.

K349 includes normal, boundary and erroneous test data. This particular function assumes it receives a list of non-negative whole numbers. If a larger application asks someone to type minutes, it may need a separate rule for a negative entry, a blank or free text. Agree what the input stage should do before deciding its expected response. A blank entry and a genuine recorded zero can mean quite different things to a music student. SEAB’s testing and debugging outcomes, page 8

Does the same thinking work in a spreadsheet?

Previous section · Contents · Next section

Give your child a different situation. A school fair has three sessions selling programmes. Prices appear in column A, quantities in column B, and column C should show the revenue for each session. In row 2 a programme costs $2 and the team sells three, so the correct revenue is $6. In row 3 the price is $3 and the team sells four, so the correct revenue is $12. A pupil enters a formula in C2, copies it down and sees $6 followed by $8. The first answer tells us surprisingly little about the second.

Before viewing the formulas, ask for two possible causes. The pupil may have typed the second price incorrectly in A3. Or the formula may still be pointing to the first price after it was copied. If the displayed data in A3 are indeed 3, inspect the formula in C3. Suppose it reads =$A$2*B3. It is using the quantity from row 3 and the fixed price in A2. That accounts exactly for $8. The first result passed because the fixed price happened to be the right price for the first row.

What small test would show whether the price reference is genuinely fixed? In a practice copy, change A2 from 2 to 5 and leave A3 at 3. The correct second revenue should still be $12. If the flawed second revenue jumps from $8 to $20, the result reveals a dependency on a price from another row. Now restore the practice values. Here each session has its own price. Copying =A2*B2 from C2 to C3 should move both references to row 3. Check the displayed formula and the newly calculated totals.

A fixed reference is perfectly useful under another specification. If every session sells at one price and a single cell holds that price, keeping that reference fixed makes sense. Something similar happened in the music example. The current run is the correct value for “How long is my current streak?” and the wrong one for “What is my longest streak?” The same piece of code or formula takes its meaning from the task.

At the end of the spreadsheet exercise, ask your child to invent two rows for which the flawed and corrected formulas would happen to agree. If the prices in both rows are identical, the difference in reference may be invisible in the outputs. The student is starting to recognise when apparently good results are weak evidence. That skill is directly relevant to K349, which includes choosing cell references that continue to work when a formula is copied. SEAB’s spreadsheet learning outcomes, page 10

What if my teenager only sees the error after I point to the line?

Previous section · Contents · Next section

Try offering less information at each stage. First give the task and the failing input, then ask for a correct answer worked out away from the computer. If they can produce it, ask which number the program would have to remember to get that answer. If they cannot yet say, trace a smaller input together. Only show a line to inspect after you know whether the problem lies in understanding the task or following the code.

A student who follows the values but hesitates to suggest a cause may fear that a wrong guess will count against them. Offer two pencil columns headed “If I’m right…” and “If I’m wrong…”. Let them predict what a small test would show. Discovering that a guess was wrong has done useful work when the result rules it out. They can cross it out and keep the reason beside it. A page full of changed code with no remembered reason is much harder to learn from.

For a student who enjoys editing quickly, agree to one change and a prediction before each run. For a student who hesitates to touch working code, use a separate copy of a short practice program. They can compare the two versions and restore the original at any point. When working in a notebook, make sure the cell defining the function ran after the edit and before the cell that calls it. Seeing an old result after changing a line can otherwise send a careful student looking for an error they have already repaired.

Keep a separate unassisted example for a later day. Imagine eight theatre seats in a row marked occupied or free. The organiser wants the length of the longest block of adjacent free seats. Ask the student to invent a seating arrangement where counting all the free seats would give the wrong answer, then a different arrangement where reporting only the final block would fail. For a stronger learner, ask whether one arrangement could expose both shortcuts at once. Three adjacent free seats, one occupied seat and one final free seat would do it. The correct longest block is three, the total free seats is four and the final block is one.

Is this a reason to reconsider Computing or get extra help?

Previous section · Contents · Related guides

One difficult debugging exercise is a narrow sample of a broad subject. A Secondary 2 child considering G3 Computing might enjoy reasoning about the seat puzzle even before they know Python syntax. A Secondary 4 student can know plenty of syntax and still need regular opportunities to test their own decisions against results. Ask the teacher how the child is managing independent programming, spreadsheet reasoning and written concepts across several pieces of work. For a family in Punggol, the child’s school option sheet and current subject briefing are the starting points for what is actually available. eduKate Punggol’s G3 Computing subject-choice guide

Take one concrete question to a parent-teacher conversation. “She traced the music example correctly but returned the current run as soon as she saw it held three. Which kinds of tests would help her check a proposed correction in a fresh task?” That question gives the teacher somewhere to begin. If the child is already accurate with dry runs but struggles in a timed lab, ask about working habits such as testing small pieces and checking the saved file. If they cannot yet say what the program should do, return to the task wording and a hand-worked example.

At home, agree on a modest measure of progress. On the next unfamiliar exercise, can your teenager choose an input that exposes a mistaken interpretation? Can they explain why another input would let that same mistake pass? A child who can answer either question has begun to think beyond the trace. If the difficulty persists, look for teaching that lets the student make those decisions, try them and explain the evidence in their own words. eduKate Punggol’s related guide to backtracking from an unexpected output

Close with a question. “If I put one more non-practice day at the end, what ought to stay the same?” When your child can say why the record must survive, invent a case to check it and recognise a result that contradicts it, they have taken a meaningful step from reading code to repairing it.

Continue from here: Start Here · Tuition · Education · Pathways · Parenting 101 · All Site Routes

eduKate Punggol

Contact

83 Punggol Central, Singapore 828761

edu|Kate Bukit Timah

8 Fourth Avenue, Singapore 268674

By Appointment +65 8823 1234
admin@edukatesg.com

Email Us

When a child finally understands, school becomes less frightening and the future opens wider. Email us for the latest schedules and fees.

← 返回

感谢您的回复。 ✨