Put open source to work
July 16–17, 2018: Training & Tutorials
July 18–19, 2018: Conference
Portland, OR

Better API testing with the OpenAPI Specification

Taylor Barnett (Stoplight)
1:45pm2:25pm Thursday, July 19, 2018
Evolutionary architecture
Location: Portland 251
Level: Intermediate
Average rating: ****.
(4.50, 4 ratings)

Who is this presentation for?

  • Software developers and engineers who create and test APIs or develop SDKs or client libraries that consume third-party APIs

Prerequisite knowledge

  • Basic familiarity with RESTful APIs

What you'll learn

  • Learn how to leverage the OpenAPI Specification to build better tested APIs
  • Understand the API testing benefits gained from specification-first design
  • Explore testing strategies and different tools for API testing

Description

If you search on the internet for unexpected API behavior, you’ll soon discover that no one likes when an API doesn’t work as expected. When you take into account the increasing number of APIs and continuous development and delivery of the services built on top of them, it’s no surprise that APIs can move away from their initially expected behavior. This is why expanding API test coverage is critical for success. For years, we have created unit and functional tests for our APIs, but where do we go from there?

Taylor Barnett explains how to contract test APIs (i.e, writing tests to ensure that an API or microservice works as described in an agreement) based on a single source of truth—in this case, an OpenAPI Specification document. Contract testing is useful for testing the accuracy of API implementations in server code, SDKs, client libraries, and even third-party APIs, which is especially helpful when other services rely on an API.

Taylor details the differences between testing an SDK and the implementation of an API and other use cases and outlines how contract testing can lead to faster development, fewer breaking code changes, and more accurate implementations. Along the way, she shares real-life contract testing examples and techniques to implement within your API projects.

Topics include:

  • A brief overview of the OpenAPI Specification and its benefits
  • The concept of a “single source of truth” in API development
  • The history of contract testing
  • The difference between unit, functional, and contract API tests
  • Contract testing automation
  • Different tools that make contract testing possible, such as mock servers
Photo of Taylor Barnett

Taylor Barnett

Stoplight

Taylor Barnett is the lead community engineer at Stoplight. Taylor is passionate about building great developer experiences within APIs with an emphasis on empathy and inclusion within documentation, SDKs, support, and other community-focused projects. Previously, she was the lead community engineer at data analytics API company Keen IO. Taylor has spoken about developer experience, SDKs, inclusion, and building developer communities, including open source communities, at conferences such as O’Reilly OSCON, API Strategy & Practice, AlterConf, Hackcon, and local meetups. In her free time, she helps organize Women Who Code Austin, advises developer communities, drinks sour beers, and climbs in Austin, Texas.