The day-to-day work in software development is work that requires a lot of brainpower. It involves high cognitive demands and skills in which perception and attention play a special role. The problem with this is that the way people think can be distorted. A distorted way of thinking leads to thinking traps and consequently to mistakes. Unfortunately, people don’t notice when their way of thinking is distorted – this process usually happens unconsciously in their heads, meaning that their attention is elsewhere, and they don’t even notice that they’re about to make a potentially serious mistake. In software engineering, thinking errors lead to problems, such as poor software quality or delays in the project. Here’s the bad news: you can’t avoid mistakes. But the good news is: anyone who has mastered a few perceptual-psychological basics can adapt their way of working and especially their programming style in a way that avoids thinking traps and recognises mistakes more quickly.

It’s easy to make a mistake – here’s an example

The following example, taken in its basic version from Daniel Kahneman – author of the book ‘Thinking, Fast and Slow’ shows how quickly we make mistakes or fall into thinking traps. In a software project, the task is to implement a digital menu or a digital menu display. A department specifies that the digital menu display needs to show ‘Currywurst mit Pommes’ (curry sausage with chips) as costing €1.10 today as it’s on special offer. However, in order to be able to track stock levels, the sausage and the chips must be listed separately on the bill that will be created during the transaction. The department adds that the sausage costs one euro more than the chips. How much will the chips be on the bill?

Most people find solving this problem easy and immediately think that the answer is ten cents – and there is nothing you could do to change their mind. The crux of the matter here is that ten cents is simply the wrong answer. If the chips cost ten cents and the sausage costs one euro more than the chips, as specified by the department, then the sausage costs €1.10 – and the total would then be €1.20. The correct answer is that the chips should only cost five cents because then the sausage would cost €1.05 and the total cost would be €1.10, as required.

This example just goes to show that we make mistakes, even very simple ones. People make comparable mistakes in many situations in life. When we go shopping, for instance, process and marketing psychologists deliberately manipulate us to feel a certain attraction towards certain products or services. We also make mistakes while driving, with the classic one being getting into accidents because you didn’t ‘see’ an obstacle or another road user. From a physiological point of view, it’s probably not even possible for a driver to miss something on the road if it’s in their field of vision. Healthy human eyes detect approximately five million stimuli per second, so they must have seen it. A perceptual filter passes on the information that it deems important to our thinking system. Anyone who ‘overlooks’ something on the road simply had their attention or thoughts diverted elsewhere in the moment – the thinking system was distracted by other things. Road users aren’t the only ones who have to deal with thinking traps and a distorted perception – software developers have to deal with them in their day-to-day work, too.

Thinking behaviour from a psychological perspective

In psychology, thinking behaviour is divided into two thinking systems: the automatic system and the voluntary system. For the sake of simplicity, we’ll refer to the automatic system as system one and the voluntary system as system two. What is the difference between the two systems?

A large amount of brain activity happen automatically, which means it’s quick and effortless, and also happens subconsciously. Humans find it easy to recognise whether, for instance, one object is further away than another. We don’t need long to work out what two plus two is, and we can also read simple words on large billboards in the blink of an eye. Gestures and facial expressions are also often automatic reactions to events. For example, you automatically turn towards the source of a sound or show a disgusted face in certain situations. All these examples are examples of the automatic system, or system one.

System two, or the voluntary system, directs attention to the strenuous, mental activities. These include, for example, complex calculations or consciously focusing on upcoming events, such as when a sprinter is waiting for the starting pistol to sound.

Psychology describes not only the existence of the two systems, but also a rather significant connection. This is because impressions and feelings are generated spontaneously in the automatic system that are the main sources of the explicit beliefs and conscious decisions of the voluntary system. To put it simply, the voluntary system influences the automatic system.

Unfortunately, when system one thinks automatically, then a lot of mistakes happen, which is also illustrated by the example of the curry sausage and chips mentioned at the beginning. You are not immune to this in any situation in life, not even software development. As a software developer, you are often working to solve complex problems. As soon as you find an elaborate solution for one complex problem, the next one usually comes along. The principle of priming, for example, leads to the continuation of complicated thinking. We’ve all been in a situation where we’ve been trying to come up with a solution until late in the evening, gone to bed frustrated and are still no closer to an answer – and then the following day, after only a few minutes with a ‘clear head’, realised the simplicity of the problem and been able to implement the solution immediately.

Many a programmer has probably already fallen ‘victim’ to the streetlight effect. If exceptions occur during Java development, stack traces containing references to the relevant command, including line details, are used for diagnostic purposes in order to reconstruct the error or its cause. The ‘streetlight’ shines on the exact place where the exception occurred. However, this isn’t always where the cause of the problem is. A missing annotation or a missing initialisation in a completely different place could also be key. You can find more detailed information about typical biases such as priming and the effects on software development in online magazine ‘Informatik-Aktuell’ (in German) and the associated conference paper from ‘IT-Tage 2021’.

Conclusion

Among other things, psychology deals with factors that influence human behaviour and reactions. These influences are often conscious or unconscious psychological processes that also have an impact on the work of software developers. The findings on cognitive biases play a special role in the case of unconscious processes in particular. People naturally ‘suffer’ from this and make mistakes. Being aware of biases means you can prevent errors and improve programming quality.

You will find more exciting blog posts from the adesso world in our latest blog posts.

Picture Christian  Everke

Author Christian Everke

Christian Everke (M.Sc.) leads a team of developers in the Line of Business Manufacturing Industry at adesso. His professional focus is on the software architecture of Java applications. He current work focuses on supporting a DAX company in the field of HR applications by providing consultancy as well as the design and conception of integration solutions. He has previously worked as a software engineer on various projects in the banking, public and lighting sectors.

Save this page. Remove this page.