- Understand how to complete a test log template
- Learn to design effective test cases
- Practice documenting test results
- Identify and record defects systematically
Test Log Template
In your exam, you will be given a test log template that looks like this:
| Description of test | Test data to be used (if required) | Expected outcome | Actual outcome | Comments and intended actions |
|---|---|---|---|---|
Understanding Each Column
1. Description of Test
A clear, concise description of what you are testing. This should relate to a specific requirement.
Examples:
- Test employee ID validation with correct length
- Test commission calculation
- Test bonus for 6 vehicles sold
- Test bonus for total value ≥ £135,000
- Test file output functionality
2. Test Data to be Used
The specific input values you will use for this test. Be precise and realistic.
Examples:
- Employee ID: "12345678"
- Number of vehicles: 3, Values: £20,000, £25,000, £30,000
- Number of vehicles: 6, Values: £20,000 each
- Number of vehicles: 5, Values: £30,000 each (total £150,000)
3. Expected Outcome
What should happen if the code works correctly. Calculate this manually based on requirements.
Examples:
- ID accepted, program continues
- Total value: £75,000, Commission: £3,750
- Bonus: £500 (for 6 vehicles)
- Bonus: £6,500 (£500 + 4% of £150,000)
- Summary saved to automotive_sales.txt
4. Actual Outcome
What actually happened when you ran the test. Be honest and specific.
Examples:
- ID rejected with error message (when it should be accepted)
- Total value: £30,000 (incorrect)
- Bonus: £500 (correct)
- Error: AttributeError - 'tuple' object has no attribute 'append'
- File not created
5. Comments and Intended Actions
If the test passed, simply write "Passed". If it failed, describe the problem and what needs fixing.
Examples:
- Passed
- Failed - validation logic is reversed. Change == to !=
- Failed - total calculation only stores last value. Change = to +=
- Failed - sales_list is tuple not list. Change () to []
- Failed - variable name mismatch. Change 'saes' to 'sales'
Example Test Log for T-Learn Automotives
| Description of test | Test data to be used | Expected outcome | Actual outcome | Comments and intended actions |
|---|---|---|---|---|
| Test program runs without syntax errors | N/A | Program starts and prompts for name | Error: AttributeError on line 28 | Failed - sales_list is tuple, not list. Change () to [] |
| Test valid employee ID (8 digits) | ID: "12345678" | ID accepted, program continues | Error message displayed, ID rejected | Failed - validation logic reversed. Change == to != |
| Test invalid employee ID (7 digits) | ID: "1234567" | Error message, prompt again | ID accepted (incorrect) | Failed - same issue as above |
| Test total value calculation | 3 vehicles: £20,000, £25,000, £30,000 | Total: £75,000 | Total: £30,000 | Failed - only last value stored. Change total = i to total += i |
| Test commission calculation (5%) | Total: £75,000 | Commission: £3,750 | Commission: £3,750 | Passed |
| Test bonus for exactly 6 vehicles | 6 vehicles: £20,000 each | Bonus: £500 | Bonus: £0 | Failed - condition should be >= not >. Change > to >= |
| Test bonus for 7 vehicles | 7 vehicles: £20,000 each | Bonus: £500 | Bonus: £500 | Passed |
| Test additional bonus for total ≥ £135,000 | 5 vehicles: £30,000 each (£150,000 total) | Bonus: £6,000 (4% of £150,000) | Bonus: £60,000 | Failed - calculating 40% not 4%. Change 0.4 to 0.04 |
| Test combined bonuses | 6 vehicles: £25,000 each (£150,000 total) | Bonus: £6,500 (£500 + £6,000) | Bonus: £6,500 | Passed |
| Test ID number displays in summary | ID: "12345678" | ID number: 12345678 | ID number: (blank) | Failed - missing variable in print. Add {}.format(id) |
| Test file output | Complete test run | Data saved to automotive_sales.txt | NameError: name 'sales' not defined | Failed - variable name mismatch. Change 'saes' to 'sales' |
Tips for Creating Effective Tests
Test data the specification asks for
In Task 2 your test log should identify test data across these types. Example for a rule "number of vehicles sold must be 1 to 20":
| Type | Meaning | Example |
|---|---|---|
| Valid | Normal data that should be accepted | 8 |
| Valid extreme | At the edge of the range and still accepted | 1 or 20 |
| Invalid | The right type but outside the rules, so rejected | 25 |
| Invalid extreme | Just outside the edge of the range, so rejected | 0 or 21 |
| Erroneous | The wrong type of data, so rejected | "eight" |
The specification also asks your annotated evidence to: identify the tests, describe each test's purpose, identify the test data, describe the expected results, describe the actual results, compare actual with expected, describe any further actions needed and show the system being refined.
Test Data Selection
- Use realistic values
- Make calculations easy to verify manually
- Test one thing at a time when possible
- Include tests that combine multiple features
- Document your test data clearly
Recording Results
- Be specific about what happened
- Include error messages exactly as shown
- Note line numbers if relevant
- Compare actual vs expected clearly
- If passed, just write "Passed" - don't over-explain
Documenting Actions
- Describe the fix clearly but concisely
- Reference the specific line or function
- Explain why the change fixes the problem
- Link back to the requirement if relevant
Unrealistic Test Data
A test might technically pass but use unrealistic data that doesn't reflect real-world scenarios. While the code may work correctly, these tests don't provide meaningful validation.
Examples of Unrealistic Tests:
| Test Description | Test Data | Why It's Unrealistic |
|---|---|---|
| Test bonus calculation | 50,000,000,000 vehicles sold in one day | Physically impossible - no dealership could sell 50 billion vehicles in a day |
| Test total value calculation | Vehicle price: £999,999,999,999 | No vehicle costs nearly a trillion pounds |
| Test commission calculation | Vehicle price: £0.01 | No vehicle costs 1 penny |
| Test employee name input | Name: "aaaaaaaaaaaaaaaaaaaaaa" (500 characters) | No real person has a 500-character name |
Why Realistic Test Data Matters:
- Validates real scenarios: Tests should reflect actual business use cases
- Catches practical issues: Unrealistic data might hide problems with data types or overflow
- Demonstrates understanding: Shows you understand the business context
- Exam marks: Examiners may deduct marks for completely unrealistic test data
What Makes Test Data Realistic?
- Vehicle prices between £5,000 - £100,000 (typical range)
- Number of vehicles sold: 1-20 per day (reasonable for one employee)
- Employee IDs that follow the specified format
- Names that are actual names, not random characters
- Dates that are current or recent, not year 3000
Common Mistakes to Avoid
- Not testing boundary conditions (e.g., exactly 6 vehicles)
- Using completely unrealistic test data (e.g., 50 billion vehicles)
- Vague descriptions ("Test the program works")
- Not calculating expected outcomes manually
- Forgetting to test all requirements
- Not documenting the fix clearly
- Testing multiple things in one test
- Not retesting after fixing
Best Practices
- Complete the test log as you test, not after
- Test systematically through each requirement
- Retest after each fix to confirm it works
- Keep your test log neat and professional
- Use the exact template provided in the exam
- Show your working for expected outcomes
- Be thorough but concise
Exam Tips
- Read all requirements carefully before starting
- Plan your tests to cover all requirements
- Test the code before fixing anything
- Fix errors one at a time
- Retest after each fix
- Save your work frequently
- Keep both original and fixed code
- Allow time to complete the test log properly