Posts in Software Testing
I'm thinking of a number...
During CAST my wife was forced to spend time with various people in our industry who spend too much time thinking about and talking about testing. She's a teacher, so she's use to dealing with kids.... I mean testers....

One night at dinner, she shared a game she played at work with a class of her students. It's a way for them to kill time waiting for other classes to finish so they can switch rooms. The teacher thinks of a number between 1 and 100 and the students try to guess that number in the fewest number of questions. Amazingly, the word on the street is that one student did it in four. That's the record.

Of course, hearing of this game, several of us immediately turn this into a testing problem. The game now becomes, "Identify the number in the fewest number of yes/no questions, where each time you guess a specific number it not only counts as a question but if you are incorrect, it counts as a false bug report." That is, if you ask, "Is the number six?" and are wrong, you lose street credit with the developers.

There were several interesting tactics applied. Let me share a few....

1) Our first contestant was Jon Bach (tester). I had the number. Jon asked a series of questions based on context. One particularly genius question was, "Is the number 42?" He asked this because earlier in the day we had been talking about The Hitchhiker's Guide to the Galaxy. Jon took notes on his tests and used a matrix of numbers (which became a standard practice with all contestants except my wife) to track his progress. He ran into a rough spot where he forgot to record the results of his third test (faulty lab procedures), "Is the first digit bigger then the second?" This cost him dearly in both time and street credit. His final count was 10 questions with two false bug reports. He was man enough to admit his mistaken recording and promised that on future tests it would not happen again.

2) Our next contestant was Julian Harty (tester). I had the number. Julian had the advantage of watching Jon ahead of time. Julian used a straight binary search and zeroed in on the number in seven questions, zero bug reports. His process was repeatable and efficient. No points for creativity, but clearly showed he understood the project and that he could develop a simple systematic solution. He continued to think about the problem for quite some time, trying to develop an algorithm better then a binary search, but in the end, he felt it would remain the best way to approach the problem in the future.

3) Our third contestant was Amy Kelly (teacher). I had the number. Amy has seen the pro's in action (so there's no mistake, the pro's are her students, not the testers). Amy used some simple binary questions to eliminate a large portion of the numbers up front. Then, with a limited number of solutions, she switched over to the brain engaged Jon Bach approach. Her best question was "Does the number have any curves in it?" This shows that she had not limited her analysis to the numeric representation that the others had up to this point but was thinking on multiple levels about the problem. Towards the end of the process, she did take a guess, which cost her. Amy solved it in nine, with 1 false bug reports.

4) I was the fifth contestant (tester). Jon Bach had the number. I had seen all three of them attempt to solve the problem and I had been most inspired by Amy's approach towards the end. Some of my questions included, "If you convert the first digit to a roman numeral, does it contain a V?", "If I subtract the first digit from the second digit, is the result negative?", "If you add all the digits of the number together, is the sum greater then 10?", and "If you divide the second digit by the first digit, is the remainder zero?" When analyzing my results, Paul Holland and I discovered that I was still performing basic binary searches, just in a different way. That was not my intent, but that's what happened. Towards the end, I used some of the indirect information Jon gave me to help with the last few remaining numbers. I was able to get Jon talking without asking yes/no questions, and based on the context of what he was saying, and the numbers remaining, I was able to accurately guess the final number. I had the leading score of six questions and zero false bug reports.

5) Our fifth contestant was Paul Holland (tester). I had the number. Paul, like Julian, used a straight binary search and solved it in eight with zero false bugs, but Paul was in a second session and had no prior knowledge of other contestants. He came to the same conclusion right away. Fast. Clean. Simple. Repeatable. Paul is a constant critic (along with Julian) about those of us who did not stick with the binary search. He kept pointing out, that even if we did better once; over time, we would do worse then someone who used the binary search. He is most likely correct.

6) Our sixth contestant was Amber Mikesell (tester). I had the number. Amber started with the binary search, and then tried to get creative with the smaller solution space. She switched to asking questions like, "Is the number divisible by 6?" and "Is the number divisible by 4?" Towards the end, she had a 50/50. Because of pressure (from me), she made a guess and filed a false bug report. She got it in seven with one false bug report. Her defense was that she didn't want to hold the release and took a risk to ship the product. I liked that.

7) Our seventh contestant was Tim Coulter (current Florida Tech student and probably my future boss given his personality and intelligence). I had the number. Most notable in Tim's technique is that he took risks. He combined techniques of those before him using binary searches and creative questions. Paul considered him very lucky with the results of some of his questions. After question five, Tim had more then a couple of possible solution numbers left. Eventually, he asked if the number was 32. He was correct. When I told him it was a lucky guess, he responded that his logic was based on my ability to randomly select a number. Of the numbers remaining, 32 was the only number not a multiple of 10. His logic was that I would not randomly select a multiple of 10. Looking back at all my selected numbers, he was correct. Tim's technique earned him a score of six questions and zero false bug reports. A tie for first place.

Paul and Julian pointed out (after Tim's attempt) that it would be possible to try to eliminate up to 28 extra numbers in your first guess (or two) and still not increase your maximum binary search result. This would essentially allow the possibility of having less than seven guesses if you were lucky in those lopsided guesses. This maximizes the chance of lowering the number of guesses while not increasing your worst case scenario.

It's a fun little challenge. Try it and see how you do.
Simple ROI Model for Testing Automation Projects
In a tutorial on self learning at CAST 2006, I was asked to analyze the first two printed pages of the article Simple ROI Model for Testing Automation Projects by Guy Arieli. To be clear, the material was not complete on purpose. The provided material stopped at

"I hope you didn't get lost in all the formulas. But in order to use this module on a project all you have to enter are the following parameters:"


The following is my general analysis based on what I was given. You will most likely want to have a copy of those two pages as I work through this.



I wasn't given the ability to ask context related questions, so I needed to make some assumptions in my analysis and figure out what my mission is.

MISSION:

For the purpose of my analysis, I'll ask the questions:

  • "Would I find this useful in my daily work?"

  • "Based on what I can interpret given the information available, can I imagine a use for this material?"

  • "How does this compare to my work on the same topic?"



Jon Bach was also given the analysis task. I have the deepest respect for Jon as a tester, so I want to impress him by doing a better job of analysis then he does.

TECHNIQUE:

The first thing I did was identify the variables in use. I created a list of all the variables I saw and how the author defined them. I could identify 16 variables. One of them (BMF) I could not find a definition for. Here is that list:

  • ROI = return on investment

  • TB = total benefits

  • TC = total costs

  • FC = cost to develop automation framework

  • TBB = cost to develop the building blocks of the tests

  • TTD = cost to develop the tests

  • TMF = test maintenance factor

  • TD = efforts to develop new tests for the new version

  • BMF = ?

  • BB = building blocks development efforts

  • M = manual efforts

  • NF = new feature factor

  • i = version

  • TDM = the ratio between tests development efforts to manual efforts

  • BBM = the ratio between building blocks effort to manual efforts

  • RF = the relevancy factor



Next I asked myself if I would know how to calculate (or come up with) all of these variables for any given project I am working on or have worked on:

  • Total benefits: How would I know this at all? What about new applications (not just new versions)? What about non-quantifiable benefits? What about the benefits I don't see?

  • Total costs: How would I know this? What about opportunity costs (the cost of the other things I could have been doing instead of this automation)? What about the costs to other projects or applications within the organization?

  • Manual efforts: Manual efforts for who? Doing what? How do I calculate this? Where do I get the numbers? Based on how many projected bugs? Based on what kind of a relationship with the developers? Based on what level of ineffective management?

  • and so on...



What do the ratios tell me, what are the units, and do they make sense:

  • The NF, or New Feature Factor, seems to be weeks over weeks. That one looks ok.

  • The TDM, or test development effort over manual effort, seems to be weeks over weeks. That one looks ok.

  • The BBM, or building blocks development effort over manual effort, seems to be weeks over weeks. That one looks ok.

  • The RF, or Relevancy Factor, seems to be weeks over weeks. That one seems ok as well.



While I don't know what they all represent, at least the units work out.

Next I scanned the document (or the portion of the document I had available) for inconsistencies. I noted the following:

  1. The title and the first paragraph both say that this is a simple equation. Look at the following equation (this is the full equation after substitution):
    ROIi = ((TB(i-1) x RFi x Mi) - (TC + ((1 + BMF) x TBB(i-1) + (NFi x Mi X BBM)) + ((1 + TMF) x TTD(i-1) + (NFi x Mi X TDM)))) / (TC + ((1 + BMF) x TBB(i-1) + (NFi x Mi X BBM)) + ((1 + TMF) x TTD(i-1) + (NFi x Mi X TDM)))
    Does that look simple to anyone reading this? I think not.

  2. In the first paragraph the author indicates that the question "Will it be profitable?" usually rises when working on a test automation project. This is inconsistent with my experience. I've worked on over 12 different large automation projects at over eight different companies and I've never heard anyone ask if automation would be profitable. This doesn't pass the BS test. It's a highly tuned heuristic for claims about automation.


  3. In the second paragraph the author states that when the ROI becomes positive, the project will be worth investing in. I don't understand this for two reasons. ROI will never be positive until later in time. Thus, it would never make sense to start an automation project. Odd... Second, let's assume I'm just misunderstanding things (which I may be doing on purpose at this point), instead why don't I examine the way I justify an automation effort. Here it goes: "Does the automation free me up to do some other more valuable testing within the time I have?" or "Does the automation allow me to run a test I can't run manually that I think would be valuable?" If either of those are yes, automate. If they are both no, don't. My equation seems much simpler then his...


  4. In the fourth paragraph, the author states that he found this model to be useful in determining what to automate first. I don't see anything in any of these equations that allows me to assign priorities to different automation items. Perhaps this is in the part of the article I'm missing, but it's certainly not justified by the ROI calculation we see in the first two pages. I have a hard time understanding how someone could use this to determine what to automate first.



Finally, I quickly applied my FCCCUTSVIDS heuristic to see what I missed:

  • Feature tour: This made me think of the variable listing I had already done. I couldn't think of anything else that I might call a feature.


  • Complexity tour: This is too complex to be called simple. Tour over.

  • Claims tour: Did this...


  • Configuration tour: How does the equation change based on different methods of automation and reuse? Is this just for regression testing only or is this suppose to also be useful for ad hoc test automation where I might throw a test away after I run it?


  • User tour: Is there a human that could use this? Possible users might include a test manager, project manager, or an academic who needs to publish a paper.


  • Testability tour: I could test this with Excel, real project data, and it would seem to be easy to automate (no pun intended).


  • Scenario tour: Apply real project data from past projects and see what the result is. Compare that to actual results.


  • Variability tour: Didn't spark any new thoughts.

  • Interoperability tour: What size projects is this intended for? Is this only for 10 year 20 person automation projects?

  • Data tour: Real project data seems useful and simple data seems like it would show that this isn't worth looking into. I don't even know where I could find all this data for my projects. I don't even know what all the benefits and costs are for automation, how can I plug in those numbers? What's the scope of this data? Is it just for my project? For a project that reuses some of my components? The organization?


  • Structure tour: Let me show it to you one more time...
    ROIi = ((TB(i-1) x RFi x Mi) - (TC + ((1 + BMF) x TBB(i-1) + (NFi x Mi X BBM)) + ((1 + TMF) x TTD(i-1) + (NFi x Mi X TDM)))) / (TC + ((1 + BMF) x TBB(i-1) + (NFi x Mi X BBM)) + ((1 + TMF) x TTD(i-1) + (NFi x Mi X TDM)))
    ... you have got to be kidding me.



Total analysis time was about 10 to 15 minutes.