TDD Conference 2021 - Which is better to Code by Contract: TDD or API-first? - Meenakshi Dhanani

TDD Conference 2021 - Which is better to Code by Contract: TDD or API-first? - Meenakshi Dhanani

Maxi Contieri
·Jul 24, 2021·

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

First International Test Driven Development took place on July 10th.

In this series, I will include every talk together with my notes and further reading.

Hopefully, a lot of readers will watch and rewatch the talks, as they are worth several reviews.

Let's continue...


Meenakshi Dhanani works as a Developer Advocate at Postman where she advocates best practices for Postman, the larger API community, and an API-first approach to software development. She was previously a software consultant at ThoughtWorks, where she trained employees and worked on projects applying XP (extreme programming) practices - TDD, CI/CD, pair programming by the book.

TL;DR: TDD and API-First are complementary techniques. We should embrace contracts.


My Personal notes

  • We make cakes by contracts we agree (the blueprint).
  • A contract is an agreement.
  • We should always focus on the contract and not the implementation to avoid overengineering.
  • Designing by contracts leads to good design from the user perspective.
  • With contracts, we have more predictable integration.
  • Some Code by contract alternatives are: -- TDD -- API-First development -- BDD -- Design by Contract.
  • on TDD writing the tests first, avoids focusing on implementation early.
  • TDD is mistakenly focused on the tests instead of how it guides software development.
  • We play on the workplace using a mock server.
  • The emphasis is on what the API wants to expose
  • We quickly compare TDD with API-First. They are complementary. -- We can use them in tandem.

Speaker Links


Please follow TDD Conference on:

Share this


Technical Opinions are my own. I don't have the revealed truth.

Software Design is a creative activity. These are hints and not rigid rules.

I write on BackEnd Business Systems and OOP Design. My advice/experience might not suit other systems.

You can write me at info(at)