Multiple choice technology testing

What can static analysis NOT find?

  1. The use of a variable before it has been defined

  2. Unreachable (dead) code

  3. Memory leaks

  4. Array bound violations

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Static analysis can detect coding issues like undefined variables, unreachable code, and array violations by examining source code structure. However, memory leaks are runtime behavioral issues that depend on execution patterns, resource allocation timing, and object lifecycle - these cannot be determined through static code examination alone. Memory leak detection requires runtime monitoring and profiling tools.

AI explanation

Static analysis inspects source code without running it, so it can catch structural issues like uninitialized variable use, dead code, and array bound violations by reasoning about the code's structure. Memory leaks, however, are a runtime phenomenon tied to actual allocation and deallocation behavior over time, so they typically require dynamic analysis (running the program and observing memory usage) to detect.