CS FundamentalsVery hardGATE CS · TCS NQT Prime · Product Company SDE

A 'flaky test' is one that:

  1. A. Tests only cosmetic UI details
  2. B. Always fails, consistently, on every single run
  3. C. Can only be written in a scripting language
  4. D. Passes or fails inconsistently across runs with no code changes in between, often due to timing, ordering, or environment dependencies

Correct answer: D. Passes or fails inconsistently across runs with no code changes in between, often due to timing, ordering, or environment dependencies

Flaky tests undermine trust in a test suite because their outcome is not reliably tied to whether the code is actually correct, often due to race conditions, shared state, or external dependencies.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic