3.1 Static Testing Versus Dynamic Testing
Key Takeaways
- Static testing evaluates work products without executing the software under test.
- Dynamic testing executes software and observes failures that may reveal underlying defects.
- Static and dynamic testing complement each other because each exposes different defect types.
- Static testing can start early, including during requirements, design, user story, and code review work.
- CTFL questions often test whether a defect is found directly or inferred from a runtime failure.
Execution Is the Main Divider
Static testing examines a work product without running the software under test. A team may review a user story, inspect source code, analyze a model, or check a test case for missing coverage. The object being tested may be executable code, but execution is not part of the technique.
Dynamic testing requires execution. A tester supplies inputs, observes outputs or behavior, and compares actual results with expected results. If the software crashes, returns the wrong value, or violates a performance target, dynamic testing has revealed a failure. The defect that caused the failure still has to be investigated.
| Point of comparison | Static testing | Dynamic testing |
|---|---|---|
| Software execution | Not required | Required |
| Typical objects | Requirements, stories, code, models, tests, plans | Executable software or system components |
| Main evidence | Anomalies, review comments, analysis findings | Failures, logs, outputs, measured behavior |
| Timing | Can start very early | Starts when something executable exists |
| Quality characteristics | Readability, consistency, completeness, maintainability | Functional behavior, performance, reliability in operation |
A common CTFL trap is to assume that static testing is only document review. Static testing includes reviews and static analysis. A tool can scan source code for unreachable code, duplicated logic, high complexity, or certain security weaknesses before a test case is ever run.
Another trap is to treat static testing as a replacement for dynamic testing. Static testing can find an ambiguous acceptance criterion, a missing interface parameter, or a path in code that is never reachable. Dynamic testing can still reveal integration behavior, timing problems, environmental issues, and user-visible failures that are hard to infer from reading alone.
Static testing usually finds defects directly. For example, a reviewer sees that a requirement contradicts another requirement. Dynamic testing usually exposes failures first. If a login screen accepts an expired password, the tester observes the incorrect behavior and then debugging locates the defect.
Exam questions often include words such as early, executable, failure, defect, and work product. If the scenario happens before execution or involves reading and analyzing a product, think static. If the scenario depends on running the software and checking actual behavior, think dynamic.
A reviewer notices that two requirements describe different timeout values for the same session behavior. Which statement best classifies this finding?
Which statements correctly compare static and dynamic testing? Select all that apply.
Select all that apply