spriteTalk #87: Automated Contract Testing

Our Senior Test Automation Engineer, Murilo is a wizard when it comes to automation. Fortunately for spriteCloud, he is also very good at training people on automation. 

During our weekly Friday afternoon drinks and technical talks, what we call our spriteTalks, Murilo introduced automated contract testing to the spriteCloud team. During the presentation, he took us through some of the basics of what contract testing is, what it does, and why it is useful.


A brief explanation of contract testing

Contract testing exists to help with integration testing, which in turn is a process for testing that the various integrated systems (i.e. microservices) are all communicating and working together. A common example of such a test is an End-to-End Integration Test. In such an E2E test, all the components are testing together in an environment that closely resembles the production environment to test that they are function properly. These tests are generally more flakey, take longer to run, find bugs later in the dev process, and are very prone to failure. 

An eCommerce platform is a great example of a system that depends on a lot of components working seamlessly with each other.

Contracting testing is a methodology whose goal is to ensure that two microservices are compatible and can communicate with each other.  These interactions between the services are captured and stored in a contract, which is then used to verify that the microservices adhere to them. 

What makes contract testing very interesting is that, unlike E2E integration tests, the microservices are able to be tested independently from each other and the contract is generated by the code, which means that it is always kept up to date. Thus is achieves the same goal as the E2E test but more reliably and more efficiently. 

Sauce Labs has a good explanation of contract testing that you can use alongside Murilo’s presentation above.

The test automation pyramid

In the classical test automation pyramid, E2E tests would sit at the “UI” tests level of the pyramid, which is slow to run and quite flakey. Contract testing would sit at the “API” or Service tests level of the pyramid as they as faster and cheaper to run and maintain and are less fragile.

Enjoy the video. If you have any questions, please leave a comment in the video. 

If your organisation needs assistance in automating its tests, spriteCloud can help! We can lend out automation experts to your organisation for a short time to help set up test automation, or we can handle it for your completely. Learn more about our test automation services, or get in touch with us to learn how we can help you using the contact form below. 

Need some help? Contact us!

Submit a contact form below to request a quote or ask for further information about setting up test automation or contract testing for your organisation. You can also use the live chat to the right on the webpage.

Suggested Posts

Test Automation Tools: Cypress.io

Test Automation Tools: Cypress.io

For more reviews of Test Automation Tools and Frameworks (like Cypress.io), head to our main Automation topic page. For more reviews of Test Automation Tools,

Written by: Travis Hatridge

Travis is the Marketing Manager at spriteCloud. He has an MSc in Marketing and a background in content marketing. He enjoys cooking, travelling, and long walks through the forest.

Subscribe to our mailing list!

Stay up-to-date on all things quality assurance,
test automation, and cybersecurity.

We’re spriteCloud, a leader in software and cybersecurity testing.

Aside from interesting articles, we also have a team of software testers that can help your organisation.

Have a look at our testing solutions.