- In the last stop and think,
we asked you to do some high-level
acceptance tests for this story.
As Gigi the groomer, I want to record
the arrival and departure time of a client's pet
so that we have it for our records.
We asked you to use the given/when/then format,
and then to do the same tests again
in a tabular format with real and concrete examples.
So the happy path that Lisa and I came up with
is we're showing in this given/when/then example,
given the pet arrived at 11:30 a.m.
it took nine minutes to groom.
When Gigi enters the time at 11 a.m.
for a start and a one p.m. for the end time,
then the grooming time is saved.
Lisa, can you think of a misbehavior,
an unhappy path?
- Sure, what if Gigi makes a mistake
when she's entering the times, right?
So given that the pet arrived at 10 o' clock,
took 45 minutes to groom it, when Gigi enters
10 o' clock for a start time and 9:30 for the end time,
then she gets an appropriate error message
because the end time is earlier than the start time
and she has to correct the time.
- Okay, that's a good example.
- But the problem is, we can think of lots
and lots of these examples, right?
And so there are some cases where it
would be awkward to just keep writing
these long tests, and I think this is
an example where it would work better in a tabular format.
- So we've got the start of a tabular format
with some examples.
We have our start time, our end time,
our expected result.
So if I was a tester, I might write these
down on a piece of paper and take them
over to the programmer after and say,
hey, this is what I'm thinking.
And it's the start of that discussion
to automate them.
So our happy path starts at 11:30,
it ended at one o' clock, perfect grooming.
90 minutes, successful change.
- Yeah, and started at 11:30, maybe we want to use
a 24 hour time format, so we say 1300
for the end time, 90 minutes, and then
saved in that time format.
- Right.
And this would be where, if I took this
to the programmer or we're having a
collaborative discussion, he might say
why would we ever do that?
- Yeah, doing different time formats
might be just extra fluff that we don't really need.
- And so maybe we have to start
checking our time formats, right?
That's another kind of test we have to do.
But maybe not for this particular thing.
- I wonder if it would be easier for the groomers
to just have to put the start time
and then how long did it take and
they don't even have to calculate the end time.
- Oh.
Okay, so then the end time is calculated
versus that other time.
That could be interesting.
So maybe we take and say, this is the results.
And maybe this is the time taken.
- Yeah, yeah.
- Okay, so we're talking, we're having a discussion.
- Right, right.
- We might be able to show error messages.
Like what happens if this is your unhappy path example.
- The end time earlier than the start time.
And we could have really complicated scenarios too.
So let's say Gigi works on two dogs at the same time.
Maybe she alternates letting one dry
while she starts the other one.
So how are we gonna handle that?
'Cause they're overlapping, so
we definitely need to talk to the product owner
and the developers about that one.
- So the acceptance tests really give you concrete...
It makes you really understand the story
to help get that shared understanding
to give you examples of all the different
types of things that you may want to test.
And it really helps give you that start
about what code to write.
- Yeah, exactly.
The developers can start working on the story
and have a really good picture
of what they need to deliver.
- And you can automate these?
And then they code 'til they pass.
- Yay. - Yay.
- Let's review what we've covered in
this lesson on testing early.
We talked about how to apply your testing mindset early
to the business problem and how to solve it.
And we talked about using conversations wisely
at the appropriate level of detail.
- [Blonde woman] Guiding development with examples is
a very powerful way to gain shared understanding
of what is being built.
You need the story, conversation,
and the acceptance tests to get a full understanding
of the specifications or the requirements.
- Some or all of these will become
automated regression tests.
We'll talk about that in the next lesson on automation.