Double-entry verification and test design
Code a double-entry check, choose test data that distinguishes boundaries and errors, and build readable programs that are easier to maintain.
Mapped to the Cambridge IGCSE Computer Science 0265 syllabus for exams in 2029. These original explanations and self-checks are independent study support, not Cambridge papers, official marks or grades. Practical programming is taught with worked code and trace tasks; an executable Python workspace and timed digital-exam simulation are not yet available.
Before you begin
- Use the 2029 syllabus for this course. Cambridge specifies Python 3.10 or higher for programming and digital exams for both components. The syllabus currently identifies this route for 2029 only; confirm later-year availability with Cambridge and your school.
Work on paper. Try each question before revealing help, and explain why your method works.
Quick readiness check
Before double-entry verification and test design, which statement is the safest starting point?
What you will learn
- Write Python code that compares two entries
- Choose normal, boundary and erroneous test data
- Use meaningful names, comments, subroutines and clear layout
Double entry compares independent entries
Verification checks whether data matches a source; it is different from validation, which checks whether data follows a rule. In double-entry verification, a user enters the same value twice and the program compares the entries.
A mismatch should trigger another attempt or a clear error message. Matching entries reduce some typing errors, but cannot prove that both entries are correct if the same mistake is repeated. A visual check compares the value directly with its source instead.
Tests need purpose and readable code
Normal test data exercises an ordinary valid case, boundary data tests values at or near limits, and erroneous data violates a rule. Select cases that exercise different branches and specify the expected result before running the test.
Meaningful identifiers explain the role of values; comments clarify non-obvious decisions; procedures and functions keep repeated work in one place; consistent layout makes block structure visible. Maintainability improves when future changes can be made without breaking unrelated code.
Pause and explain
Which habit best checks your understanding of double-entry verification and test design?
Worked example
Write a double-entry check for a new username.
Show the worked solution
- Read username and confirmation as text.
- Compare them with ==.
- Repeat while they differ and give a clear prompt.
Answer username = input("Username: ") confirm = input("Re-enter username: ") while username != confirm: print("Entries do not match") confirm = input("Re-enter username: ")
Try a topic test
Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.
Test this topic →From guided practice to a new situation
Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.
Write Python that asks for an email twice and prints 'Match' only when the entries are identical.
Give me a hint
Compare the two input strings and branch on equality.
Compare my reasoning
- Read the first email.
- Read the confirmation.
- Use if email == confirm to print 'Match'; otherwise report a mismatch.
email = input("Email: ") confirm = input("Re-enter email: ") if email == confirm: print("Match") else: print("Mismatch")
Look for these in your work
- Both entries read
- Equality checked
- Both outcomes handled
A valid file size is from 1 to 500 inclusive. Give one normal, two boundary and two erroneous values.
Give me a hint
Test both valid endpoints and just-outside values.
Compare my reasoning
- Normal example: 125.
- Boundaries: 1 and 500.
- Erroneous examples: 0 and 501.
Normal 125; boundaries 1, 500; erroneous 0, 501.
Look for these in your work
- Normal valid case
- Both endpoints
- Both outside cases
A repeated input routine appears in four places. Explain how a function and meaningful identifiers could improve maintainability.
Give me a hint
Focus on reuse and making data purpose clear.
Compare my reasoning
- Move the repeated logic into one function.
- Use names such as validate_email rather than x.
- Fixes can then be made once and called consistently at each location.
A clearly named function removes duplication and makes future updates safer.
Look for these in your work
- Reusable routine
- Meaningful name
- Maintenance benefit
Common mistakes
- Calling matching entries proof that a value is true.
- Choosing only valid mid-range test data.
- Using comments to restate every line instead of clarifying intent.
What can you explain now?
Can double-entry verification detect a typo if the same typo is entered twice?
Compare with the explanation
No
The two entries match even though both may be wrong.
After trying it yourself, choose your next review. This is your self-assessment.
Your review choice appears on Today. Sign in to sync it across devices.
Make it stick
How are verification and validation different, and how do test cases and readable code reduce errors?
If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.