Solved

What Is the Best Strategy for Avoiding Off-By-One Errors

Question 23

Multiple Choice

What is the best strategy for avoiding off-by-one errors?


A) Randomly insert +1 or -1 until the program seems to work.
B) Think through a couple of test cases and use the results to come up with a rationale for decisions.
C) Always start a loop at 0.
D) Never use the < operator by itself in a comparison test.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions