ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 18 - CTFL4 discussion

Report
Export

The following requirement is given ''Set X to be the sum of Y and Z''.

All the following four implementations have bugs.

Which one of the following bugs can be caught by Static Analysis?

A.
int x = 1. int y = 2. int y = 3. X = y=z;
Answers
A.
int x = 1. int y = 2. int y = 3. X = y=z;
B.
int x = 1. int y = 2. int z = 3. X = z-y
Answers
B.
int x = 1. int y = 2. int z = 3. X = z-y
C.
int x = 1. Int y = 2. Int z = 3. Z = x +y
Answers
C.
int x = 1. Int y = 2. Int z = 3. Z = x +y
D.
int y = 2 Int z = 3. Y = z+y
Answers
D.
int y = 2 Int z = 3. Y = z+y
Suggested answer: A

Explanation:

Static analysis is a technique that analyzes the source code or other software artifacts without executing them. Static analysis can detect defects such as syntax errors, coding standards violations, potential security vulnerabilities, or logical flaws. Static analysis can catch the bug in the first implementation, as it contains two syntax errors: the variable y is declared twice, and the assignment statement X = y=z is invalid. Static analysis cannot catch the bugs in the other three implementations, as they are logical errors that do not violate any syntax rules, but produce incorrect results. Verified

Reference: [A Study Guide to the ISTQB Foundation Level 2018 Syllabus - Springer], Chapter 3, page 25-26.

asked 18/09/2024
George Mabry
51 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first