Test a Web Application Systematically
Design unit, integration, and user-focused tests for a small web application and its critical workflows.
Explanation
Testing provides evidence about software behavior; it does not prove that a system has no defects. Different test levels isolate logic, verify component interaction, and evaluate complete user workflows.
Students identify risks in a login-and-enrollment workflow, create representative test cases, and automate one small unit test. They record expected outcomes before running the tests.
Learning activities
- Identify high-risk behaviors in a workflow.
- Create normal, boundary, and failure test cases.
- Automate one unit test and explain its scope.
Code example
php
function isPassing(float $grade): bool {
return $grade >= 75.0;
}
assert(isPassing(75.0));
assert(!isPassing(74.99));Knowledge check
1. What does a boundary test examine?
- Behavior near a limit
- Only page colors
- Network cable length
Show answer
Behavior near a limit