Testing, Debugging & Code Optimization Flashcards
7 cards from real CPA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Testing, Debugging & Code Optimization flashcards as text
Which testing approach tests the internal logic and structure of the code rather than just its external behavior?
Answer: White-box testing
White-box testing examines the internal code structure, branches, and paths, unlike black-box testing which only evaluates inputs and outputs.
What is a 'breakpoint' in the context of debugging?
Answer: A marker that pauses execution so the developer can inspect state
A breakpoint is a deliberate stopping point set by the developer in a debugger to pause program execution and examine variables and flow.
Which metric measures the percentage of source code lines executed during testing?
Answer: Code coverage
Code coverage (specifically line coverage) reports what percentage of code lines were executed by the test suite.
What is the purpose of a stub in unit testing?
Answer: To replace a real dependency with a minimal controlled implementation
A stub replaces a real dependency (like a database or API) with a simple controlled version so the unit under test can run in isolation.
Which optimization technique moves a loop-invariant computation outside of the loop?
Answer: Loop hoisting (code motion)
Loop hoisting (also called loop-invariant code motion) moves calculations whose result does not change across iterations outside the loop to avoid redundant work.
What does 'regression testing' primarily verify?
Answer: Previously working functionality has not been broken by recent changes
Regression testing re-runs existing tests after code changes to confirm that previously working behavior has not been inadvertently broken.
In big-O notation, which complexity grows most slowly as input size increases?
Answer: O(log n)
O(log n) grows much more slowly than linear O(n) time, making logarithmic algorithms highly efficient for large inputs.