When a computational solution is developed, it must be evaluated against a set of criteria to ensure it is fit for purpose. The key evaluation metrics are efficiency, clarity, correctness, scalability, robustness, and the processes of verification and validation.
Efficiency refers to how well a solution utilises available resources — primarily CPU time and memory (RAM) — to complete a task.
| Complexity | Description | Example |
|---|---|---|
| Constant — does not grow with input | Array index lookup | |
| Logarithmic — very efficient | Binary search | |
| Linear — grows proportionally | Linear search | |
| Quadratic — grows rapidly | Bubble sort |
An algorithm with time complexity is generally more efficient than one with .
Clarity (also called readability or maintainability) refers to how easy it is for a programmer to read, understand, and modify the code.
A clear solution:
Clarity is critical for long-term maintenance and team collaboration.
Correctness means the solution produces the right output for all valid inputs and handles edge cases appropriately.
A solution is correct if:
Correctness is verified through testing and formal verification.
Scalability is the ability of a solution to handle an increasing workload (more users, more data) without a significant drop in performance.
Robustness is the ability of a system to cope with errors during execution and handle erroneous or unexpected input gracefully, without crashing.
Examples of robust behaviour:
These two processes are often confused but serve distinct purposes:
| Verification | Validation | |
|---|---|---|
| Question asked | Are we building the product right? | Are we building the right product? |
| Focus | Meets technical specifications | Meets user/client needs |
| Method | Code reviews, walkthroughs, static analysis | User testing, acceptance testing |
| When | During development | At the end of development |
Example: A calculator app that correctly implements all specified formulas passes verification. If the client actually needed a currency converter, it fails validation.
| Metric | Key Question |
|---|---|
| Efficiency | Does it use minimal time and memory? |
| Clarity | Is the code readable and maintainable? |
| Correctness | Does it produce the right output? |
| Scalability | Can it handle growth? |
| Robustness | Does it handle errors gracefully? |
| Verification | Is it built according to specifications? |
| Validation | Does it solve the right problem? |