►
From YouTube: Pair Programming - Let's write a pinning test
Description
**Result:**
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27691#pinning-tests
**What's a pinning test?**
https://wiki.c2.com/?PinningTests
It's a "temporary" snapshot test to pin down behavior that gives you confidence in refactoring. The book Working Effectively with Legacy Code explains it best.
**Does GitLab not have good enough test coverage?**
We are committed to good test coverage (at all levels of testing) and improving this every release, but tests can't prove the absence of bugs (only the presence of them). Whether there is or isn't existing test coverage, adding a pinning test (which doesn't take long) can further help us refactor confidently and quickly.
A
B
Could
be
so
the
way
yeah
I
would
like
to
just
use
ideally
could
just
use
just
two
caps,
because
we
want
to
capture
a
snapshot
of
what
does
this
part
of
the
page
look
like
when
we
had
him
and
then
we
want
to
capture
a
snapshot
of
what
does
it
look
like
at?
When
few
renders
it's
tough
and
if
we're
dealing
with
JavaScript,
we
can
just
use
just
create
snapshots
and
call
it
a
day
if
we're
dealing
with
Hamel
I
was
my
first
thoughts
was
technically
we
could
use
jest.
B
C
D
B
B
My
goal
is
to
look
at
it
from
the
HTML
and
just
did
we
render
all
the
right
data
attributes
that
I
pass
everything
correctly
through
it
and
I
I'm
I'm
up
for
either
one
I,
don't
totally
I
think
if
we
take
a
visual
screenshot,
we
could
be
making
it
more
harder
on
ourselves
of
because
that
takes
into
account
like
browser
configurations
and
stuff
when
we
want
to
compare
to
screenshots
and
things
so
capturing
that
Oracle
consistently
might
be
a
challenge,
but
these
are
good.
These
are
good.
These
are
good
questions.
B
B
B
B
B
Then
I'm
fine,
removing
my
pinning
test
cuz,
that's
not
something
we
want
to
leave
around
because
it's
not
like
a
really
great
test.
They
test
internals
they're,
really
messy,
but
it
gives
us
a
lot
of
confidence
that
we
didn't
leave.
Anything
out
of.
That
effect
like
to
the
point
where
you
need
to
manually
test
things
and
so
approaches
to
this
I
was
planning
on
using.
We
could
use
copy,
borrow
and
r-spec
to
create
it.
So
we
can
use
this
to
create
snapshots
of
HTML.
B
A
Be
it
could
be
piggy
bank
off
the
existing
tests
and
essentially
creating
snapshots
and
Oddie
because
they
exist
like
25
that
do
integration
tests
on
those
could
be
just
you
know,
do
the
snapshot
at
the
end
of
each
of
those
tests
and
then
basically
pin
it
yeah
and
one
thing
by
the
way
is
you
can
actually
start
off
the
Ammar
because
we've
put
to
change
behind
a
feature
flag,
so
you
can
even
do
it
in
one
run.
Theoretically,
you
could
yeah.
B
B
Another
thought
I
had
was
so
one
thing
is
you
pin
it
and
that's
just
we're
just
gonna
take
you
know
we're
taking
HTML.
Writing
it
to
a
file.
The
other
thing
is
asserting
like
that.
The
snapshots
are
the
same
like
if
I
take
that
again
like
did
it
match
and
what's
the
difference,
we
could
try
to
do
all
that
asserting
in
capybara
r-spec
itself,
but
because
I
don't
feel
super
confident
in
r-spec
and
I.
Don't
know
what
the
capability
is.
The
capybara
are
I'm
almost
suggest.
Let's
just
write.
B
C
B
I
could
change
how
we
approach
it,
but
yeah,
let's
get
started
with
it
and
please
direct
me
if
you
guys
see
some
opportunities
for
making
this
better,
but
right
now
the
goal
is
because
we
have
to
capture
a
camel
I.
Think
using
capybaras
gonna
be
the
the
easiest
in
my
opinion,
especially
because
we
have
some
pre-existing
capybara
tests
already
setting
things
up,
we're
gonna,
just
gonna
right
we're
in
capture
HTML,
just
write
it
to
a
file.
B
I'm
gonna
say:
let's,
maybe
not
do
any
visual
snapshots
right
now
and
let's
use
a
bash
script
to
actually
do
the
dipping
and
see
what
happens
all
right.
Let's
check
out
that
wrong
place.
Let's
check
out
that
Ammar
go
over
here
to
front-end
pairs
man.
This
has
been
the
subject
of
front-end
pairs
for
a
few
days
now.
B
C
A
Because
the
future
flag
is
on
by
default
and
actually
my
ideal
on
nico
and
my
idea
was
hey:
if
we
turn
on
the
feature
flag
by
default
and
all
the
tests
work,
then
they
should
have
enough
confidence.
If
we
have
confidence
in
the
tests,
I
might
have
revealed
something
about
my
confidence
in
our
tests.
To
be
honest,
like
I
have
a
lot
of
confidence
in
those
tests,
because
there
are
a
lot
of
tests,
they
are
compared
to
our
actual
common
tests
that
we
have
for
the
community.
So
that's
a
good
point:
yeah,
more
confidence.
Okay,.
B
A
A
D
B
Awesome:
here's
Boyd's
awesome,
okay,
so
yeah
we
could.
We
could
try
to
attach
something
onto
here.
I
would
want
to
just
do
something
clean
like
copy
this
set
up
and
then
just
start
playing
around
with
our
own
one
cuz
I
I
would
I
would.
A
D
B
B
B
So
I
was
thinking,
I,
don't
know,
I'm
a
front
engineer,
I,
don't
know
a
lot
of
art,
spec
I,
don't
know
a
lot
of
copy
borrow.
This
makes
me
nervous
I'm,
not
in
my
comfort
zone
right
now,
but
I
was
excited
to
realize
that
there
is
a
part
of
copy
borrow.
That's
already
writing
to
the
file
system,
but
that's
how
little
I
know
about
Ruby
and
everything
is
I.
Don't
really
even.
C
B
B
So
I
was
gonna
piggyback
off
of
this
and
see
how
they're
creating
their
screenshots.
So
they
end
up.
Creating
this
thing
called
a
saver
which
maybe
we
could
create
ourselves
but
I,
think
I'm
gonna.
Oh
man,
look
at
this
cool
github
feature
I.
B
B
D
B
C
B
And
I
was
gonna
just
so
and
I
think
again:
yeah
we
could
just
use
this
to
save
HTML
I
was
one
to
maybe
not
do
the
whole
page
and
just
do
the
bit
that
we
were
changing.
But
what
do
you
guys?
What
do
you
all
think
do
you
think
we
should
just
get
a
copy
borrow
screenshot
like
we
can
or
do
you
think
we
should.
G
Let's,
let's
try
it,
we
could
probably
do
something
like
within,
like
a
certain
section
of
the
code.
Odhh,
like
you
know
how
r-spec
or
whatever
like
within
element,
do
end
yeah.
B
H
C
B
The
module
name
what's
this,
even
though
it
actually
this
attribute
reader
thing
means
it's
just
like
a
problem.
It
is
oh
look
this
is
it
it's
something
that
we
get
in
our
construction?
Oh
you're,
totally
right,
okay,
I
gotta
go
back
to
our
constructor,
who
constructed
this
again.
Where
do
we
get
that
thing.
B
You
new
saver,
we
pass
and
we're
spreading
some
args
see.
Where
do
we
call
new
saver?
Oh
it's
just
capybara,
it's
the
module
Mike.
If
that
told
you
that
all
right
yeah
so
it
looks
like
we
need
to
see,
is
the
module?
I,
don't
know
I
guess
maybe
they're
doing
this
so
that
they
can.
You
know
test
it
nicely.
It
looks
like
we
just
do:
capybara,
safe
page.
Let's
see
what
happens,
it
saves
thanks.
H
B
G
D
B
B
Okay,
so
I
go
through
a
little
song
and
dance
every
time.
I
check
out
a
new
branch.
I
have
a
script
that
I
shouldn't
just
keep
to
myself,
which
removes
our
cache,
folder
and
installs
yarn
stuff
and
then
runs
bundle
and
then
I
run
GDK
start
and
the
JDK
only
part
of
the
JDK
I
guess
has
to
be
working
for
the
capybara
to
start
up,
but
I'm
not
sure
what
parts
that
is
so
I
just
kind
of
globally
started.
B
B
B
Yes,
all
right
if
you
just
feel
like
jumping
out
a
window,
because
your
tests
are
way
too
slow.
Your
feature
test
when
you're
running
copy,
bard
stuff,
try
adding
spring
to
your
instruction
and
you'll,
soon
be
jumping
around
with
joy.
At
the
5
seconds
it
shaves
off
Oh
was
that
what
MP
was
talking.
C
B
C
B
Because
it
caches
because
I
guess
it
caches
everything
to
see
this
perverse
process
and
yeah,
it's
possible
I
guess
I
can
make
a
file
change
that
it
didn't
pick
up
in
that
cache
or
whatever
I.
Imagine
that
back
Enders
that
are
changing
more
and
more
Ruby
files,
it's
more
relevant
than
maybe,
when
the
only.
B
B
G
B
Just
you
add
it:
it's
it's
like
a
wrapper
for
your
Ruby,
so
it's
I,
guess
kind
of
like
no
daman
yeah
Ramallah
arguments
given
to
expected
zero
to
one.
Oh,
we
must
be
using
like
an
old
cut
or
a
different
copy
for
our
version
to
do
this
safe
path
thing
because
they
did
I
saw
that
they
did
this
version
match.
Does
this
only
won't
version?
One
can
do
this
well,
I!
Guess
we
gotta
save
the
whole
page.
B
E
B
B
C
C
B
I
I
was
thinking
about
this
on
the
side,
while
I
was
talking
after
the
ten
minutes
ago,
it
up
and
I
would
rather
for
us,
because
we
have
existing
tests.
If
we
just
go
off
of
our
existing
tests,
we
don't
have.
We
have
very
little
chance
to
capture
something
that
our
existing
test
might
be
missing.
So
what
I'd
rather
do
is
just
look
at
our
source
and
we're
gonna
see
some
of
the
rails
conditions
here
that
we
need
to
that.
B
And
some
of
them
are
testing
because
we
only
changed
like
this
block,
and
some
of
them
are
gonna,
be
testing
things
that
really
we
have
a
high
high
confidence
remain
the
same.
So
we
want
to
make
sure
that
things
like
this.
This
are
caught
and
we
don't
have
a
lot
of
compliments,
but
that
condition
is
actually
tested.
Yet.
B
So
that's
that's
my
that's
my
concern
so
I
think
I
don't
want
to
spread
this
to
everything,
but
I
do
want
to
borrow
a
lot
from
the
other
test
as
much
as
we
can.
Okay,
okay,
but
here
we
have
a.
We
have
a
and
I.
Don't
know!
Why
put
it
to
us,
because
I
did
go
up
a
directory
if
you're
cool
with
it
living
in
that
directory.
I
guess
we
could
just
put
it
here,
but
I,
don't
think
I
want
to
wait.
B
Another
three
point
three
seconds
so
believe
we
leave
it
in
pens
for
now,
but
I'm
gonna
rename
this
now
I
guess
we
can
just
call
this
few
yeah,
let's
go
ahead.
Let's
go
get
a
certain
name.
It
just
call
this
one
to
be
full
of
one
it
working
gives
10,
but
then
I'm
gonna,
add
manually,
add
one
to
Oracle,
I'm
gonna,
add
a
prefix
called
Oracle
and
we're
gonna
save
it
out
and
then
we're
gonna
recreate.
E
B
B
Yeah
we
could
try
it
here.
I
always
want
to
get
like
an
actual
like
a
unified
disc
put.
So
we
can
easily
read
it
and
I.
Don't
know
how
to
do
that
in
r-spec.
I
do
know
how
to
do
it
in
bash.
We
could
like
call
from
here.
We
could
look
up
and
see
hey.
Do
we
want
to
see
if
we
get
a
unified
dish
in
our
spec
and
that
might
be
cool?
Do
you
want
to
do
a
little
bit
of
research
to
see
if
we
can
get
that
this
output
in
our
spec,
or
maybe.
C
B
B
B
F
D
B
E
B
Okay,
it
looks
like
I
can
run
it.
Like
this
side.
Note
I'm
gonna
rant
on
something.
If
anyone
ever
wants
to
create
an
mr.
That
removes
this
dot
from
the
end
of
PS
went
I
would
love
that,
but
that's
why
I
can't
just
run
yarn
run
es
line
for
a
specific
file,
because
this
is
wrapped.
This
is
blocked
that
hole
Bend.
As
now
we
run
this
whole
script.
I
was
looking
to
see.
Do
we
have
a
prettier
script,
so
I'm
not
I,
can't
run
this
on
specific
violence.
It's.
B
D
B
No
parts
yet
okay,
they
all
right
and
that's
cool,
we're
just
gonna
rename
this
to
dot
oracle
dot
HTML,
but
these
actually
they
need
to
be
different
because
we
had.
This
is
with
the
feature
flag
on
and
then
we
we
did.
The
awaited
yeah
the
peonies
they'll
be
GL
one.
The
Oracle
is
the
one
with
the
feature
flag
on,
because
that's
the
first
one
did
right.
So
this
one
really
needs
to
be
ten,
and
this
one
needs
to
be
the
Oracle
which
is
which.
E
B
H
C
B
B
F
B
E
B
B
B
Okay,
great
so
here's
the
here's,
the
meat
of
it.
Look
at
this
look
at
this.
That's
awesome:
okay,
cool!
We
have
some
SVG
differences,
which
is
expected.
There's
one
interesting
thing
here
where
this
div
as
a
can
admin
list
before
and
here
it
doesn't.
What
do
you
think
that's
all
about
please
on
the
right,
then
you
won't
build.
It
says:
Oracle,
the
Oracle
has
an
admin
list
and
well
Ken
does
not.
C
E
B
C
B
C
C
B
C
A
C
B
B
E
B
G
C
C
B
You
saying
yeah
yeah,
okay
for
fun,
then
I
am
gonna
roll,
it
back
and
we're
gonna.
Do
we're
gonna
create
that
pinning
test
before
our
before
we've
made
these
changes
just
so,
we
can
see
what
see
what
happens
unless
everyone's
like
hey
this.
You
know
this
difference
doesn't
mean
anything
chill
out.
I
mean
at
least.
We
know
that
the
decisions
is
something
that
we.
C
B
C
B
Got
it,
and
so
this
is
different,
we've
establishes
because
we
didn't
run
this
Oracle
before
we
introduced
some
changes.
I
see
correct,
which
does
mean
that
there's
a
change
when
this
feature
flag
is
off
to
what
master
is
doing,
which
is
adding
this
attribute
there,
but
which
is
harmless.
That's
something
that
you
could
tell
me
like.
Oh
yeah,
and
it's
more
icon
stuff.
It's.
C
B
B
B
The
only
thing
I'm
concerned
about
is
that
this
isn't
a
valid
attribute
and
that's
I'm
I,
don't
think
it's
a
huge
deal,
especially
that
we
have
high
confidence,
is
gonna
work,
we'll
probably
not
can
turn
the
feature
flag
off
unless
we
want
to
spend
some
time
resolving
this
difference,
but
it
does
bring
up
something
interesting
of
when
we're
doing
this
pin.
Since
we
didn't
introduce
a
feature
flag,
pens,
yeah,
it
was
confusing
that
we
did
run
it
not
on
master
and
now
there's
a
feature
flag.
B
B
E
B
If
this
is
just
a
trivial
like
we're
just
throwing
it,
this
is
doing
condition.
That's
what
I'm
really
concerned
about,
if
we're
doing
condition,
if
we're
ejecting
different
values,
this
I'm
not
concerned
about,
because
we're
just
throwing
in
a
tag
and
we've
already
concerned.
We've
already
know
that
we're
doing
is
tagged
correctly.
I
guess
I'm
really
concerned
about
seeing
different
conditions,
and
we
can
borrow
those
conditions
from
other
specs
for
sure
and
I
think.
B
G
C
B
Or
not,
oh,
no,
it
is
in
a
different
file.
It's
in
the
show,
I
think
gay
over
here.
Here
we
go,
can
add
men
list,
oh
yeah,
yeah
I
think
we
meant
to
do
something
like
okay.
This
is
always
going
to
be
true,
yeah
and
I'd
like
to
prove
that
something's
wrong
with
the
pinning
test.
But
let's
not
worry
about
that,
but
I
think
we
want
to
do
this
right.
B
B
B
B
To
inject
this,
as
a
property
is
kind
of
riddled
throughout
this
component
for
things
like
can
we
add
men
this
list,
so
we
need
to
move
these
conditions
over
to
few
to
make
things
more
complex.
It's
not
like.
We
can
just
throw
a
data
attribute
on
to
the
our
mounting
element.
This
mounting
element
takes
a
whole
nother,
like
view
template
as
its
child.
So
what
we're
trying
to
do
with
cannon
and
list
here
is.
B
C
B
C
B
If
I
seem
paranoid
with,
like
you
look
at
all
this
like
man,
why
is
Paul
doing
you
know
so
much?
Why
is
he
being
a
little
anal
retentive
about
this?
It's
because
I
don't
have
a
lot
of
confidence
for
our
some
of
our
testing
stuff
I,
add
either
level
and
we
could
try
to
crock
of
whether
something
is
being
captured
correctly
or
not.
But
sometimes
we
just
rock
forward
to
something
exists,
and
we
haven't
done
the
other
case
of
like.
B
Whenever
I
do
these
refactorings
it's
nice,
that's
one
layer
of
net
is
our
existing
test
cases
and
it's
a
good
light
and
it's
a
good
net,
but
I
don't
have
I,
don't
trust
it
as
a
I.
Don't
completely
trust
I
want
to
do
this.
Pinning
test
is
an
exercise
that
this
is
another
net
and,
as
you
see
like
some
things
are
kind
of
popping
up
and
now
we're
asking
some
some
interesting
questions
of.
B
B
D
C
D
C
B
C
D
B
E
B
E
C
B
C
E
C
B
B
B
C
B
B
D
D
C
B
B
B
B
Yep
or
delete
yep,
yeah
and
you're
right.
This
is
not
showing
up
because
we
didn't
have
any
lists
our
test.
We're
not
good
enough
good
call
me
good
sorry
about
that,
which
means
that
we
might
not
even
been
loading
that
yeah.
It's
a
good
thing
that
we
did
this
now.
We
probably
don't
have
much
more
interesting
pens
when
we
run
this,
let's
run
it
again,
let's
see
what
these
are
like
and
then
we
can
call
it
and
I
see
that.
B
F
F
B
D
B
You
know
yeah,
but
you
can
see
this
batch
script
is
pretty
tribulus.
We're
just
gonna
run
this
specific
art
spec,
then
we're
gonna
run
prettier
and
then
we're
just
gonna
run
div,
and
if
we
were
like
with
any
kind
of
snapshot
test,
it's
good
to
get
rid
of
noise.
So
we
could
do
like
some
sort
of
regex
replacing
if
you
wanted
to
and
actually
have
a
pipeline
green
here.
But
since
this
is
something
temporary,
we
don't
have
to
over
think
it
all
right
enjoy
yeah,
just
eyeballing
it
as
it's
good
enough
to,
but.
C
F
E
F
B
B
You
know
that's
a
good
again
I'm,
overlooking
there
is
some
like
man,
I
wish.
I
guess
more
will
not
be
I
need
to
let
it
make
all
these
things,
but
it's
a
Vanagon
typically,
but
this
looks
good
I'm
looking
at
the
as
maintainer
one
and
then
let
me
look
at
this
one.
Did
we
find
that
the
leaky
no
I,
just
like
scrolling
I'm,
like
yeah.
C
B
B
C
Wonder
what
it
will
take
to
run
healing
tests
on
each
and
every
page
of
term
I
have
a
small
dream
in
my
drawer,
that
is
to
fry
the
everything
that
is
in
named
ojs
all
that
JavaScript
that
runs
on
every
page
and
just
like
jQuery
that
attach
itself
left
and
right
and
this
kind
of
stuff,
yes,
yeah
I,
am
so
afraid
to
touch
it.
Because
you
know
there
is
no
tests
for
that
right
and.
B
For
this,
this
strategy
pen
test
is
when
there
is
no
test
like
we're.
Gonna
we're
not
gonna,
write
good
tests,
we're
just
gonna,
totally
pin
it
down,
and
it's
helpful
for
some
of
those
areas
of
our
code
base
sort
of
like
that.
Just
one,
thankfully,
isn't
isn't
really
a
lot
like
that,
but
all
right,
I
think
I'm
in
as
an
admin
I'm
gonna
pretend
to
be
a
user.
That
is
a
guest,
then
maybe
as
one
as
a
developer,
we
do
have
the
feature
I
mean
Gustavo
is
definitely
yeah.
B
B
E
D
B
Is
so
there
is
like
a
ven
mode
and
I,
don't
know
how
to
activate
it
or
really
how
to
use
it.
There
are
like
you,
can
you
can
activate
them
mode
and
do
like
lots
of
dishes
stuff
who
uses
it
all
the
time
I
think
Dennis
King
uses
it
a
lot
of
it,
but
I
don't
know
how
to
use
it.
So
it
looks
like
developers
can
see
this,
so
so
it
is
legit
unless,
unless
that's
not
how
it
is
on
master
but
I,
don't
think
you
change
anything
like
well
all
right.
B
A
C
C
B
C
C
B
C
B
We
wouldn't
have
to
poke
around
at,
like
still
when
legacy
code
gets
really
legacy
on
and
not
like
get
labs
code.
Here's
legacy,
but
there's
were
definitely
unfamiliar
with
it
and
now
we're
trying
to
capture
what
are
the
requirements
and
stuff.
If
we
ran
our
Oracle
on
master,
we
would
know
for
sure.
Yes.
B
Think
that's
the
best
the
change
I'm
gonna
make
so
that
hey,
we
know
for
certain.
If
there's
no
diff
can
have
I
think
we
can
move
forward
some
confidence
as
marks
and
let's
leave
this
in
the
commit
history,
but
the
way
I'm
gonna
organize
the
commits
and
I'll
share.
My
screen
is
last,
but
so
I
am
gonna.
Do
a
forced
push
with
this,
but
the
way
I'm
gonna
organize
the
commits
is.
B
Then
we
do
this
currently
thing
and
then
we're
gonna
run
it
both
with
the
feature
flag
on
and
off.
This
is
gonna,
give
us
different
context
and
so
then
run
with
FF
on
and
off,
and
so
this
is.
This
is
the
branch.
This
is
a
commit.
We
could
do
some
manual
checking
of
because
we
we
could
spend
time
like
actually
simply
get
a
green
pipeline,
but
let's
not
worry
about
that.
B
F
B
They
actually
won't
even
need
to
run
it
at
all.
My
goal
is
to
I
mean
I
was
gonna,
run
it
I,
guess
they
could
run
it.
I
was
gonna,
run
it
and
then
just
commit
these
files
as
well.
So
they
can
also
just
manually
check
it,
but
it
makes
sense
yeah.
They
could
have
run
it,
but
will
will
mean
we
already
have
where
if
the
feature
flag
is
on
and
off
so
rather
than
Oracle
pen,
this
would
just
be
FS.
B
B
And
that's
I
was
thinking,
let's
put
them
in
version.
Control
agreed
I.
Think
that's
the
right
idea.
Oh
yeah,
since
we're
gonna
clean
it
all
up,
anyways
yeah,
that's
that's
the
cool!
So
hey!
This
is
a
lot
of
fun
and
this
actually
was
a
lot
better
than
I
thought.
It'd
go
so
I
was
nervous
about
spending
an
hour.
Writing
files
in
Ruby,
so
I'm
glad
that
this
one
better
than
that,
but
yeah.
If
you
have
any
thoughts
or
comments
or
I'm
ready
to
close.
F
A
B
F
B
I'd
love
to
include
your
example,
and
maybe
we
should
maybe
we
can
add
something
really
to
the
front
end
guide'
or
one
of
our
this.
This
is
cross
front
end,
but
maybe
we
should
add
something
to
our
developer
guide
of
hey,
try
doing
pinning
test.
Here's
some
examples
that
we
include
link
to
this
video
and
a
link
to
you
had
an
example
and
I
have
one
from
the
past.
That
might
be
really
cool.