12. › It’s
kewl
› HTML5
is
bestest
Web,
why?
› Everyone’s
doing
it,
so
why
not?
13.
14. Building
on
web
is
in
many
cases
more
awesome
than
alternatives
when
building
sw
for
human
end
users
15. › Single
(HTML)
page
load
› Using
«Hypermedia
APIs»
Web
apps?
(a.k.a.
RESTful
etc.
backend)
› Suck
usually
less
than
other
approaches
when
done
right
16. › Involving
humans
less
trivial,
Human
end
i.e.
more
interesting
users?
› Interdisciplinary
approaches
necessary
19. ATDD,
» Test
Driven
Requirements
(TDR)
a.k.a.
» Functional
Test
Driven
Development
(FTDD)
(or
related
to)
» Behavior
Driven
Development
(BDD)
» Story
Test
Driven
Development
» Executable
Requirements
» End-‐to-‐End
Test
Driven
Development
» Customer
Test
Driven
Development
» Business-‐Facing
Test
Driven
Development
» Specification
by
Example
» ...
15.6.2012
Futurice
21
21. Warning:
not
to
be
confused
with
User
Acceptance
Tests
(UAT)
here
–
although
both
are
related…
22. “Begin
with
the
end
in
mind”
–
Stephen
R.
Covey:
The
7
Habits
of
Highly
Effective
People
23. ATDD:
“The
practice
of
expressing
functional
story
requirements
as
concrete
examples
or
expectations
prior
to
story
development”
–
Jennitta
Andrea,
http://www.stickyminds.com/sitewide.asp?Function=edetail&ObjectId=16315
24. “BDD
(and
ATDD
as
well)
is
what
TDD
was
supposed
to
be”
–
Franz
See
in
BehaviourDrivenDevelopment
Google
Group,
2011-‐01-‐31
25. › One
method
in
toolbox
ATDD
among
others
Disclaimers
› Lots
of
skills
and
other
practices
needed,
too
26. › Crystallize
acceptance
criteria:
get
a
shared
understanding
of
reqs
and
def.
of
done
[1]
Goals
› Win
the
bug
battle
with
complicated
systems
[2]:
early
regression
detection
[1]
E.
Hendrickson,
http://testobsessed.com/blog/2008/12/08/acceptance-‐test-‐driven-‐development-‐atdd-‐an-‐overview
[2]
J.
E.
Boal,
http://testdrivendeveloper.com/2011/12/27/AutomatedTestsAreTheKeyToScalingAgile.aspx
27. › Minimize
unnecessary
work
(=
less
YAGNI)
› Solid
regression
tests
enable
Positive
side
incremental
development
effects
› Feels
great
every
time
when
a
bug
that
would’ve
gone
to
prod
was
caught
by
tests
[2]
› Enables
cont.
deployment
[2]
J.
E.
Boal,
http://testdrivendeveloper.com/2011/12/27/AutomatedTestsAreTheKeyToScalingAgile.aspx
28. › Acceptance
tests
=
executable,
up-‐to-‐date
docs
Positive
side
› Enriched
tester
role:
get
rid
effects
of
most
mechanical
work
(cont.)
[3]
› Highly
testable
system
› Trustworthy
specifications
[3]
J.
Andrea,
http://www.stickyminds.com/sitewide.asp?Function=edetail&ObjectId=16315
29. › Too
difficult:
needs
skills,
collaboration,
and
discipline;
or
no
tools
exist
› Not
feasible
to
automate
everything
(in
practice)
Why
not?
› Doing
small,
prototype,
unimportant,
simple
stuff
› Discovery,
spikes
[4]
› Initial
setup
overhead
› «I
don’t
know
why»
[4]
Liz
Keogh,
http://lizkeogh.com/2012/01/30/the-‐real-‐cost-‐of-‐change
31. Steps
Implement:
hammer
the
Design
how
to
fulfill
keyboard
until
all
tests
the
requirement
pass
(incl.
other
tests)
Write
Story
Design
Code
tests
Find
out
most
important
Formulate
test
cases,
thing
to
do,
write
a
user
story
most
probable
path
first
15.6.2012
Futurice
33
35. › have
a
timer
display
with
zeroed
time
and
a
start
btn
What
do
you
› start
on
button
click
need
for
one?
› if
started,
stop
when
button
is
clicked
again
It
should…
› update
the
timer
seconds
and
fractions
when
running
36. 1) Web
browser
of
your
choice
Tech
stack
2) Jasmine
BDD
for
this
session
3) CoffeeScript
(optional)
4) jQuery
(optional)
37. Getting
» Download
and
unzip
Jasmine
BDD
started
standalone
to
a
working
dir
› Try
it:
open
SpecRunner.html
in
browser
› Playing
around
a
bit
› Hack
Jasmine
to
make
it
better
(optional)
» Write
specs
in
code
15.6.2012
Futurice
41
39. Would
also
be
› continue
running
from
where
it
was
stopped
last
pretty
nice
if
› remember
the
last
stopped
the
timer
time
across
app
reloads
could…
› etc…
44. Selenium
» Automation
of
browsers
› E.g.
for
testing
purposes,
or
for
repetitive
admin
tasks
» Selenium
IDE
for
recording
scripts
» Scaling
and
distributing
test
running
» Java-‐based,
with
wide
support
for
other
langs
&
testing
frameworks
16.6.2012
Futurice
49
45. Cucumber
BDD
» Automation
of
browsers
» Describing
behavior
in
plain,
human
readable
text
(Given-‐When-‐Then)
› Higher
level
abstraction
for
tests
» Ruby-‐based,
but
bindings
for
other
langs
exist
16.6.2012
Futurice
50
46. Given-‐When-‐Then
(GWT)
Example
of
a
popular
approach:
» Given
the
shopping
cart
is
visible
and
has
three
items
in
it,
» When
the
user
clicks
an
item’s
trashcan
icon,
» Then
the
item
should
disappear
from
the
list
and
a
notification
should
be
shown
with
the
item’s
name
and
an
“Undo”
link.
15.6.2012
Futurice
51
47. Robot
Framework
» Generic
test
automation
framework
for
various
domains
› Web
part
backed
by
e.g.
Selenium,
but
also
Java
GUI,
SSH,
running
processes...
» Tabular
test
data
syntax
» Extensible
with
Python/Java
16.6.2012
Futurice
53