Question

There are times when a programmer clearly has made a deliberate choice in their code structure that results in behaviour that is (at best) unintuitive but not technically a bug in that it's broken. Should this be classified as a bug and fixed?

For example, a well-known open source ecommerce system (if you look at my answer history, you'll work out which one!) provides functionality for Quantity Increments where an administrator can specify the multiple of units that must added to the cart (e.g. must be 5, 10, 15, 20, etc). The code is written so that these limits are only enforced when the system is in "Manage Stock" mode (i.e. inventory levels are decremented with each order). Now, it is an entirely valid situation that a store owner may wish to sell their product in specified increments, but not manage stock levels. The code ignores the configuration silently (no feedback to the admin) and there's no documentation of the requirement for Manage Stock to be turned on.

Is this a bug? Or just poor design/documentation.

Note, I'm sure that some readers will interpret this question as subjective, but I think there is an important different between bugs and poor design. This is particularly relevant in open source projects where bug reporting tends to work in different processes than internal company systems.

Was it helpful?

Solution

Bug means behavior different from what the programmer had in mind, whereas Poor design means that the behavior intended by the programmer is something else than the user can reasonably expect.

OTHER TIPS

Is there a specification that identifies whether one way or the other is correct? If there is a specification, then it is a bug.

If there is no specification, then maybe it's poor documentation.

Can errors occur when the code ignores the configuration silently? Then it is a bug.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top