ISTQB-ATTA practice question 8 of 15
A developer has spent three days looking at a system that crashes now and then. The problem was caused by two coding faults: i. A variable was being used but had not been defined; ii. There was a ‘goto’ statement to an undefined label 1 credit [K2]
Full set: 65 questionsThe two faults described, using an undefined variable and a goto statement to an undefined label, are structural defects in the source code. A static analysis tool examines the code without executing it and is specifically designed to find such issues. It analyzes control flow and data flow to identify anomalies like unreachable code, violations of programming standards, and variables used before initialization. This allows for the detection and correction of these faults before the code is ever run, preventing the type of runtime crashes described in the scenario.
B. Code coverage tool: This tool measures which parts of the code were executed during testing; it does not directly find defects.
C. Dynamic analysis tool: This tool finds defects during program execution (e.g., memory leaks). While it would detect the crash, it wouldn't find the underlying static code fault as efficiently as a static analysis tool.
D. Test execution tool: This tool automates the running of tests and reporting of results. It does not analyze the code for structural faults. ---
1. ISTQB Advanced Level Technical Test Analyst Syllabus (Version 3.1.1
2021):
Section 2.2.1
"Static Analysis by Tools
" page 13: This section explicitly states that static analysis tools can find "Programming defects (e.g.
variables with undefined values)" and "Programming standard violations (e.g.
unreachable code
security vulnerabilities)." The goto to an undefined label is a control-flow defect that falls into this category.
2. Lattner
C.
& Adve
V. (2004). LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO'04).
Section 2
"The LLVM Compiler Infrastructure": This paper discusses compiler frameworks that perform static analysis. It explains that a key role of the compiler front-end is to parse source code and build an intermediate representation
a process during which errors like undefined labels or variables are detected before any code is executed. This is the core principle of static analysis.
DOI: https://doi.org/10.1109/CGO.2004.1281665
3. Aldrich
J. (2021). 17-355/17-655/17-819: Program Analysis Courseware. Carnegie Mellon University
School of Computer Science.
Lecture 2: Dataflow Analysis
slide 11 ("Reaching Definitions"): The course material explains that dataflow analysis
a form of static analysis
is used to determine "if a variable might be uninitialized at a use." This directly addresses the first fault mentioned in the question.
Keep practicing
Take the free ISTQB-ATTA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ISTQB-ATTA practice questions
- Question 3Which additional set of test cases is needed to achieve both 100% statement coverage and …
- Question 4How many test cases are needed to test code fragment lines 26 – 32 to achieve 100% condit…
- Question 6It has been suggested to organize a performance test to find out more regarding the third…
- Question 7To address reliability a number of measures will be taken throughout the development and …
- Question 9Based on the state diagram above, how many test cases are needed to achieve 1-switch cove…
- Question 10What is the value of statement coverage achieved by test case 1 from test set A? 2 credit…
