-

@ MichaelJ
2025-06-09 11:50:54
At my day job we use a backend-for-frontend (BFF) pattern, so almost all the business logic lives in the BFF. The advantage is that we can write _unit_ tests for the BFF and cover most of the critical logic, then write _integration_ tests against the frontend/deployed system.
The other thing is that the BFF is well-encapsulated, so we can treat it like a black box for testing purposes. Thus we can use tests to protect against regression and still refactor to our hearts' content if necessary.