Hacker News new | ask | show | jobs
by strife25 1588 days ago
I've had the most luck w/ TDD for designing APIs.

When I write the tests first, it gives me a feel for how consumers of the API will use it. It's a great method to understand the UX of the re-usable code.

2 comments

I'm re-reading PP[1] right now and their Tip #67 feels relevant here:

> A test is the first user of your code

[1] The Pragmatic Programmer 20th Anniversary Edition (Thomas, Hunt)

When it comes to how much testing should be done, I think it's contextual on the project.

I expand on this specific point in a blog post: https://www.buildthestage.com/just-enough-automated-tests/