Test Driven Development for Microservices Using Spring Cloud Contracts & Cloud Foundry

April 19 2018 Talk @ Cloud Foundry Summit Boston

A video of my talk Test Driven Development for Microservices Using Spring Cloud Contracts & Cloud Foundry with my colleague Reshmi Krishna On April 19 2018 at Cloud Foundry Summit in Boston.

Abstract:

Test Driven Development for Microservices Using Spring Cloud Contracts & Cloud Foundry – Reshmi Krishna & Adib Saikali, Pivotal

TDD introduced many improvements into the development process, but in our opinion the biggest impact relates to code design. Looking at the code from the usage perspective (by first writing an acceptance test) allows us to focus on usability rather than concrete implementation. Unfortunately, we usually rest on our laurels not trying to uplift this practice to the architecture level.

Consumer driven contracts (CDC) are like TDD applied to the API. It’s especially important in the world of microservices. Since it’s driven by consumers, it’s much more user friendly. Of course microservices are really cool, but most people do not take into consideration plenty of potential obstacles that should be tackled. Then instead of frequent, fully automated deploys via a delivery pipeline, you might end up in an asylum due to frequent mental breakdowns caused by production disasters.

This presentation will show you how you can use the Spring Cloud Contracts to have a fully automated solution to a consumer driven testing disasters. We will then deploy all these applications to Cloud Foundry. At the end, you will see how easy is it to write applications that have a consumer driven API and that will allow a developer to speed up the time of writing his better quality software.

Consumer Driven Contracts and Your Microservice Architecture

Video of my talk Consumer Driven Contracts and Your Microservice Architecture co-delivered with my friend Marcin Grzejszczak at Spring One Platform 2017

Abstract:

Consumer driven contracts (CDC) are like TDD applied to the API. It’s especially important in the world of microservices. Since it’s driven by consumers, it’s much more user friendly. Of course microservices are really cool, but most people do not take into consideration plenty of potential obstacles that should be tackled. Then instead of frequent, fully automated deploys via a delivery pipeline, you might end up in an asylum due to frequent mental breakdowns caused by production disasters.

We will write a system using the CDC approach together with Spring Boot, Spring Cloud Contract verifier. We’ll show you how easy it is to write applications that have a consumer driven API and that will allow a developer to speed up the time of writing his better quality software.

Consumer Driven Contracts with Spring Cloud Contract

Jan 26 2017 Talk @ Toronto Java User Group

A video of my talk Consumer Driven Contracts with Spring Cloud Contract on Jan 26 2017 at the Toronto Java User Group.

Abstract:

Changing a published API over time is hard due to backward compatibility concerns. This is even more of an issue in a microservice architecture with 100’s of microservices that each publish and API. Consumer Driven Contracts is an effective service evolution pattern. In this talk we will explain the ideas behind Consumer Driven Contracts and show how to implement them easily with Spring Cloud Contract.

Spring Cloud Contract is an umbrella project holding solutions that help users in successfully implementing the Consumer Driven Contracts approach. Currently Spring Cloud Contract consists of the Spring Cloud Contract Verifier project.

Spring Cloud Contract Verifier is a tool that enables Consumer Driven Contract (CDC) development of JVM-based applications. It is shipped with Contract Definition Language (DSL) written in Groovy. Stating with version 1.1.0 you can define your own way of defining contracts – the only thing you have to provide is a converter. Contract definitions are used to produce following resources:

  • JSON stub definitions to be used by WireMock (HTTP Server Stub) when doing integration testing on the client code (client tests). Test code must still be written by hand, test data is produced by Spring Cloud Contract Verifier. Starting with version 1.1.0 you can provide your own implementation of the HTTP Server Stub.
  • Messaging routes if you’re using one. We’re integrating with Spring Integration, Spring Cloud Stream and Apache Camel. You can however set your own integrations if you want to.
  • Messaging routes if you’re using one. We’re integrating with Spring Integration, Spring Cloud Stream and Apache Camel. You can however set your own integrations if you want to.

Spring Boot Microservices

July 31 2014 Talk @ Toronto Java Users Group

Video of my talk Spring Boot Microservices on July 31 2014 at the Toronto Java Users Group.

Abstract:

According to Martin Fowler “The term “Microservice Architecture” has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. While there is no precise definition of this architectural style, there are certain common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data.”

The presentation is going to explore the micro services architecture and how to implement micro services with spring boot. The presentation consists of a few slides and lot of live coding with Spring Boot. No previous Spring experience required to follow along the live coding