Welcome to MSDN Blogs Sign in | Join | Help

Emotional Test Automation

In April I hosted a session at the Software Testing and Performance conference entitled Why Test Automation Fails. I actually tried out a new delivery style for me similar to a town hall format where I attempted to elicit participation from the attendees. Unfortunately, it didn’t work out as well as I had expected, but at one point a consultant who attended the session offered their opinion expressing what they thought automation can’t do.

He stated automation can’t empathize, project, anticipate, recognize, judge, predict, project, evaluate, assess, become resigned, get frustrated, invent, model, resource, collaborate, decide, work around, strategize, charter, teach, learn, appreciate, question, refine, investigate, speculate, suggest, contextualize, explain, elaborate, reframe, refocus, troubleshoot, and THINK.

To this I exclaimed, “I am not sure I want my automation to get frustrated!” At the time I was thinking frustration is typically not a productive emotional trait because it usually manifests itself as “a deep chronic sense or state of insecurity and dissatisfaction arising from unresolved problems or unfulfilled needs” (Merriam-Webster Medical Dictionary). But, while flying home to Seattle that evening I pondered how an emotional condition such as ‘frustration’ might be applied to a tool such as test automation. (Because make no mistake about it; to me test automation is a tool similar to a screwdriver in a toolbox, or a global positioning system on a boat. These tools are designed to be very effective for their purpose. And when test automation is designed and used correctly it also serves a very valuable purpose to those who use it as a tool to increase their productivity.)

So, I sent an email to the person and asked him for the list and restated what I said at the conference.  I wrote, “Like I countered, I am not sure that I want my automation to get frustrated (and honestly I am not quite sure of the point you are trying to make there)…” He responded, “When a tester gets frustrated with some aspect of an application's behaviour (It's taking too long to respond!  I have to click on this annoying confirmation dialog!  This sequence of steps doesn't fit with my workflow!  This set of options confuses me!), I can infer that an end-user will too.  An infinitely patient human tester would ill-equipped to identify problems in the application that would annoy or irritate a normal human being.  Automation is infinitely patient (unless we're programmed it not to be, via a timeout); if it has to wait, it will wait emotionlessly.  We cannot expect the same of our customers.  It's not that I want automation to get frustrated; I don't know how to make it do that.  But I do want to get information on how the product feels to humans--so I use human testers for that.

Other than the fact this person misquoted me in his lightning talk at StarEast 2007, he also acknowledged in his email, “It’s not that I want automation to get frustrated” as well. It is usually not a productive use of one's time to discuss issues with individual's who argue against their own points. It's sort of like someone saying "Elephant's can't fly. It's not that I want elephants to fly, but they can't...so there!" But, I see in his response that he describes other emotions such as ‘annoyance’ and ‘irritation’ (to rouse to impatience or anger; annoy – American Heritage Dictionary) to describe ‘frustration.’ Now annoyance and irritation are things I can relate to because I sometimes do get annoyed and irritated. So, let’s examine the emotional condition of irritation (because frustration generally implies a negative, and often counter-productive emotion) as described in the quoted email above and determine whether or not 'irritation' can be simulated by a computer program.

When I design an automated test I never let the test run “infinitely” because I know that a ‘hang’ or inordinate delay may cause an unexpected reaction in my test execution. (For example, if I am trying to ‘click a button’ on a dialog I must first make sure the dialog with the button instantiates and has focus and the button is not ‘grayed.’) A best practice for designing automated tests is to use polling with a finite timeout. Simply put polling is looping on a conditional statement until either the condition occurs, or the max poll count is reached. If the maximum poll count is reached before the condition occurs the automated test ‘decides’ the application is not in the ‘predicted’ and expected state and a timeout occurs implying that “It’s taking too long to respond” based some predetermined value to simulate irritation (or ‘frustration’).  If the automation becomes ‘irritated’ then I can cause the automation to ‘become resigned’ by designing the automation to log an unexpected error (rather than a failure), and collect information about the machine state and the automation state and log that information for closer examination by a tester.  (I don’t really think about this as programming an artificial emotional response; I think about it from the perspective of good automated test design.  But, in retrospect I guess it is simulating ‘irritation.’)

For example, if I think an application is taking too long to shut down rather than writing a bug report stating something like “The application takes too long to close” I can write a method similar to the following example that actually measures the amount of time it takes for the application under test (AUT) to close (and assuming the method returns true).

public static bool CloseAutProcess(
    Process autProcess,
    int maxPatience,
    out int levelOfIrritation)
{
    levelOfIrritation = 0;
    autProcess.CloseMainWindow();
    if (!autProcess.HasExited)
    {
        while (!autProcess.HasExited && levelOfIrritation < maxPatience)
        {
            autProcess.WaitForExit(1);
            levelOfIrritation ++;
        }
    }
    if (autProcess.HasExited)
    {
        return true;
    }
    return false;
}

In this example, the maxPatience variable sets the maximum amount of time (in milliseconds) I am going to wait for the AUT to shutdown before becoming ‘irritated.’ The levelOfIrritation variable accurately measures the time in milliseconds (give or take a few nanoseconds). Now, if the shut down time exceeds reasonable expectations (based on a comparative analysis of similar programs, or stated or implied requirements) I can write an objective bug report and allow management to decide if the 'level of irritation' needs to be adjusted based on solid factual information rather than some ambiguous personal patience threshold, or lack thereof. Because at the end of the day, my managers may value my opinion, and sometimes opinions are important deciding factors. But, as a software testing professional my role is to provide reliable, accurate, and detailed information to my teammates and other stakeholders.

(BTW…I can use event handlers to identify the frequency and number of ‘annoying confirmation dialogs” and deal with them. And, with regard to the other things described as ‘frustrating above (“This sequence of steps doesn't fit with my workflow!  This set of options confuses me!” ) I am thinking these would most certainly be discovered while designing the automated tests (because test automation doesn’t design and develop itself).

So, I am still of the mindset that I don’t want my automation to develop a deep chronic sense or state of insecurity and dissatisfaction (def. - frustration) and I don't want my automation to have 'needs.'  And even though I can simulate some degree of artificial ‘emotional’ conditioning in test automation, I don’t want my automation to have emotions any more than I want a hammer or saw or other tool to develop human emotions. Test automation is simply a tool, and it is a tool developed and used by humans (who are emotional) who constantly utilize cognitive processes (including emotional responses) while solving difficult problems or working towards achieving specific goals. The power of a tool is limited only by the skills, ability, and knowledge of the persons designing, developing, and/or using that tool.

I agree that automation can’t THINK (although I am not overly convinced thinking is an emotion). That is why highly skilled people design and develop great test automation, and they don’t simply rely on record/playback or simple rote scripts for automated testing.

Published Friday, June 08, 2007 4:12 PM by I.M.Testy

Comments

# re: Emotional Test Automation

I agree that we cant rely on automation to tell us the "feel of the product". We have a metric called OGF - Overall Goodness Factor - that we measure manually in our division to articulate the subjective judgement of product quality. Like you have accurately said, automation is only a tool. Not a replacement of testers.

BTW, a small nitpick - you say "illicit response" in the opening remark...that is actually "elicit response". Illicit means illegal while elicit is to pry! The English language has got to have the most confusing sounding words ever! :-)

Monday, June 11, 2007 5:42 AM by anutthara

# re: Emotional Test Automation

Hi Anutthara,

It would be an interesting post on your blog to discuss the OGF measure, how it's determined and how it is used.

Thanks for the nitpick...I corrected the misspelling.

Monday, June 11, 2007 10:18 AM by I.M.Testy

# re: Emotional Test Automation

Bj,

Here are my few cents to this interesting discussion ...

>>>>>He stated automation can’t empathize, project, anticipate, recognize, judge, predict, project, evaluate, assess, become resigned, get frustrated, .... and THINK.

To this I exclaimed, “I am not sure I want my automation to get frustrated!”

[Shrini] Any reason why picked up "frustration" and exclaimed? Does this mean you agree with all other things?

[Bj] No particular reason for choosing frustration. And no, I don't agree with all other things. For example, some of the 'emotional traits' listed are synonymous in my opinion such as project and predict. Now, can software automation project (something that is contemplated, devised, or planned) or predict (To state, tell about, or make known in advance, especially on the basis of special knowledge). Well, the automation by itself cannot, but when I design and develop the test automation I certain can program the test in a way that I can predict specific outcomes at specific stages in the automated test program execution. For example, if I issue a command to open the file save as dialog I can design the automation to 'predict' the file save as dialog will instantiate, and I can also 'anticipate' situations in which it may not and if it doesn't open within a specific amount of time (using polling as discussed) then I can cause the test to 'decide' to get 'irritated' and log an unexpected failure that will require further investigation. IMHO judge, evaluate, and assess are also synonymous. Can my automation compare 2 strings for equality and evaluate whether or not they match? Sure. One of the most useful applications of functional test automation is to assess a product's ability to consistently perform a set of repeatable actions.

Now, certainly test automation cannot appreciate, suggest, contextualize, empathize, etc. That is why we have very smart, and high skilled testers who know the value of test automation, they know how to design and develop it correctly, they know how to use it, and they know it is not a automation vs. human debate. (It is hard for me to understand people who constantly condemn test automation as an evil, rather than promote automation as a tool by explaining why, when, and how to best use it to help us become more effective.)

>>>>At the time I was thinking frustration is typically not a productive emotional trait because it usually manifests itself as “a deep chronic sense or state of insecurity and dissatisfaction arising from unresolved problems or unfulfilled needs”

[Shrini] You are right about interpretation of the meaning of frustration when applied to the work of "Automation" and "testing". When asked this question to a colleague of mine - "Do you like your automation getting frustrated" - She said "no -that you would be terrible and is undesirable". I think she also interpreted in the same way as you did. Frustration on automation is bad thing and is undesirable. But the consultant that you are referring appears to be saying "Frustration about product behavior (not about way of testing it or automating a test) is key human attribute that leads to discovery of bugs and issues that are important. And automation being such a tool that is "emotion free" and "infinitely patient"- does not have this ingredient".  Hence, it would not be effective in discovering the class of defects that have origin in human traits and reactions to product features.

[Bj] Hence my later interpretation of what this person was inferring would probably be better described as irritation or annoyance.

>>>But, while flying home to Seattle that evening I pondered how an emotional condition such as ‘frustration’ might be applied to a tool such as test automation.

[Shrini] For a tool like “Test Automation” or for that matter “screw driver” and global positioning system – emotion component WOULD NOT apply.  I believe consultant was trying to say that.  Since in Testing “emotional components” play a big role in finding interesting bugs (as articulated by the consultant) – automation would be ineffective in discovering such bugs. That is all.

[Bj] Shrini...your first sentence hits the nail on the straight on the head. If we all agree that "emotion would not apply" in the context of a discussion of test automation, then what is the point? Why, did this person even bring it up? Would someone bring up such an issue only to be cantankerous or divisive?

I don't agree that "Since in Testing "emotional components" play a big role in finding interesting bugs..." is true. I would agree that constructive emotions sometimes play a role in finding some defects. When I look at the defect tracking databases the vast majority of issues reported are objective; they are not subjective, biased opinions based on some person's emotional condition.

>>> And when test automation is designed and used correctly it also serves a very valuable purpose to those who use it as a tool to increase their productivity

[Shrini] I think the consultant would agree to *this* statement.  I agree too.  You seem to be mixing up two types of frustrations, I can think of.  Let me call it as Type A – the frustration *caused* by the automation tool. This is bad and undesirable (This is like some one saying “I don’t like testing or automation. It sucks …).   Type B – the frustration that human tester experiences when working (testing - to be precise). This is good – human trait that leads to discovery of bugs. You seem to be referring to the first type (type A) and the consultant seems to be referring to the second (type B).

[Bj] No, I wasn't mixing up two types of frustration. My interpretation of frustration is based on the denotation. The individuals denotation is based on a different connotation. Once the individual clarified the connotation of frustration by coupling it with words such as irriation and annoyance I then understood the context. (I think you wrote once before that using words correctly was important.) 

I am not sure how you derive that I am referring to frustration "caused" by an automation tool. That is not at all what I am stating. My statement, "I am not sure I want my automation to get frustrated" implies that I do not ever want my test automation (a tool) to develop a deep sense of dissatisfaction, and I don't want my test automation to have human-like "needs."

>>>> He responded, “When a tester gets frustrated with some aspect of an application's behavior (It's taking too long to respond!  ….), I can infer that an end-user will too.  An infinitely patient human tester would ill-equipped to identify problems in the application that would annoy or irritate a normal human being.

[Shrini] Correct – Very well said. Do you disagree to above? An infinitely patient Tester would not notice certain class of problems?

[Bj] Hmmm...no I do not disagree. But, then again, I don't know of infinitely patient testers, and I don't know of too many professional testers who are capable of designing and developing robust test automation who would make their test automation wait indefinitely either.

>>>>>> It's not that I want automation to get frustrated; I don't know how to make it do that.  But I do want to get information on how the product feels to humans--so I use human testers for that.”

[Shrini] Clearly notice the words here. Please pay attention.  Here the consultant is referring to type B Frustration (*Good* and desirable – Frustration which leads to bugs). It is also important to note that the consultant is clear here – “he does not want to see bad frustration (type A) with Automation”.  As he rightly says – it is not possible to create Type B frustration create with Automation as it involves a human element.

[Bj] Did not the code sample with polling simulate a level of irritation? Let me give you an example. If on one test machine I (human) execute a test and do not get frustrated (because I have a rather fast machine), then I design and develop an automated version of that test (because I have to support a multitude of machine types) and on a slower machine the automation times out on an event or process then did my test automation just not simulate irritation?

>>>>It is usually not a productive use of one's time to discuss issues with individual's who argue against their own points. It's sort of like someone saying "Elephant's can't fly. It's not that I want elephants to fly, but they can't...so there!"

[Shrini] In my opinion, the consultant is NOT arguing with his own argument. He seems to be referring to one type of frustration and you - the other. Hence there appears to be total disconnect.

>>> When I design an automated test I never let the test run “infinitely” because I know that a ‘hang’ or inordinate delay may cause an unexpected reaction in my test execution.

[Shrini] Here you seem to be comparing “running an automated test” for “really long” with the “infinitely” patient automation tool or a solution. If you intend to link or compare with what the consultant referred as “infinitely” patient – you could be mis-interpreting his words again.  An infinitely patient Automation would not be equivalent to a “long running” test but would mean mechanical behavior without of any human emotions.,

[Bj] Uhhh??? I am not sure how you can misinterpret my words to suggest that I am comparing "really long" with "infinitely patient." "Really long" and "infinitely patient" are 2 separate things. I assume that "really long" implies a test that executes for a long period of time. This is quite different than a method or function that does not wait indefinitely to process.

This whole post is about designing and developing automated tests intelligently. If I design poor test automation it will wait indefinitely or be "infinitely patient." But, if I design automation using established best practices of polling and timeouts then my test automation will not run indefinitely and will not be "infinitely patient."

>>>So, I am still of the mindset that I don’t want my automation to develop a deep chronic sense or state of insecurity and dissatisfaction (def. - frustration)

[Shrini] First of all - even if you want to - you can not make your automation to cry OR jump with joy like a human being.  So it is not feasible to achieve that with the tool like automation.  The type of feeling (frustration) involving deep chronic sense state of insecurity and dissatisfaction – when experienced by the human tester while doing testing is Good frustration – Type B.

[Bj] Hence my original statement, "I am not sure I want my automation to get frustrated."

And, I don't agree the emotional state of frustration is especially productive most of the time. When many people become frustrated because of "unresolved problems or unfullfilled needs" then bad things usually happen. For example, I have seen testers get frustrated resulting in keyboards being thrown, monitors being pushed over, and other irrational behaviors. And, I have seen testers become irritated and then back up and rethink their approach, ask questions, refocus, and rationally consider the situation towards discovery of a solution.

>>> I don’t want my automation to have emotions any more than I want a hammer or saw or other tool to develop human emotions.

[Shrini] You can not do that even if you wish –hence let us not talk about it.  I am sure even the consultant did not want the tool to acquire such human traits.

[Bj] I didn't bring up this issue, I am simply providing a different perspective on the topic.

>>> Test automation is simply a tool, and it is a tool developed and used by humans (who are emotional) who constantly utilize cognitive processes (including emotional responses) while solving difficult problems or working towards achieving specific goals. The power of a tool is limited only by the skills, ability, and knowledge of the persons designing, developing, and/or using that tool.

[Shrini]  BJ, this paragraph is “the best” part of this post and I agree with this 100%. I am sure the consultant also would agree with this. Right Mr. Consultant? You should have started your post with this. This is a common ground – check with the consultant when traveling this common road from where you and he got into separate routes.

[Bj] I did check with the person, and did discover that what he inferred by frustration was in fact irritation and annyoance as explained in the post. I then give an example of how to simulate that. (Also see statement below.)

In summary the source of all confusion (I think so) is  all along you and the consultant were referring to two different types of frustrations. Try re-reading the consultant's viewpoints with the knowledge that he is referring to Type B frustration and conciously avoid mistaking that to type A frustration. You might discover a new perspective and may you will agree with him.

[Bj] My initial confusion was clarified when the person later described emotions such as irritation and annoyance as synonymous with frustration. That eliminated the confusion (for me). The method illustrated exemplifies a technique to simulate what you refer to at type B frustration or a level of irritation. I am not sure how you can misinterpret my post and assume that I am referring to "frustration *caused* by the automation tool." But, if you would like to discuss it further I would be more than happy to explain the concept of well-designed test automation, timeouts, and polling to simulate and quantify a level of 'irritation.'

Shrini

Monday, June 11, 2007 12:39 PM by Shrini

# re: Emotional Test Automation

Shrini...my response is in-line above.

Monday, June 11, 2007 6:19 PM by I.M.Testy

# Emoting software: more thoughts on simulating emotions...

I am fascinated with the advances computing, and have always approached computing from the perspective

Wednesday, August 01, 2007 12:54 PM by I. M. Testy
Anonymous comments are disabled
 
Page view tracker