Tuesday, May 12, 2009

Emotions and Software Testing!


"Software Testing is a skill. While this may come as a surprise to some people it is a simple fact." - (Fewster, Graham: "Software Test Automation")
Recently I was talking with a fellow software tester and he queried – "Debasis, what is the role of human (can be a software programmer, a tester, etc) emotions in software defects? Do you feel that, to become a good tester we should leave aside our emotions or rather use our emotions to find more defects in the software under test?"
This question made me to think over the role of emotions in software development and in software testing and here are my thoughts on the matter!
Regardless of the roles and designation, whoever is working on the software development team is a human being! And I believe every human being is vulnerable to emotions! Emotions are integral part of human psychology and we just can’t leave our emotions even if we want to! As we can’t get rid of emotions, the next question is how can it affect the quality of software!
» Can people’s (System Analysts, Designers, Programmers, Technical Writers, and even Testers) emotional state at a given time contribute to defective software?
» Can people’s moods or emotions play a role in software quality?
» Can software quality play with people’s (Client, End Users) emotions?
» Can people’s (Testers) emotions be used to enhance the software quality?
Assuming the answer to all of the above 4 questions to be "Yes" (of course depending on the particular context), I think I can assert that:
» Under certain contexts, human emotions may be responsible for defects in the software.» Some defects can be capable of playing with human emotions.» Some defects can be detected using the emotional response of a tester.
Depending on this I have tried to classify defects/bugs, broadly into 3 categories:» Defects/Bugs that are created due to human emotions. [Type A]
» Defects/Bugs that play with human emotions. [Type B]
» Defects/Bugs that are detected by human emotions. [Type C]
Type A: Once I was assigned to test a B2B (Business-to-Business) web portal. We had a pretty good developer team to work with. We (the testing team) were system testing the final candidate, which was scheduled for a release unless any showstopper defect/bug was found! I was regression testing a module, which had undergone some recent code refactoring! [Note: Refactoring neither fixes bugs nor adds new functionality. Rather it improves the understandability of the code or changes its internal structure and design, and removes dead code, to make it easier for human maintenance in the future.] And I got an out of memory error! This error was not there when I had tested it last time. So at first glance this error looked like an error resulted due to the recent refactoring in the source code! When it was intimated to the programmer who had refactored that module, he was puzzled! I knew him to be a good programmer and he proved me right by identifying the root of that error very quickly! It was due to a method that was recursively calling itself and was forcing the program to get stuck in a loop, thus making a "new" object each time round! But the programmer was very much upset with himself for making such a silly (according to him) mistake. Usually novice programmers make these kinds of mistakes and he knew he would not have done it in steady mental state! He was trying to figure out how he could do such a stupid mistake and then remembered that one of his close relative had died last week and he was very much heart broken and stressed. It was when he was asked and had to do that code refactoring. Could that error have been as a result of his disturbed emotional state? Is this a case where a disturbed emotional state is capable of producing defective software?
Type B:
We come across such situations quite often in our day-to-day life! Don’t you find yourself highly irritated when the printer (may be the driver software that runs the printer) just refuses to print your bill and you end up standing at the cash counter of the shopping mall even after having paid your bill amount? Don’t you get frustrated when you see a message popping up (this happens after you have completed all the initial steps and are waiting for your cash) on the ATM machine telling that there is no cash to be delivered at the moment? [Note: If it was saying about not sufficient cash that would have been understandable. What if you get the message even for the minimum allowed withdrawal amount?] Don’t you start muttering, "Why can’t they just show me this message at the very beginning? If they know there is no cash to be dispensed, why are they wasting my time by leading me through the successive steps before displaying the message finally?" Well, I am not sure if you get frustrated/irritated when you face such situations. But as an end user I do get terribly annoyed in such cases. Can we classify these errors/defects as those, which play with human emotions?Type C:
Once I was testing a web portal. It was already tested by another group of testers and I was supposed to just run-through the site as a final sweep of testing. The look and feel of the web portal was just great. After taking a quick look at the Guest User module (which was apparently clean without any major hiccups) when I started testing the Registered User module, the Login Screen just froze (well, it looked so) as I tried to login using a valid login credential! More than 30 seconds must have passed when I started getting impatient and confused! It was quite frustrating to see a web portal (which was supposed to take over 500 concurrent hits) freeze at the login screen before even I (a Registered User) could take a look at the portal! And then, after almost 45-50 seconds the login page finally took me to the next page (Welcome Screen for the Registered User showing me as Logged On). After that every thing seemed to work fine again; there were no more hangs, no crashes, no error messages and the system behaved like a good-obedient-boy. But to me, the long delay of the login procedure appeared like a serious issue from the end user perspective and I went ahead to log that as a High Severity defect in our defect tracker. Later it was discovered that the dynamic load balancing mechanism was having conflict with the distributed web servers and thus resulting in the unwelcome delay! I am wondering if I could have still sensed this as a potential problem and logged it as a defect unless my emotions (impatience, confusion, frustration, annoyance, irritation etc) had not guided me at that instance!Wikipedia defines an emotion as a "complex reaction pattern, involving experiential, behavioral, and physiological elements, by which the individual attempts to deal with a personally significant matter of event." It arises without conscious effort and is either positive or negative in its valence.Emotions, if used correctly can be very powerful in finding defects in software. Emotions such as - stress, anxiety, depression, frustration, confusion, annoyance, impatience, boredom, irritation, curiosity, amusement etc can be good at pointing towards possible defects in software while testing. I have noticed that defects relating to performance issues, usability issues, reliability issues and of course functionality issues are easier to be detected using emotions as your guiding force.» Do you also believe in emotion-guided-testing?
» Do you think that human emotions play important role in the quality of software?» Have you ever come across some similar experience(s) where you noticed human emotions playing roles in defect life cycle (introduction, detection or affecting the end user)?
I am eagerly waiting to hear your stories. Feel free to share your views/ideas on this topic by commenting.
Happy Testing… Further Readings:
Emotions and Test Oracles [Power Point Slide] - By Michael Bolton, on how it might be difficult to automate human emotions while testing! And how human emotions can be the biggest factor in recognizing or interpreting defects/bugs when we see them for the first time.
Bugs and Emotions – By Pradeep Soundararajan, on how defects/bugs are capable of playing with human emotions! An interesting anecdote of a bug that he experienced after registering with a matrimonial website!

0 comments: