Hi.
I thought I'd take the opportunity to quickly go over a technique that we don't
use as often as we probably should, which is diagramming the flow of the system.
Now,
the reason I'm doing this is I caught a bug in one of my applications yesterday
by doing exactly this: flow type testing.
And recently I was going back through some of my old books and this is
Diagramming Techniques for Analysts and Programmers by James Martin and Carma
McClure, and I'm not suggesting that you buy this book, you can get it cheap.
It's got lots of diagramming approaches.
But I want to revisit at some point a lot of the stuff that I learned at
university that people simply don't learn anymore and have helped me.
And we probably don't use them as much as we should.
Although if you look through a lot of the formal,
what we learn in ISTQB or what we learn in ISEB or what we learn in old books,
or...
They have a lot of techniques based on structural flow,
path analysis, graph analysis,
but very often they call those white box techniques.
They don't need to be.
What we need to get in the habit of is drawing diagrams of our applications to
help us understand them. They don't need to be formal state diagrams.
They can be very simple things. I'm going to show you a quick example of that .
And they're kind of covered in here.
So I'll probably do more videos on that later on.
But as a quick worked example and just to make it real,
I'm going to have a quick look at Google. Okay, so here we are.
So you can see my messy desk in here as well.
What I'm going to do is I'm going to draw the path I'm seeing up here.
So sometimes we try and make distinctions between,
is this a structural model, is this a logical model?
Doesn't matter at this point all I'm going to do is draw, or model,
what I think is happening.
So I'm going to say, um, Google...
You might not be able to read this exactly as we go through.
I'll scan this in and have it up there at the same time.
And this is just how we're getting started.
This is a new thing trying to do over the shoulder stuff.
Eventually I'll figure this out. So I'm at Google,
I've got an input box, I've got Google search, I've got,
I'm feeling lucky and that's what I'm going focus on.
I'm not going focus on all the rest of the other stuff,
otherwise my model will get too big. Anytime we're doing a model,
we have to be constrained in what we do. Otherwise it just gets too big.
And I'm not going to concentrate on whether this is a state model or anything
I'm just going to have a flow. So I've got Google search. If I click,
so I'm just going make a note. And I've got a Google search.
I'm going make that look like, a button by making it a bit square.
You see that?
And I'm going to go have an, "I'm feeling lucky" I'm feeling...
Button. Now. Clearly, if I was doing this on my own,
this would be a much faster process.
But because I'm slowing this down to explain it as I go.
So I'm going to try Google search with nothing.
Click the button. Nothing happens.
So when it's empty I go back to the Google search box.
If I'm going to try, I'm feeling lucky when it's empty. It's,
I'm feeling lucky when it's empty. Does something and that's a,
a doodles and going to do back and I'm wondering whether it goes to the same
place. Cause I'm feeling lucky. It's supposed to be random.
So with nothing in it, it seems to always go off to doodles. So if...
I put in this could be really risky.
I have no idea what we're going to get back. So I'm going to put in ... yeah,
let's do cards as weapons because that's a fantastic book I'm going to do,
I'm feeling lucky.
So it's gonna I so it's taken me off to Amazon.
So go back cards as weapons.
I typed that in and I got a search. I don't think I hit return.
So That's interesting. How am I going to model that?
So typed in text went off to results.
Now you can see I'm making mistakes as I do this. Right.
Cause I'm trying to get my head around this and that's fine.
And this is for my notes.
It doesn't necessarily have to be particularly readable.
This is to help me understand what's going on.
I need to check that again because I'm pretty sure I didn't hit return but I
might have done. "Cards as weapons"...
come out of that. It didn't do anything. Maybe I accidentally clicked something.
Maybe I clicked on that. Right. So I might have clicked on that.
So um, we've got in Google,
when I type in text there's an auto complete,
which when I click on it it goes to results. So Google,
I type in some text, it does auto-complete and it goes to results.
When I click on the auto complete, if I type in some text directly
"cards as weapons", click off the side.
Let's see if I can get my keyboard less wobbly. There we go.
Then I go off to Google.
So "cards as weapons" text goes into Google
then...
So you can see here my diagrams get a bit messy.
That's why I'm doing it on paper first. I'm not doing a formal diagramming tool,
I'm just doing it on paper to get this sorted out.
Because I can redraw this later on. If I get confused. So...
But what I can see is I can see the kind of experiments that I've done.
So I know that I've done Google with,
I'm feeling lucky and no text goes to doodle.
I haven't done Google some text and I'm feeling lucky cause I don't have a path
for that. I don't know where that goes. So I'm going to put that in... Google.
Some just some text.
I, I've just got a floating Arrow here. I don't know where that goes. So I,
that's something I have to do in the future.
That's some coverage I haven't achieved yet.
So I've also got my Google search empty going off to Google,
Google typing in some text. It goes back to Google,
Google type in some text and auto-complete click goes to results.
So presumably Google search, which I haven't done yet,
is going to go off to results. So let's try that. Typed in "cards as weapons".
Google search goes off to a search results.
So I have here a model of the Google search process.
I haven't finished. We've got no coverage here, So.
Let me do go back,
type it in cards as weapons.
Careful not to click on the link because we know something happened.
Oh look I didn't notice that. Did you notice that?
So in here I've got a Google search button here and an I'm feeling lucky button.
So as I text there's more options in here.
So I'm going to add that into the graph. So Eh, what will I call that...
In dialogue buttons,
now these might even be the same buttons. These might even be the same buttons.
Text in dialogue buttons.
I haven't looked in the DOM to know whether they're the same buttons.
So I'm just going to make a note that on my,
because then that will investigate. So I write questions down here.
This is a modelling process. This isn't necessarily a formal modelling process.
So I'm not going to click that button cause I'm going to leave that as a path.
So if I want it to, I could check now whether it is the same button.
But I'm just going to do cards as weapons. I'm feeling lucky
and it's gone off to Amazon, is it always going to go off to Amazon?
Cards as... I mean that's not very lucky.
That's pretty definite. I'm feeling lucky. Amazon.
All right, so not necessarily.
I wouldn't class that as a particularly good "I'm feeling lucky" cause I'm
pretty sure there's other sites that cover that. Right.
So I'm feeling lucky it goes off to Amazon,
for cards as weapons should it?
So I'm going to put that in as a question.
Google, Amazon for cars as weapons. Should it? But I'm wondering now,
because I keep hitting the back button. Is that why it's doing this?
Maybe if I do a refresh, maybe there's,
I get a different session cookie maybe then it chooses something different.
Maybe it uses that as part of a random seed cards as
weapons, click here. I'm feeling lucky.
Amazon again, so I'm not sure if it do, it should do that or not.
I'm pretty certainly shouldn't.
I'm not sure why I'm getting the same results back.
What I have now is
I've got a relatively complete map in the sense that these are all end points
now. I could model these as end points. If I had a formal notation,
I've kind of put in what looks like buttons in here I've got eh,
the various processes, the paths. I could start, if I tidy this up,
I could explore this in terms of the paths.
Then what I can see when I'm doing this is that some things are absolute,
they are fixed for the path, so the buttons that I'm using,
whether I use the button that's there on the screen now,
or the in dialogue button, they are fixed.
What is varying is data over the path.
The search term is varying over the path and that is all I know at this level
because I'm working at the GUI.
Now. If I chose to start looking at network traffic,
start looking at the variables on the page, start looking at the cookies.
I might see that there's more variation in messages being sent back here because
I may well have different session cookies and may well have different session
ids and may well have IDs in there.
Perhaps that's why I'm feeling lucky it's only ever going to Amazon because it's
the same information being passed across and I'm not aware of that because I'm
only looking at it from the high level.
But this gives me some scope for working in testing.
And if I was doing this on a bigger system and I made a map like this,
what I've done in the past is I've had a red pen, or a green pen,
which I've got to hand here. And I could say, right,
well I've done this path so I've done,
I'm feeling lucky.
I put the the Green Line in to represent that and I can see from my model then
what I have covered and what I've not.
Because one thing we have to be aware of is coverage in testing is model based.
It is always model based. Even if it's informal like this.
What we mean by coverage is we're covering some sort of model,
even if it's a set of test conditions or set of ideas,
that would be our coverage because that's the model that we've got. Here.
When I've got more graph type model,
and this isn't using formal notation,
you couldn't class this as formal graph testing,
but I'm certainly doing path testing on this and I can have a coverage of "what
paths I am doing". I could record what data that I do over those paths.
Currently it's just been cards as weapons.
I can have other terms down here. If I went down to a more detailed level,
I could put this through a proxy. I could track all the tests there,
could see later on what other data was going back and forward.
But that's a rough.... If you're not doing this kind of work and have never,
if you've never done this kind of diagramming process or tried to use this in
your part of your testing,
I recommend you give it a shot because it is a useful thing to add and you don't
need to go as formal as this. Um, and this is a really old book,
but I'm pretty sure it covers, um, path type stuff,
but it doesn't cover testing, right? So it's got lots of path diagrams in here.
There's an entity, there's a structured entity type diagram.
That's the flow diagram. There's a
procedure type diagram, and there's a,
it looks like a decomposition entity life history type diagram.
We've got data flows. This isn't data flow.
This is a process flow that I'm drawing,
but it's worth being familiar with these types of things.
You can probably look them up on Wikipedia or anything like that,
add some diagramming into your testing and it will really help you out.