DEV Community

Cover image for TDD Conference 2021 - Which is better to Code by Contract: TDD or API-first? - Meenakshi Dhanani
Maxi Contieri
Maxi Contieri

Posted on • Originally published at maximilianocontieri.com

1

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

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...

Bio

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.

Talk

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:

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay