testing 101: three rules for testing at ombu labs

28
Testing 101 Ombu Labs, February 2015

Upload: ombu-labs-the-lean-software-boutique

Post on 14-Jul-2015

97 views

Category:

Software


0 download

TRANSCRIPT

Testing 101

Ombu Labs, February 2015

Rule #1: If you break the build, fix it.

What’s the build?

Broken build

Passing build

Every pull request has a build

Rule #2: If you fix a bug, add a test.

But how?

rspec

RSpec path/to/project/spec/*

Integration project/spec/requests/*

Services (Unit testing) project/spec/services/*

Models (Unit testing) project/spec/models/*

cucumber

Cucumber path/to/project/features/*

cucumberBecause we don’t use it anymore…

Rule #3: If you add a feature, add a test.

Guidelines

What is the possible input/output of your code?

Test the boundary input parameters for your code

Test the different paths of your code

Apply TDD if it helps you understand the problem

Code defensively, test creatively

How could someone break your code?

Treat your methods like a black box

Thank you!

Questions?