Vernon Richards, Paul Berry and myself spoke briefly on various topics at this meetup generating lots of discussion and debate. It was awesome! Here’s Vernon sharing on how testing is like…. Ballet???
Vernon Richards, Paul Berry and myself spoke briefly on various topics at this meetup generating lots of discussion and debate. It was awesome! Here’s Vernon sharing on how testing is like…. Ballet???
I wanted to setup a Ruby development environment on my new Mac Pro (just for kicks!) and did so using a mashup of the resources below:
I’ve documented the steps followed below, mainly for my benefit though others may also find them useful. I’m running OSX 10.6.8.
[1] update rubygems to latest version
$ sudo gem update –system
[2] create .profile and add PATH env variable settings
export PATH=$HOME/.gem/ruby/1.8/bin:$PATH
[3] install RVM (git installed with RVM by default).
https://rvm.beginrescueend.com/rvm/install/
[4] install ruby.
$ rvm install 1.8.7
[4.1] lose the redundant documentation by creating a .gemrc file in home with following content:
gem: –no-ri –no-rdoc
[5] while waiting for 4, create a gemfile in home dir using below settings below:
source :rubygems
# Build stuff
gem ‘bundler’
gem ‘rake’
# General stuff
gem ‘cucumber’
gem ‘rspec’
# Rails stuff
gem ‘capybara’
gem ‘coffee-rails’
gem ‘cucumber-rails’
gem ‘database_cleaner’
gem ‘rails’
gem ‘rspec-rails’
gem ‘sass-rails’
# Non Rails stuff
gem ‘sinatra’
[6] install bundler using:
$ sudo gem install bundler
[7] install various other gems including cucumber & rails using the file created in 5.
$ sudo bundle install
[8] Installing Homebrew makes the MySQL install much easier.
http://mxcl.github.com/homebrew/
$ homebrew install mysql
[9] follow the Homebrew mysql instructions to finish up. I had some additional issues too which were resolved here – http://stackoverflow.com/questions/4359131/brew-install-mysql-on-mac-os
$ mysql.server start
$ mysql -u root -p
All good. Now to get cracking on my web app!
In my last post, I discussed the beginnings of an approach [suggested by James Bach] for testing transition combinations efficiently. To recap – we have a 5 change, 3125 line set of Pairwise results which correlate to a total number of changes (or test actions) to be performed of 15625. We want to execute this set of changes in the most efficient manner possible, preferably by reducing the number of actions . This means eliminating duplicate or overlapping combinations.
Harry Robinson provided me with some pointers in achieving this goal (as did James of course by pointing me in his direction in the first instance). In particular, his excellent paper on Graph Theory Techniques in Model Based Testing. He explains how to construct a 2 switch “safecracker” or de Bruijn sequence. You can see the results of applying the de Bruijn 2 switch algorithm to my model below.
Things are starting to look pretty complex though. Each node has a total of 10 edges, 5 incoming and 5 outgoing. Our next move would be to traverse the graph above and document the resulting sequence, however you can already begin to see that this is likely to prove troublesome and, if performed manually – error prone.
In addition, the graph above only provides 2 switch cover; i.e. all 2 change combinations. We need all 5 change combinations. Generating a 5 switch graph and traversal sequence manually will be exponentially more difficult.
Thankfully, we don’t have to. We can go here and get the algorithm applied to our model with 5 switch cover instead. If we do this, we end up with a 3129 change sequence (actually 3125 changes +4 delimiting [loop] digits) instead of our original 15625. A 200% improvement.
All we need to do now is map the values from the generated sequence to our actions, and we’re good to go.
Of course, the eagle eyed among you will observe that there appears to be some repetition [of combinations of actions] still, and there is. But what the de Bruijn sequence has achieved is “is the shortest string that contains all possible permutations (order matters) of a particular length [5] from a given set” (Math Illuminated).
What, you want proof that the algorithm works? Well good! So would I. But proving an already peer reviewed set of calculations is beyond the scope of this article. If you want to do some reading around though (you can follow some of the links in this blog) and post any comments you have below. I’ll be more than happy to respond!
Now how does Gray code fit into all this? Stay tuned for part 3…
Over the last couple of months I’ve been the recipient of some coaching sessions from James Bach. Our last session was a around a month or so ago now, over which time I’ve been pretty busy editing the latest issue of The Testing Planet and, off-and-on trying to solve the testing problem he left me with. The dilemma was this:
What is Gray Code, and how can it be used practically to solve a testing problem?
I’m going to try to answer this question below, but first we need some context. Not too much because I don’t want to spoil any of James’ lessons, but hopefully enough that you can see how to apply the lessons learned in a day-to-day testing situation.
So – imagine we have a problem. We need to test a system that transitions between states. Let’s assume it’s an algorithm for a robot that can move in 1 of 4 directions, notify us of an error state (blinkng red zero) or not move at all (State 1). The possible state transitions look like this:
We also need to verify that, having performed a state transition, the end state is valid. For the purposes of this example, we have only one state and each change should return the system to the original state.
We can document this information by way of a state model diagram, below where states and transitions are represented by nodes and edges respectively.
It’s important to note here that arriving at an accurate model of the system under test is crucial. Developing a true understanding of the system is what the role of the tester is all about. If the model we use to derive our tests is inaccurate, our tests may pass, but the product will be wrong. When the model is right, if our tests pass we know it is because the system satisfies our criteria, whatever that may be. If the tests fail, because our model is right, we know the system is wrong.
So having arrived at a true understanding of all of the possible states and transitions we now need to determine how to achieve the best test coverage. We could reasonably ask here, what is meant by “best?” and have a few options open to us, but the problem essentially boils down to combinatorial testing. In effect, we need to test for combinations of transitions that may result in improper behaviour. We’d like to do this as efficiently as possible.
The first step is to determine all of the possible transition combinations. We have 5 changes available to us in the model, and each change can be combined with any other transition. That gives us the 5×5 table below:
| Move back | Move forward | Blinking red zero | Move left | Move right |
| Move forward | Blinking red zero | Move left | Move right | Move back |
| Blinking red zero | Move left | Move right | Move back | Move forward |
| Move left | Move right | Move back | Move forward | Blinking red zero |
| Move right | Move back | Move forward | Blinking red zero | Move left |
We can use this information as input for a pairwise algorithm that will provide us with all of the combinations. I like to use TVG Pairwise for this. We end up with 3125 possible combinations, 5x5x5x5x5, or 55. A sample of the output is included below:
Michael Bolton expounds on Pairwise theory in his excellent article here, so I’m not going to dwell on the subject. There is another issue we need to consider.
If we were to examine all of the combinations given to us by the pairwise algorithm, we would find considerable redundancy. Many of the combinations are repeated or overlap with each other. For example, even in the small extract above there is duplication. Consider:
move left:move left:move left:move right:blinking red zero:
move left:move left:move left:move right:move forward:
move left:move left:move left:move right:move back:
In a 3 line subset of our pairwise output we can see there are several repeating sequences of change:
And there will be many more throughout. If we were to run all of the 3125 pairwise combinations end to end, we would end up with a total of 15625 transitions. Clearly testing all of these transitions will be time consuming, even if automated. We already know that there is considerable duplication within the combinations. We need to find a way of reducing the amount of time and effort required to test all of the necessary transitions and eliminate the unnecessary duplication of combinations.
I’ll come back to some possible ways of doing this in Part 2.
So the next #BhamTesterMeetup – 29th March – is starting to shape up. We have an offer of a new, more user friendly (if slightly corporate looking) venue, and a speaker. I am also very grateful that the kind folk at TekSystems have offered to buy some drinks again. Thanks TekSystems!
One of my overarching goals for the Meetup is for it to become much more interactive. I’m not really a big fan of the listen to someone else speak for n-minutes with a Q&A section at the end approach; though on the face of things it has worked quite well so far (thanks to NFocus, Adam Knight, James Bach & yours truly). I’d much rather the sessions were more of a dialogue or debate even. I spoke to Bill Matthews about the problems I experience[d] organising meetups some time ago and, having been involved in some similar events himself, had a few ideas on how to make things more interactive:
The Goldfish Bowl Panel – an initial panel of e.g. 4 people to kick a discussion off and, if someone from the audience wants to join in the discussion, they have to swap places with one of the panel members before they can do so. And so on.
Or –
Tester Speed Dating – one-on-one discussions for set, short amounts of time then everybody changes places by rotating, or similar.
Both of these ideas seem pretty good. Then by chance, I happened upon this discussion on the Software Testing Club forum, and was mightily intrigued by Michael Bolton and James Lyndsay’s comments. The idea of a LAWST or LEWT model seems to embody the spirit of what I’m looking for, though – I don’t think we need to be quite as formal [at this stage, anyway]. My approach in a nutshell (and paraphrasing Michael’s comments) would be:
- A small-ish group of people [8-24] – this is about normal (bordering on low) turnout for a Meetup at present, though numbers fluctuate a bit.
- Present “experience reports” – we all have those, right?
- Take questions and comments from the group – shouldn’t be too much of an issue either…
- Publish the results – we’ll see what can be done about this. Video recording the reports and subsequent dialogue is certainly an option.
So I’m proposing that this is the format that will be followed for future events. You the participant/attendee bring with you your experiences of a test project, to share with the group. You will then get questions and feedback about your approach. Having engaged with this process you will go away with the following:
Insight – into your own strengths and weaknesses as a tester.
Suggestions – how to improve your approach, skillset, tools, thinking etc.
Improved – communication/presentation and testing skills.
And hopefully many more benefits besides.
So what do you think? Are you prepared to step-up and get involved? As mentioned earlier, we already have a speaker lined up for the next event anyway, so really I’m only looking for one or two experience reports to get the ball rolling and give people an idea of how things can be done. If nobody else volunteers, I’ve got some experiences from a recent performance test project I can share about – but would rather get other people up and involved if possible.
Over to you, Brummie testers (and beyond). What are your thoughts?