Session slides from Future Insights Live, Vegas 2015:
https://futureinsightslive.com/las-vegas-2015/
Most API testing is a joke. We have things that resemble Unit Tests which are really integration tests which really just wrap our personal understanding in just a bit of code. And at the end of the day, we’re still not sure it works. Instead, let’s flip the entire experience around and look at it from the API consumer’s point of view and confirm that we’re solving real problems for real users. In this talk, we’ll dive into some of the benefits of Behavior Driven Development and walk through some examples.
7. Assumption:
You have a technical background
APIs are an important part of your job
Use them on a regular basis
Potentially build them too
Sometimes public, sometimes private
15. Behavior Driven Development
Standard Definition:
BDD is a synthesis and refinement of practices stemming
from TDD and ATDD.
Dan North’s Definition (circa 2009):
BDD is a second-generation, outside-in, pull-based,
multiple-stakeholder, multiple-scale, high-automation, agile
methodology. It describes a cycle of interactions with well-
defined outputs, resulting in the delivery of working, tested
software that matters.
16. Get your head out of the system!
What it really means..
17. What it looks like
As a [role] I want [feature] so that [benefit]
18. Well to be more precise
It’s English, but in the Gherkin syntax so this:
As a [role] I want [feature] so that [benefit]
becomes a feature called:
Given [condition] when I [action] then [result]
22. For Clarify.io
The first thing that anyone does:
Creates a bundle (audio or video package)
We need a file (audio in this case)
We need an API key
We need to submit it (POST)
We need to check the results (201 Created)
35. And then…?
Write the feature
Refactor to reuse when possible
Add the left over bits
GOAL: You should be writing less and less code!
36. Our Status
We validate the Helper Libraries with this too
Feature tests for the API using:
Using the PHP library
Using the Python library
Using the Ruby library (newest)
(publicly launching our tests this month here: https://github.com/Clarify )