As I was planning to do a team-wide presentation on Session Based Testing, I just thought I might as well use this opportunity to blog and share my own learning on Session Based Testing and at the same time prepare for the talk. Killing 1 bird with two stones has been one of my repertoires (wait a minute….). I do apologize in advance that I am not able to share out the actual slides since it contains some Microsoft Confidential data. But I’ll do my best to summarize the main point here.
What is Session Based Testing?
Session Based Testing (SBT) is a form of Exploratory testing that is used for rapid testing, on project with tight schedule, or informal/incomplete/changing specifications. It was developed by Jonathan and James Bach, and now being used in many QA organizations, including Microsoft. Here is the original paper (PDF) written by Jon Bach defining SBT. For our test team, Session Based Testing represents an “optimized, ad-hoc E2E testing, but at the same time very disciplined and focus”. For us, it is being used to find bugs quickly and early in the product cycle.
Finding bugs very quickly, and very early is extremely powerful. Let’s think about that for a minute. Tradition test process which test plan needs to be written, follow by test cases, follow by numerous test passes, and then finally we start to see bug count going up. Session Based Testing has a much more lower “cost of entry”. It pretty much short-circuits the whole testing process with the goal of finding bugs. The instantaneous feedback to the development team is extremely beneficial. Now, everybody can gauge how well the product is performing event though it can still be under development. Any bugs identified may also help shape the way code is written, or how the spec is defined. It’s okay if developers do not want to fix these bugs right now (their usual counter-argument is always we are not code complete yet!). But with these bugs staring at their faces everyday, it’s easy for them to realize that they need to crank out better code.
I would want to point out that Session does not and should not replace the traditional test process. SBT’s goal is to lower down the initial cost of testing, and also increase flexibility and serendipity that makes Exploratory so useful. IMO, the combination of Session Based Testing AND a well thought-out test planning is definitely a one-two knock out punches to the major bugs hiding within the code. Every tester should definitely try it.
So, how can it be that SBT is ad-hoc and at the same time focused testing methodology? This more or less bring us to the next topic – the difference between Sessions and Bug Bash.
Sessions VS Bug Bash
As I talked to a few people about SBT, the #1 question that everybody asked is -- “So… what is the difference between Session and Bug Bash?” To the best of my knowledge, here is the similarities and differences between the two:
| | Bug Bash | Session based |
| Ad Hoc | X | X |
| End to End | X | X |
| Real User Scenarios | X | X |
| Mission based | - | X |
| Planned/Organized | - | X |
| Visibility into test execution | - | X |
| Metrics tracking | - | X |
I am not saying that holding Bug Bash is a bad thing. Bug Bash (and dogfooding) has been one of the staple diet for every testing organizations. The more eyes looking for bugs, the better. However, one of the main weakness of Bug Bash is that the whole process is very random and executed in somewhat ad-hoc manner. Many times I would see everybody pretty much find the same bugs over and again. In addition, since everybody is banging on the product at the same time, there is no good way to tell if the product has really been tested as thoroughly as it can, or if test executions are evenly spread out for all the features. And in my humble opinion, the greatest sin of all is that testing knowledge is lost the moment Bug Bash ends.
Session Based Testing is built on top of this same principles, but take it one step further. Test owner should do a little bit of homework on defining what are the test areas that he or she would like to be tested. And then the test owner will create a number of “sessions”, which typically last about 60-90 mins. There is a clear goal or mission of what each session aims to do (e.g. “Test open file dialog in Notepad”). But there is no execution steps defined on what steps to do, or how to go about doing that. Tester essentially becomes monkey tester (with a focus) and let the magic of Exploratory testing kick in.
During session, the tester would need to note down what he or she had done. More or less like micro-blogging or “tweet” if you know what I’m talking about. :) Could be something like this:
- I tried launching the Open File dialog using keyboard shortcut, and I found out that the hotkey to Open is “n” instead of the more traditional “o” (I just made this up). We should keep the hotkey consistent with other applications. Bug #123 filed.
- Dragging the Open File dialog window around, and this seems to work fine as expected. Also drag the window outside of the screen and the window redraws itself back correctly. (again just made this up)
- Tried opening file without extension, and Notepad crashes! Bug #456 filed.
Information such as these are quite critical because it provides a lot of insights into how well the product is doing. Tester can report not only on just the issues that were identified, but also can report on the general feedback of the product itself. This can even be opinions on what the tester thought, whether it works great, intuitive to use, great experience, or just plain out sucks.
Learning through Sessions
I think this is probably the biggest advantage that SBT provided – the knowledge that is associated with it. Since every executed session will produce some form of data, we can then make use of those information to help us increase the quality bar. Information gathered from sessions are really quite simple. Here are some of examples:
- Number of sessions run
- When were they run
- Which target area were executed
- Number of bugs filed
- Any issues raised (that are not considered to be bugs)
- …
With this set of inputs, we can easily perform the following simple analysis. In my team, we just plug the data into Excel and generate a Pivot Table out of it. This way, slicing and dicing the data is just one click away.
- Bug density per each target area.
- Average bug yield per sessions
- Bug trend over a given period of time (Example: Total # of sessions and total # of bugs week by week for the past 3 month). This is another way to pulse check on how good/bad the product is doing.
- Who ran the most sessions/who filed the most bugs
Somebody once said “A picture is worth a thousand words”. So in order to save myself 2K words, let me present to you 2 pictures. :)
Analysis 1: Bug density per each target area
| Row Labels | Total Sessions | Total bugs | | Feature 1 | 20 | 4 | | Feature 2 | 10 | 8 | | Feature 3 | 31 | 86 | | Feature 4 | 29 | 79 | | Feature 5 | 11 | 22 | | Feature 6 | 14 | 37 | | Grand Total | 115 | 236 | | |
By looking at the graph, you can immediately tell that Feature 3 and Feature 4 are somewhat in trouble. The total number of bugs are pretty high compared with the other features. Using this data, you can start off investigating on why quality is lower than other areas.
In addition, a lot of sessions were executed for Feature 1, but the bug yield is extremely low. This might be a good indication that you might want to pull back on running more sessions this feature, and spend time on other area instead.
Okay, let’s do one more:
Analysis 2: Bug trend over a given period of time
| Time | Avg Bug | | Week 25 | 5.60 | | Week 26 | 4.31 | | Week 27 | 2.86 | | Week 28 | 2.68 | | Week 29 | 2.42 | | Week 30 | 1.32 | | Week 31 | 1.13 | | Week 32 | 1.50 | | |
This example just show the average number of bugs filed per week over a 2 month period. It’s easy to see that the # of bugs are trending downwards, which is a good thing assuming that sessions are running constantly. If you see spikes in the trend which is out of place, then it can be due to poor check in or some form of regression. Inversely, if you see a sharp drop, it is something to look at as well.
I hope these 2 analysis help to illustrate some forms of measurement that QA team can derive and use. Session Based Testing has certainly helped our team. First and foremost, we are able to test creatively using Exploratory techniques, but at the same time, we are also disciplined in terms of relying on information obtained by running sessions to help us to be even more productive and efficient.