Transcript

JAVASCRIPT TESTING & BEHAVIOR DRIVEN

DEVELOPMENT

Conor Sheehan

Experience Designer

@ Cantina

What are tests?

Unit Tests !

Integration Tests

Why tests?

Extending features Adding complexity

Debugging Collaboration

Upgrading

Ever feel anxious about whether or not

your app works?

Testing Philosophies

Test nothing

Verification testing

Test driven development

Behavior driven development

BDD

Readable sentences

“Behavior” over “Test”

Ubiquitous language

Test first

Process

1. Describe behaviors

2. Build to behaviors

3. Repeat

Behavior

[subject]

[expected outcome]

when [event occurs],

given [context].

Behavior

The user

is taken to their account page

when the user clicks my account,

given the user is logged in.

Behavior

The checkout button

is enabled

when the page is loaded,

given there are items in the cart,

and the items are available.

Activity

Describe behaviors

JavaScript Testing

5 days of

Design & Problem Solving

The Tools

Testem

Live coding!

Mocks & Stubs

Activity

Write your own tests

Why write tests?

Behavior-Driven Development

Behavior Statements

JS Tests

Recap

Keep practicing

Work it into your process

Testing in other languages

Now What?

It takes less time

to write good code

than to debug bad code

Remember…

???


Top Related