liveBook · Manning

Business logic

As explained in Unit Testing Principles, Practices, and Patterns

The set of rules and decisions that implement an application's domain-specific behavior.

Business logic is the domain-specific behavior that determines how an application should act. It usually resides in the domain model, making it the highest-value target for unit testing. section 1.4

Apply these practical rules:

  • Spend most unit-testing effort on business logic rather than treating every part of the codebase as equally important. section 1.4
  • Separate the domain model from infrastructure, external services, databases, third-party systems, and glue code so its behavior can be tested directly. section 1.4
  • Cover less-critical concerns briefly or indirectly, while using integration tests when whole-system behavior matters. section 1.4

How Unit Testing Principles, Practices, and Patterns covers it

How deep it goes
Defines testing priority and isolation boundaries, but defers detailed implementation techniques.
Examples
Contrasts domain models with databases, third-party systems, infrastructure code, and application glue.
What it assumes
Assumes an application contains distinguishable domain, infrastructure, dependency, and integration concerns.
What you can do after
Apply unit testing to isolated domain behavior and use integration tests for broader system interactions.
How it connects
Connects business logic with domain models, unit testing, integration testing, infrastructure code, and external dependencies.

Also explained in

Compare how 10 books explain business logic →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Unit Testing Principles, Practices, and Patterns. The section links point to the parts of the book it draws on.