SlideShare a Scribd company logo
1 of 37
Download to read offline
Is Your API
Misbehaving?
D. Keith Casey Jr
keith@clarify.io
@CaseySoftware
Who am I?
Who am I?
Clarify.io -
The API for businesses
to build apps that
Search and Understand
their Audio & Videos
Who am I?
http://TheAPIDesignBook.com
• Assumptions
• The Problem
• Enter BDD
• BDD in Practice
• BDD at Scale
• Next steps…
• Assumptions
• The Problem
• Enter BDD
• BDD in Practice
• BDD at Scale
• Next steps…
Assumptions
• 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
7
Assumptions
• Nothing is perfect
• You make mistakes
• Your providers make mistakes
• That other team are knuckleheads
8
• Assumptions
• The Problem
• Enter BDD
• BDD in Practice
• BDD at Scale
• Next steps…
• Click Tests - someone
• Unit Tests - xUnit suite
• Integration Tests - still probably xUnit
• Web/UI Tests - Selenium, Watir, Testlio (mobile)
API Testing is Deceptive
10
… no seriously.
API Testing Sucks
11
Two Goals
Prove* that it works (now)
Give us confidence (later)
12
Back to the Drawing Board
13
• SMART
• Specific, Measurable, Achievable,
Relevant, and Time-boxed
• INVEST
• Independent, Negotiable, Valuable,
Estimable, Small, Testable
• Assumptions
• The Problem
• Enter BDD
• BDD in Practice
• BDD at Scale
• Next steps…
BDD - Standard Definition
15
BDD is a synthesis and refinement
of practices stemming from
TDD and ATDD
BDD - Dan North
16
BDD is a second-generation, outside-
in, pull-based, multiple-stakeholder,
multiple-scale, high-automation agile
methodology. It describes a cycle
with well-defined outputs, resulting
in the delivery of working, tested
software that matters.
BDD - What it really means
17
Get your head out of the system!
BDD - What it looks like
18
As a [role], I want [feature]
so that [benefit]
BDD - To be more precise
19
It’s English but in the Gherkin syntax so this:
• As a [role], I want [feature] so that [benefit]
becomes a feature (or spec) structured as:
• Given [condition], when I [action] then [result]
• Assumptions
• The Problem
• Enter BDD
• BDD in Practice
• BDD at Scale
• Next steps…
In lots of languages
21
• Java - JBehave
• Ruby - RBehave -> RSpec -> Cucumber
• PHP - Behat
• Python - Behave
• C# - NSpec
• Javascript - Cucumber-js & Jasmine
So let’s do this!
Start small.
So let’s do this!
https://github.com/caseysoftware/is-your-API-misbehaving *
* I don’t like Github as an organization but didn’t
have time to convert all of this and fully test it
with Gitlab which is a better product and company.
Using Github…
24
• Let’s start with search
• Write the story
• Add the stubbed methods
• Write the methods
• Validate the results
• simple-search-step-{n}-{description}
Using Github…
25
• Now, let’s get the issues for a repository
• Write the story
• Add the stubbed methods
• Write the methods
• Validate the results
• issues-list-step-{n}-{description}
Using Github…
26
• Now, let’s get all of your repositories
• Write the story
• Add the stubbed methods
• Write the methods
• Validate the results
• authentication
• myrepos-step-{n}-{description}
Using Github…
27
• Now, let’s watch a repository
• Write the story
• Add the stubbed methods
• Write the methods
• Validate the results
• watch-repo-step-{n}-{description}
Using Github…
28
• Now, let’s fork a repository
• Write the story
• Add the stubbed methods
• Write the methods
• Validate the results
• watch-repo-fork-step-{n}-{description}
Using Github…
29
• Now, let’s create a repository
• Write the story
• Add the stubbed methods
• Write the methods
• Validate the results
• create-repo-step-{n}-{description}
• Assumptions
• The Problem
• Enter BDD
• BDD in Practice
• BDD at Scale
• Next steps…
And now what?
31
• Write the feature
• Refactor to reuse steps when possible
• Add the missing bits
• GOAL:
• We should be writing less and less code!
Next Steps?
32
• We can validate other helper libraries too
• One set of features/specs for the API using:
• the PHP library
• the Ruby Gem
• the Python library
• Assumptions
• The Problem
• Enter BDD
• BDD in Practice
• BDD at Scale
• Next steps…
todo next?
34
Lots of things!
todo next?
35
But remember:
Start small and iterate!
D. Keith Casey Jr
keith@clarify.io
@CaseySoftware
Is Your API
Misbehaving?
Who am I?
http://TheAPIDesignBook.com

More Related Content

What's hot

Essentielle værktøjer for det agile team
Essentielle værktøjer for det agile teamEssentielle værktøjer for det agile team
Essentielle værktøjer for det agile team
BestBrains
 

What's hot (20)

From Heroku to Amazon AWS
From Heroku to Amazon AWSFrom Heroku to Amazon AWS
From Heroku to Amazon AWS
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to Go
 
import continuous.delivery.*
import continuous.delivery.*import continuous.delivery.*
import continuous.delivery.*
 
Pipeline all the Dashboards as Code
Pipeline all the Dashboards as CodePipeline all the Dashboards as Code
Pipeline all the Dashboards as Code
 
Just startcoding
Just startcodingJust startcoding
Just startcoding
 
Introduction to jOOQ
Introduction to jOOQIntroduction to jOOQ
Introduction to jOOQ
 
Refactoring Rails applications with RubyMine
Refactoring Rails applications with RubyMineRefactoring Rails applications with RubyMine
Refactoring Rails applications with RubyMine
 
From Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivFrom Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, Lviv
 
Deploying your SaaS stack OnPrem
Deploying your SaaS stack OnPremDeploying your SaaS stack OnPrem
Deploying your SaaS stack OnPrem
 
Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)
 
My Contributor Story
My Contributor StoryMy Contributor Story
My Contributor Story
 
GitOps , done Right
GitOps , done RightGitOps , done Right
GitOps , done Right
 
Essentielle værktøjer for det agile team
Essentielle værktøjer for det agile teamEssentielle værktøjer for det agile team
Essentielle værktøjer for det agile team
 
Building and Deploying MediaSalsa, an Open Source DAM as Saas platform
Building and Deploying MediaSalsa, an Open Source DAM as Saas platformBuilding and Deploying MediaSalsa, an Open Source DAM as Saas platform
Building and Deploying MediaSalsa, an Open Source DAM as Saas platform
 
Agile Software Development Techniques for Daily Use
Agile Software Development Techniques for Daily UseAgile Software Development Techniques for Daily Use
Agile Software Development Techniques for Daily Use
 
improving the performance of Rails web Applications
improving the performance of Rails web Applicationsimproving the performance of Rails web Applications
improving the performance of Rails web Applications
 
UPenn on Rails intro
UPenn on Rails introUPenn on Rails intro
UPenn on Rails intro
 
Notes From Velocity Conference Europe
Notes From Velocity Conference EuropeNotes From Velocity Conference Europe
Notes From Velocity Conference Europe
 
Open Source Monitoring in 2019
Open Source Monitoring in 2019 Open Source Monitoring in 2019
Open Source Monitoring in 2019
 
Embracing Continuous Integration
Embracing Continuous IntegrationEmbracing Continuous Integration
Embracing Continuous Integration
 

Similar to Is Your API Misbehaving (workshop)

Similar to Is Your API Misbehaving (workshop) (20)

BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Integrating RightScale, Windows, and .NET for Fun and Profit - RightScale Com...
Integrating RightScale, Windows, and .NET for Fun and Profit - RightScale Com...Integrating RightScale, Windows, and .NET for Fun and Profit - RightScale Com...
Integrating RightScale, Windows, and .NET for Fun and Profit - RightScale Com...
 
PuppetConf 2017: Test First Approach for Puppet on Windows- Miro Sommer, Hiscox
PuppetConf 2017: Test First Approach for Puppet on Windows- Miro Sommer, HiscoxPuppetConf 2017: Test First Approach for Puppet on Windows- Miro Sommer, Hiscox
PuppetConf 2017: Test First Approach for Puppet on Windows- Miro Sommer, Hiscox
 
Technology-Driven Development: Using Automation and Development Techniques to...
Technology-Driven Development: Using Automation and Development Techniques to...Technology-Driven Development: Using Automation and Development Techniques to...
Technology-Driven Development: Using Automation and Development Techniques to...
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
Get your Project back in Shape!
Get your Project back in Shape!Get your Project back in Shape!
Get your Project back in Shape!
 
Staging and Deployment
Staging and DeploymentStaging and Deployment
Staging and Deployment
 
Yii workshop
Yii workshopYii workshop
Yii workshop
 
Successfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSuccessfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile World
 
Kylin Engineering Principles
Kylin Engineering PrinciplesKylin Engineering Principles
Kylin Engineering Principles
 
'Intro to Infrastructure as Code' - DevOps Belfast
'Intro to Infrastructure as Code' - DevOps Belfast'Intro to Infrastructure as Code' - DevOps Belfast
'Intro to Infrastructure as Code' - DevOps Belfast
 
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps StoryDOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
DOES16 London - Jonathan Fletcher - Re-imagining Hiscox IT: A DevOps Story
 
Metrics-driven Continuous Delivery
Metrics-driven Continuous DeliveryMetrics-driven Continuous Delivery
Metrics-driven Continuous Delivery
 
PuppetConf 2016: How Not to Freak Out When You Start Writing Puppet Modules f...
PuppetConf 2016: How Not to Freak Out When You Start Writing Puppet Modules f...PuppetConf 2016: How Not to Freak Out When You Start Writing Puppet Modules f...
PuppetConf 2016: How Not to Freak Out When You Start Writing Puppet Modules f...
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
ContinuousDelivery-101
ContinuousDelivery-101ContinuousDelivery-101
ContinuousDelivery-101
 
Application Deployment at UC Riverside
Application Deployment at UC RiversideApplication Deployment at UC Riverside
Application Deployment at UC Riverside
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
 
Tech breakfast at Lab49
Tech breakfast at Lab49Tech breakfast at Lab49
Tech breakfast at Lab49
 
German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 

Is Your API Misbehaving (workshop)

  • 1. Is Your API Misbehaving? D. Keith Casey Jr keith@clarify.io @CaseySoftware
  • 3. Who am I? Clarify.io - The API for businesses to build apps that Search and Understand their Audio & Videos
  • 5. • Assumptions • The Problem • Enter BDD • BDD in Practice • BDD at Scale • Next steps…
  • 6. • Assumptions • The Problem • Enter BDD • BDD in Practice • BDD at Scale • Next steps…
  • 7. Assumptions • 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 7
  • 8. Assumptions • Nothing is perfect • You make mistakes • Your providers make mistakes • That other team are knuckleheads 8
  • 9. • Assumptions • The Problem • Enter BDD • BDD in Practice • BDD at Scale • Next steps…
  • 10. • Click Tests - someone • Unit Tests - xUnit suite • Integration Tests - still probably xUnit • Web/UI Tests - Selenium, Watir, Testlio (mobile) API Testing is Deceptive 10
  • 11. … no seriously. API Testing Sucks 11
  • 12. Two Goals Prove* that it works (now) Give us confidence (later) 12
  • 13. Back to the Drawing Board 13 • SMART • Specific, Measurable, Achievable, Relevant, and Time-boxed • INVEST • Independent, Negotiable, Valuable, Estimable, Small, Testable
  • 14. • Assumptions • The Problem • Enter BDD • BDD in Practice • BDD at Scale • Next steps…
  • 15. BDD - Standard Definition 15 BDD is a synthesis and refinement of practices stemming from TDD and ATDD
  • 16. BDD - Dan North 16 BDD is a second-generation, outside- in, pull-based, multiple-stakeholder, multiple-scale, high-automation agile methodology. It describes a cycle with well-defined outputs, resulting in the delivery of working, tested software that matters.
  • 17. BDD - What it really means 17 Get your head out of the system!
  • 18. BDD - What it looks like 18 As a [role], I want [feature] so that [benefit]
  • 19. BDD - To be more precise 19 It’s English but in the Gherkin syntax so this: • As a [role], I want [feature] so that [benefit] becomes a feature (or spec) structured as: • Given [condition], when I [action] then [result]
  • 20. • Assumptions • The Problem • Enter BDD • BDD in Practice • BDD at Scale • Next steps…
  • 21. In lots of languages 21 • Java - JBehave • Ruby - RBehave -> RSpec -> Cucumber • PHP - Behat • Python - Behave • C# - NSpec • Javascript - Cucumber-js & Jasmine
  • 22. So let’s do this! Start small.
  • 23. So let’s do this! https://github.com/caseysoftware/is-your-API-misbehaving * * I don’t like Github as an organization but didn’t have time to convert all of this and fully test it with Gitlab which is a better product and company.
  • 24. Using Github… 24 • Let’s start with search • Write the story • Add the stubbed methods • Write the methods • Validate the results • simple-search-step-{n}-{description}
  • 25. Using Github… 25 • Now, let’s get the issues for a repository • Write the story • Add the stubbed methods • Write the methods • Validate the results • issues-list-step-{n}-{description}
  • 26. Using Github… 26 • Now, let’s get all of your repositories • Write the story • Add the stubbed methods • Write the methods • Validate the results • authentication • myrepos-step-{n}-{description}
  • 27. Using Github… 27 • Now, let’s watch a repository • Write the story • Add the stubbed methods • Write the methods • Validate the results • watch-repo-step-{n}-{description}
  • 28. Using Github… 28 • Now, let’s fork a repository • Write the story • Add the stubbed methods • Write the methods • Validate the results • watch-repo-fork-step-{n}-{description}
  • 29. Using Github… 29 • Now, let’s create a repository • Write the story • Add the stubbed methods • Write the methods • Validate the results • create-repo-step-{n}-{description}
  • 30. • Assumptions • The Problem • Enter BDD • BDD in Practice • BDD at Scale • Next steps…
  • 31. And now what? 31 • Write the feature • Refactor to reuse steps when possible • Add the missing bits • GOAL: • We should be writing less and less code!
  • 32. Next Steps? 32 • We can validate other helper libraries too • One set of features/specs for the API using: • the PHP library • the Ruby Gem • the Python library
  • 33. • Assumptions • The Problem • Enter BDD • BDD in Practice • BDD at Scale • Next steps…
  • 35. todo next? 35 But remember: Start small and iterate!
  • 36. D. Keith Casey Jr keith@clarify.io @CaseySoftware Is Your API Misbehaving?