开发者

When is unexpected functionality a bug, or just poor design

开发者 https://www.devze.com 2023-01-27 03:39 出处:网络
There are times when a programmer clearly has made a deliberate choice in their code structure that results in behaviour that is (at best) unintu开发者_StackOverflow社区itive but not technically a bug

There are times when a programmer clearly has made a deliberate choice in their code structure that results in behaviour that is (at best) unintu开发者_StackOverflow社区itive 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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号