Model the world. Populate the world. Set occurring into motion

DanNorth.net » Introducing Behaviour-Driven Development

It creates a “world,” which is just somewhere to store your objects, and passes it to each of the givens in turn so they can populate the world with known state. JBehave then tells the event to “occur in” the world, which carries out the actual behaviour of the scenario. Finally it passes control to any outcomes we have defined for the story.

The above quote gives some food for thought. Let me extrapolate: if software development is a game of invention and communication then perhaps we could Model the Gameboard, model the context of the pieces on the gameboard and model the invented moves that can ‘occur’ in such and such a particular state of the game. Perhaps game moves then are the behaviour that can be afforded to occur in that context. Moves in context realize UseCase scenarios. Outcomes are results of the moves where Gameboard is affected and new moves are afforded.
Part of my thinking about FUNTOM is this way. Modeling Functional Test by creating Object Model. My Object Model is the pieces of the game. Functional Test is a set of moves in a context. Bugs are found in this exploratory testing kind of way and regression tests are created to guard against future illegal moves (bugs).
I have a quick example: Recently on a project I needed to test results set pagination. Let’s use Google pagination. At the bottom of a Google results page you have a functionality to access pages of results. Google displays pages 1 to 10 each a link to a corresonding page. Then next and previous links to move to next and previous what? Page. This is important because as I will explain was my problem with pagination. But for now back to distinguishing the way Google does it. So, each ‘o’ in Gooooooooogle is a page. The first “Go” is page 1, then each “o” is a page and the last page is “ogle” or so it seems. - Well the last is 10 if you are on page 1 but then if you move to page 2 the last page is now 11. So a new page is revealed that wasn’t there before. Ultimately Google doesn’t tell you how many pages of results there are in your set. It just tells you the page you are on and allows you to click on each page of the next 9 pages. The most it will ever show you are 19 pages of results which we can call a span or range. The range display behaviour is such: the page you are currently on (as long as it is page 10 or greater) is centered in a range and then there are 9 pages before the page you are on and 9 after. Total 19
What I am actually doing here is modeling the Test Object and its behaviour and since I’ve had a similar pagination to test for a customer this example for Google is pretty interesting to me and allows me to demonstrate FUNTOM implementation. The problem was that the results set was always less than 10 pages and rarely 2 and rarely over 20 and I had two extra behaviors that Google doesn’t show in it’s results pagination
So I started with modeling the world, my world of objects in FUNTOM…. draft. TODO: finish this with screenshots and modeling code

close Reblog this comment
blog comments powered by Disqus