Skip to content
← All CTFL learning objectives

CTFL 3.1.3: Compare and contrast static testing and dynamic testing

K2

Syllabus section 3.1.3

3 original PrepBench practice questions for learning objective 3.1.3 of the CTFL 4.0 syllabus. Try the examples below and check each answer against its syllabus reference.

Practice questions

Question 1

A team wants to detect unreachable code in a payment module. Which statement explains why static testing is better suited to this than dynamic testing?

  1. Static testing finds defects directly, and more easily on paths that are rarely executed or hard to reach
  2. Static testing causes failures from which the associated defects are determined by later analysis
  3. Static testing measures quality characteristics that depend on executing the code, such as performance
  4. Static testing can be applied only to executable work products, so this code qualifies for it
Show answer
  • Correct answer: Static testing finds defects directly, and more easily on paths that are rarely executed or hard to reachStatic testing finds the defect directly and does not depend on executing the path.
  • Static testing causes failures from which the associated defects are determined by later analysisCausing failures and then analyzing back to the defect is how dynamic testing works.
  • Static testing measures quality characteristics that depend on executing the code, such as performanceCharacteristics that depend on executing code, such as performance efficiency, are measured dynamically.
  • Static testing can be applied only to executable work products, so this code qualifies for itThis reverses the rule: dynamic testing is the one restricted to executable work products.

Static testing finds defects directly, while dynamic testing causes failures from which the associated defects are determined through subsequent analysis. Static testing may also more easily detect defects that lie on paths through the code that are rarely executed or hard to reach using dynamic testing — unreachable code is listed among the coding defects that static testing finds more easily or more cheaply.

Syllabus section 3.1.3

Question 2

Which type of defect typically requires DYNAMIC testing to be detected?

  1. A violation of the project's agreed coding standards
  2. An ambiguous user story sitting in the product backlog
  3. A whole missing section in the test plan document
  4. Incorrect behavior that shows only when the software calls an external system
Show answer
  • A violation of the project's agreed coding standardsA coding standard violation is detectable statically by analysis or review.
  • An ambiguous user story sitting in the product backlogAn ambiguous user story is a documentation defect found by static review.
  • A whole missing section in the test plan documentA missing test-plan section is found by statically reviewing the document.
  • Correct answer: Incorrect behavior that shows only when the software calls an external systemIncorrect runtime behavior with an external system can only be observed by executing the software.

Failures that depend on runtime conditions — interactions with other systems, timing, environment, or load — can only be observed by executing the software. Documentation and coding standard issues are found statically.

Syllabus section 3.1.3

Question 3

Which statement correctly contrasts what static testing and dynamic testing can measure?

  1. Static testing measures characteristics independent of execution, such as maintainability; dynamic testing measures execution-dependent ones
  2. Static testing measures execution-dependent characteristics, while dynamic testing measures those independent of execution
  3. Both measure the same quality characteristics, but static testing does so earlier in the SDLC
  4. Neither measures quality characteristics; both only detect defects in work products
Show answer
  • Correct answer: Static testing measures characteristics independent of execution, such as maintainability; dynamic testing measures execution-dependent onesMaintainability needs no execution, performance efficiency does.
  • Static testing measures execution-dependent characteristics, while dynamic testing measures those independent of executionThis reverses the rule; execution-dependent characteristics need dynamic testing.
  • Both measure the same quality characteristics, but static testing does so earlier in the SDLCThe two measure different characteristics, not the same ones at different times.
  • Neither measures quality characteristics; both only detect defects in work productsBoth are explicitly used to measure quality characteristics, of different kinds.

Static testing can be used to measure quality characteristics that are not dependent on executing code, for example maintainability, while dynamic testing can be used to measure quality characteristics that are dependent on executing code, for example performance efficiency.

Syllabus section 3.1.3

Original PrepBench practice material, not official exam questions or exam dumps. PrepBench is independent and is not affiliated with or endorsed by ISTQB®.

Glossary terms in this chapter