DELAPARRA
Index
Color
NL
Category: Error types

LogicError

Explained by Updated

What is LogicError?

LogicError: The code runs without crashing, but produces the wrong result — the algorithm itself is incorrect. A logic error is a bug where the code runs without crashing but produces the wrong result. The VAT is calculated on the wrong amount, a discount is applied twice, or a date range excludes the last day.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about LogicError

How is LogicError used in practice?

These are the hardest bugs to catch, because nothing signals that something is wrong. No error message, no stack trace, just incorrect output that someone may notice weeks later.

What should you keep in mind with LogicError?

Automated tests are the main defence, especially tests with concrete expected values for business rules: this order with these items and this discount must cost exactly this much. Edge cases deserve attention: empty lists, zero amounts, month ends and leap years. Code review helps too, because a second person reading the logic often spots an assumption the author did not question.

At a glance

CategoryError types
Explained by
Updated

More Error types terms

All terms starting with L

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.