Scenario-Based Problem Solving · Lesson 3 of 3
Evaluation
Evaluate correctness against each requirement, efficiency for the expected input size and maintainability for future changes. Include invalid and boundary cases. Explain concrete evidence rather than merely stating that the solution is good.
By the end, you can
- Check correctness.
- Check efficiency where appropriate.
- Check maintainability.
- Check that edge cases and invalid inputs are considered.
Solution quality
Evaluating a solution means judging it against four things, and a good evaluation gives evidence for each rather than an opinion.
Correctness comes first: does it produce the right output for normal data, reject abnormal data with a message, and behave properly at the boundaries? The evidence is a test table with the data, the expected result and the actual result. Anything that fails is stated, not hidden.
Robustness is whether it survives the unexpected: text typed where a number was wanted, an empty input, a file that is not there, a list with no items, a division whose divisor could be zero. A program that crashes on any of these is not finished, and each is a case worth naming.
Efficiency matters where the data is large. Reading a file once into an array rather than reopening it inside a loop, ending a search as soon as the item is found, and avoiding a nested loop where a single one would do are the realistic improvements at this level. Micro-optimisation of a program that handles twenty items is not worth mentioning.
Maintainability is whether someone else could change it: meaningful names, constants instead of bare numbers, sensible decomposition, comments that explain why, and consistent layout.
A complete evaluation says what the solution does well, what it does not handle, what would be improved with more time, and how the improvement would be tested. Naming a genuine limitation is worth more than claiming there are none.
Worth remembering
- Correctness with evidence, robustness against the unexpected, efficiency, maintainability.
- Name what fails and what is not handled rather than claiming it is perfect.
- Say what you would improve and how you would test the improvement.
Worked example
A correct linear search may be sufficient for a short unsorted list; a more complicated method is not automatically a better choice.
Practice
Warm-up · not marked
Check your understanding
Answer in your own words, then compare with the worked answer. Nothing here is saved or scored.
Worked answer
A trace or test result matching a predicted output, and a requirement-by-requirement check showing all specified cases are handled.
Check your method, units and explanation against it.
Marked practice
Set 1 of 4 · easiest first · Checked as you go, with the worked answer. Sign in or create a free account to save your progress.