Acceptance Tests and Unit Tests as Documents First, Tests Second

The real reason [acceptance tests and unit tests] aren’t redundant is that their primary function is not testing. The fact that they are tests is incidental. Unit tests and acceptance tests are documents first, and tests second. As my wife and I were listening to Uncle Bob's book on professionalism in software, this line surprised me. Maybe it's just because I don't understand tests as well as I'd like, but I had to stop and take note. He clarified exactly what he meant, too: […]

https://kerrick.blog/posts/2025/acceptance-tests-and-unit-tests-as-documents-first-tests-second/

Acceptance Tests and Unit Tests as Documents First, Tests Second - Kerrick Long (blog)

Acceptance tests are not unit tests. Unit tests are written by programmers for programmers. They are formal design documents that describe the lowest level structure and behavior of the code. The audience is programmers, not business. Acceptance tests are written by the business for the business (even when you, the developer, end up writing them).

Kerrick Long (blog) - Articles about programming, learning, code, books, and teams

If you code in OOP with the concept of SoC and SOLID you have the possibility to write modern modular classes.

Take the focus on the testability of the code you write and it will show you the way which you can/must go.

1. #unittest
2. #functionaltests
3. #integrationtests
4. #apitests
5. #acceptancetests

From top to bottom
From many to few tests

What are the generic patterns and best practices for resetting state of a database, storage, external service, etc, in #AcceptanceTests?

Or are there any, #lazyweb?

#swDevTermOfTheDay #GivenWhenThen (#GWT) is way of structuring tests. Originally it's a part of #BehaviorDrivenDevelopment (#BDD) to specify the system's behavior using #SpecificationByExample for #AcceptanceTests in a #UserStory. See also #Gherkin and #FourPhaseTest.