CTAL-TTA practice question 16 of 25
Consider the following pseudocode segment: set a = 1 while a < 12 display “this is loop", a if a > 10 then display "loop is > 10’ set a = 5 else display “loop is < 11* endif end while display “Final value of a is", a Which of the following issues should be detected in the code review?
Full set: 174 questionsIn the provided pseudocode, the variable a is initialized to 1. The loop condition checks if a 10. Since a starts at 1, the else branch executes, which merely displays a message without modifying the value of a. Because a is never incremented or updated during iterations where a <= 10, a remains 1 indefinitely. The loop condition a < 12 will continuously evaluate to true, creating an infinite loop. Therefore, loop termination is unachievable, which is a structural defect that must be identified during code review.
B: The variable a is an integer counter, so floating-point rounding errors cannot occur in this logic. C: The variable a is explicitly initialized (set a = 1) before it is evaluated in the loop condition. D: While refactoring is possible, moving short logic into functions does not address the core execution bug present.
- ISTQB Certified Tester Advanced Level Technical Test Analyst Syllabus (v3.0), Section 3.2 "Static Analysis: Control Flow Analysis".
- IEEE 1028-2008 Standard for Software Reviews and Audits, Section 6 "Code Reviews".
Keep practicing
Take the free CTAL-TTA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CTAL-TTA practice questions
- Question 1Which statement is correct regarding the use of exploratory testing for safety critical s…
- Question 2Which of the following are activities that the Technical Test Analyst performs when setti…
- Question 3Which of the following can be executed by model-based testing tools?
- Question 4Consider the simplified logic below for crediting money to a bank account. Receive money …
- Question 5When conducting a data flow analysis of following section of pseudo code: Declare C, F, Z…
- Question 6What is the purpose of an HTML checker?
