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.


Correct Option: C
Explanation:

To answer this question, the user needs to have a basic understanding of static analysis and its limitations.

Static analysis is a technique for analyzing software without executing it. The technique involves examining the program's source code and/or binary code to identify potential errors, security vulnerabilities, and other issues.

Static analysis can help find many types of issues in software, but it also has limitations. Here are the explanations for each option:

A. The use of a variable before it has been defined: Static analysis can detect the use of a variable before it has been defined. This is because static analysis examines the code to identify potential issues before the code is executed.

B. Unreachable (“dead”) code: Static analysis can detect unreachable ("dead") code. This is because it examines the code to identify code paths that will never be executed.

C. Memory leaks: Static analysis can detect potential memory leaks in some cases, but it cannot detect all memory leaks. This is because some memory leaks are caused by runtime behavior that cannot be detected through static analysis.

D. Array bound violations: Static analysis can detect potential array bound violations, but it cannot always detect all violations. This is because some array bounds are determined at runtime and can only be detected through dynamic analysis.

Therefore, the correct answer is:

The Answer is: C. Memory leaks.

Find more quizzes: