Armin Sestic - Fotolia

Manage Learn to apply best practices and optimize your operations.

Who is to blame for bad coding? Time to look in the mirror

Sometimes, when software goes wrong, the problems are self-inflicted. Expert Gerie Owen explains why development teams can fall prey to bad decision-making, and how to get out of the downward spiral.

It is with surprising frequency that companies released software that failed miserably and left their users scratching heads, perplexed at just how these companies got it so wrong. These bad coding failures run a gamut in terms of their severity. They range from loss of life due to radiation poisoning in the case of Therac-25 to corporate embarrassment in the case of a Starbucks defect where stores had to give out free coffee because cash registers no longer functioned.

The root causes of this bad coding can be traced back to many issues including insufficient or ineffective testing, release management issues and a host of human factors. Often these epic failures are the result of a lack of an objective risk analysis by project and leadership teams. These failures could have been prevented easily; they are self-inflicted.

Making bad decisions

For example, a company created an artificial intelligence component for its software to provide assistance to users. That artificial intelligence interacted with a user through an avatar, an attractive young woman with provocative dress and an alluring female voice. The concept of giving an image and a voice to an artificial intelligence was good. However, the choice was clearly inappropriate for a business application.

Any business value to be found in such decisions outweighs the risk of offense or bad publicity. Yet commercial software vendors and enterprises writing custom software fall into that trap very frequently.

And these certainly are issues of software quality. Not that the bad coding isn't meeting functional requirements, but rather in the sense that it is not being fit for an intended purpose. Risk inherent in such decisions is too high for any rational organization to take.

The issue could be that rogue elements within an organization make such bad coding decisions at a relatively low level. Those decisions would certainly be vetoed if they were brought to the attention of senior leadership. However, that does not happen often.

Understanding how mindsets influence our attitudes

Once leadership espouses being best in a class, it is highly likely that that entire organization will not only repeat it, but also possibly internalize it.

One reason mistakes like this happen involves individual mindsets. Researcher Carol Dweck defines two categories of mindsets: fixed and growth. Fixed mindsets believe that success comes innately, and that success or failure in a given endeavor is directly correlated to their abilities. If they fail once, then there is no point in trying again, because they lack that skill.

Growth mindsets take into account the prospects of failure, and use it as an opportunity to learn. Those with growth mindsets believe that any goal can be accomplished, as long as they continue to learn. You fail only to learn how to be better at it, and always look to improve.

For example, organizational leadership often boasts of its best employees, or its leading products, without much support to their claims. However, the employees readily accept their position as best, without questioning how in fact they have achieved it.

Once leadership espouses being best in a class, it is highly likely that that entire organization will not only repeat it, but also possibly internalize it. We believe in words, rather than their meaning, because it's easy to do so, and that's what our leadership says we are. Everything else flows from that perception.

Groupthink flows from a fixed mindset

The second answer revolves around the concept of groupthink. Researcher Irving Janis described groupthink as "a mode of thinking that people engage in when they are deeply involved in a cohesive in-group, when the members' strivings for unanimity override their motivation to realistically appraise alternative courses of action."

Once a significant formal or informal leader of an organization declares something to be true, many within that organization buy into that concept. Some even believe it because of the voice of their leader. Others feel it is more convenient or expedient to voice support, even in the face of personal doubts or uncertainty. The pressure to conform to an already-made decision is high, and the downside of going with it is minimal.

Organizations exhibit groupthink on many occasions. It is often seen as accepting and even supporting a decision that individuals later say with which they disagreed. People often agree because they believe there is no alternative.

A fixed mindset may lead to groupthink. If you are told you are the best, you also readily accept the corollary that you invariably make the best decisions. That may be one of the best explanations on how some of these self-inflicted wounds are created.

Breaking out

Is the quality of a software product influenced by the above mentioned decisions? Yes. There are ways to break out of mindsets, and ways to combat groupthink. Project teams should manage their own mindsets as individuals, and team members should be empowered to express their opinions. Finally, a culture of empowerment must be driven by senior management.

Next Steps

Learn the importance of quality assurance software

Why people and process are more important than tools for better quality software

Tests to check your software quality

Dig Deeper on Code refactoring and management