Abstract Test Cases, 20 Years Later - The Code Whisperer

While writing something else entirely, I stumbled upon one of my earliest contributions to the evolutionary design/TDD community. I called them abstract test cases at the time, but today we know them as contract tests. Has much changed in the 20 years since I first wrote about this in public? No.


This is a companion discussion topic for the original entry at https://blog.thecodewhisperer.com/permalink/abstract-test-cases-20-years-later

Have you had the chance to consider things like Pact Broker, or Pactflow (managed service). Or do you know or recommend of any tool or library to enforce contracts?

No, I don’t have experience with specifically those tools. I don’t have a recommendation for you for a particular library.

There is very little to write here. Most xUnit frameworks have everything you need to write Contract Tests. Just write the tests, then remove duplication. I genuinely don’t know what a “contract test library” would give you that you couldn’t easily write for yourself.

If you’re worried about missing something, I don’t think you are. :slight_smile: