/en-tutor-prep-s4-ict-debugging-version-control-practice-2/
/en-tutor-prep-s4-ict-debugging-version-control-practice-2/
General Inquiry: info@TutorZone.com.hk
Office Hours: Monday to Saturday - 9:00 AM to 6:00 PM
WhatsApp Monday to Sunday - 24 hours
Hotline: +852 6828 1809
Instant Support: +852 9061 3106

S4 ICT: debugging and version control (intermediate)

S4 ICT: debugging and version control (intermediate)

  • 2026-11-20

S4 ICT: debugging and version control (intermediate)

Second paper: bisect hunting, line coverage and regression pass rates, version number bumps, the cost multiple of late fixes and merge conflicts.

Intermediate: bisect, coverage and version numbers The intermediate level manages debugging with numbers. Bisect tests the middle version, so 1024 commits need 10 tests. Line coverage of 195 out of 250 is 78 percent, and 6 failures in 240 regression tests leave a 97.5 percent pass rate. Each part of a version number has a job: 2.4.1 becomes 2.4.2 for a fix and 1.9.9 becomes 1.10.0 for a feature, because versions are not decimals. A production fix costs 100 times a development fix, and five defects of three hours each split between two developers round up to 8 hours.

01 Paper details (check answers afterwards)

Item Detail
Questions 10
Suggested time 25
Difficulty mix Foundation 4 · Intermediate 2 · Challenge 2 · Error redo 2
Chapter Chapter: S4 ICT: Debugging and version control
Level Intermediate (10 items)

02 Questions (10 items)

  1. FoundationUsing git bisect across 1024 commits to find one bad version, how many tests are needed at most?
  2. FoundationA module has 250 lines and the tests execute 195 of them. What is the line coverage?
  3. FoundationA regression suite has 240 tests and 6 fail after a change. What is the pass rate?
  4. FoundationVersion 2.4.1 gets a defect fix with no new feature. What is the new version number?
  5. IntermediateVersion 1.9.9 gains a new feature without breaking the old interface. What is the new version number?
  6. IntermediateFixing one defect costs 100 in development and 10,000 in production. How many times more expensive is production?
  7. ChallengeThree branches each edit the same configuration file. What appears at merge time and how is it handled?
  8. ChallengeFive defects take 3 hours each to fix and two developers work in parallel. What is the minimum time?
  9. Error redoIs it true that git reset and git revert do the same thing?
  10. Error redoIs it true that one hundred percent test coverage means the program has no defects?

03 Answers and one-line notes

# Answer One-line note
1 Ten, because 2 to the power 10 is 1024 and each test halves the range. Bisect turns a linear search into a logarithmic one, and the saving grows with the number of commits.
2 Seventy-eight percent, since 195 over 250 is 0.78. Line coverage only records execution, so it does not prove every branch was exercised.
3 Ninety-seven point five percent: 240 minus 6 is 234, and 234 over 240 is 0.975. Each of the 6 failures must be traced to either broken code or an outdated test.
4 2.4.2, because a fix only raises the third number, the patch level. The three parts mean major, minor and patch, and that meaning stays fixed.
5 1.10.0: the minor number rises and the patch resets to zero, and since versions are not decimals 1.10.0 is newer than 1.9.9. Reading a version number as a decimal wrongly makes 1.9.9 look larger than 1.10.0.
6 One hundred times, since 10,000 over 100 is 100. Earlier detection is cheaper, which is why testing shifts left rather than waiting for users to report.
7 A merge conflict: the file must be resolved section by section, the conflict markers removed, and the result committed. A conflict means both sides changed the same line; it is not a broken program, and resolution needs human judgement.
8 Eight hours: 15 hours of work divided by 2 is 7.5, rounded up to 8. People cannot be split into half-hour fragments, so the time rounds up.
9 No. Reset moves the branch pointer and rewrites local history, while revert adds a new inverse commit and keeps history, which suits pushed versions. Pushed history should not be forced with reset, or everyone else inherits the conflict.
10 No. Coverage only shows that each line ran, not that the result was right, so missing checks and wrong formulas survive full coverage. Coverage is a floor, and correct answers plus boundary cases depend on how the tests were designed.

04 What to do after marking

  • After marking, redo only the wrong items and write down which step went wrong (formula, unit, or misread number).
  • Repeat the same item two days later; move to the next paper only when both attempts are correct.
  • Parents only need the answer and note columns; there is no need to explain every item.

Want syntax, runtime and logic errors clearly separated, plus bisect debugging, commits and version numbers understood? Book a TutorZone tutor and settle the whole debugging and version control workflow in twenty-five minutes of ten items.Tutor Registration →

Questions and answers are written originally by the TutorZone team and are not taken from any school, publisher or examination authority paper. Every value is checked by computer.

Join as a tutor or coach — academic, music, sports, arts, STEM. Free to register. See how it works →