Welcome!

Open Source Cloud Authors: Stackify Blog, Vaibhaw Pandey, John Walsh, Liz McMillan, Pat Romanski

Related Topics: @DevOpsSummit, Microservices Expo, Open Source Cloud, Containers Expo Blog, @CloudExpo

@DevOpsSummit: Blog Feed Post

API Design Using Behavior | @CloudExpo #API #DevOps #Microservices

It's easy for us as programmers to become focused on the details of our system

API Design Using Behavior Driven Development
by Erik Dietrich

Test-driven development (TDD) has been around for a while now.  Behavior-driven development (BDD), a comparably recent methodology, emerged from the practice of TDD and could reasonably be called a narrower application of TDD.

The TDD process allows a developer to use a failing unit test to express a shortcoming of the system.  The next step is to modify the production code to get the failing test to pass without making existing tests fail.  BDD more or less takes this same concept and adds the idea that the tests should be written in easy-to-understand language describing the problem domain, and that tests should express user acceptance criteria.

So instead of

void testErrorMessageOnNull()
you would have

Given a text box that has been left empty, when I click submit, I should receive an error message.
As a practice, this has found its way into the agile canon. It has given rise to something conversationally termed "three amigos," in which a representative of "the business," a tester, and a developer get together and agree on a few things: what the requested feature is, what it means, what it looks like when done, and how to verify completion.  In teams practicing BDD, the output of this conversation will often be an acceptance test, expressed in the Gherkin specification language.  When added to the codebase, this test will, of course, fail.  The folks implementing the feature know that they're done when they've succeeded in making the test pass.

If we put agile aside for a minute, this is a pretty commonsense approach for any team.  The essence of it is, "let's define and be clear about what success looks like and then automate a check for it."  So you don't need to be an agile team for this to make sense - you just need to be a team looking for clarity.

BDD in the API Provider World
Everything about BDD makes perfect sense in the line-of-business and traditional product development worlds.  In those worlds, "the business" wants stuff from "the geeks," and that basic operating paradigm creates the need for something like Gherkin to be necessary.  As elegant as it may seem, Gherkin could easily be viewed as pidgin developer-business talk.

But what happens when you're in the business of making products for developers?

I've worked with teams in the past that built a product with no user interface, to be consumed only by other software developers.  For teams like this, the people on and around the team may all have software development chops.  Testing is achieved through first-class programming automation.  People that function as project managers or business analysts are comfortable discussing the details of a method invocation or POSTing JSON to an endpoint.  The business is entirely technical, so there is no understanding deficit among the team members when talking shop.

So BDD doesn't apply for such teams, then, right?

Actually, it does.  In fact, I believe that it applies just as much to a project with technical consumers as it does to a project with business or public consumers.  And the reason for this is relatively simple.  While it may seem counterintuitive, BDD isn't ultimately about finding common ground in the language between "business people" and "geeks."  It's about being clear about what users can expect from a system, using terms both users and developers can agree on.

To be clearer about this, let's consider a problem domain for reselling tickets to events.  If we were building a website to be consumed by the public, we might write an acceptance test that's something like the following to drive system behavior:

Given there are 2 tickets available for the Rolling Stones Concert
When I request all tickets for the Rolling Stones Concert
Then I see 2 tickets
This test would call into the presentation/controller logic of the web application. It would seed the application with two available tickets, make a request for all tickets, and then verify that the two tickets were returned.

But what if there were no website? What if the product was just a backend service for a series of resellers to use to drive their own sites? In that case, our users would be the developers at those reseller companies. In that case, why not write a test like the following?

Given there are 2 tickets available for the Rolling Stones Concert
When I issue a GET to ~/concerts/RollingStonesConcert
Then I receive JSON with 2 ticket entries
Most people aren't used to Gherkin that looks like this, but it's perfectly valid.  The language is intended to describe your application's behavior in the terms of its domain.  And if your product is an API that provides this service, HTTP verbs, JSON, resource paths, and entries are part of your domain (along with tickets and concerts).

Representing Your Users
It's easy for us as programmers to become focused on the details of our system.  What's the performance like?  What should the preconditions and invariants be for this object instance?  Have we considered all the edge-case scenarios for this call?  And it's doubly easy to get caught up in these sorts of details when our users are fellow programmers who would be completely empathetic.

Don't get me wrong.  The details are important - very much so.  But the way users perceive and interact with your system is just as important, if not more so.  BDD forces you to think about that.  It forces you to form a common understanding of what success looks like with the people that are using your system.  The fact that you work on a technical product isn't a reason to pass on that opportunity. It's a reason to double down on it.

this didn't make sense to me the way it stood-"be written in language about ." I still don't know if it makes sense.

More Stories By SmartBear Blog

As the leader in software quality tools for the connected world, SmartBear supports more than two million software professionals and over 25,000 organizations in 90 countries that use its products to build and deliver the world’s greatest applications. With today’s applications deploying on mobile, Web, desktop, Internet of Things (IoT) or even embedded computing platforms, the connected nature of these applications through public and private APIs presents a unique set of challenges for developers, testers and operations teams. SmartBear's software quality tools assist with code review, functional and load testing, API readiness as well as performance monitoring of these modern applications.

@ThingsExpo Stories
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L stakeholders.
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
"Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things’). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing? IoT is not about the devices, it’s about the data consumed and generated. The devices are tools, mechanisms, conduits. In his session at Internet of Things at Cloud Expo | DXWor...