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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents