liveBook · Manning

Business rule

As explained in Build High Value Software Systems

A business rule is a domain-specific requirement that governs decisions, constraints, or behavior in a software system.

A business rule is a domain requirement that constrains decisions or behavior. In software, it may appear as conditional logic, validation, error handling, or a technical-looking limitation. section 7.1

When investigating unfamiliar code, treat surprising behavior as a clue, not automatically a defect. Observe runtime behavior, read tests, then trace the code to uncover and document the constraints that changes must preserve. section 7.1 section 7.5

Examples of business rules include:

  • Payments over $10,000 require manual approval. section 7.1
  • Refunds must be completed within five business days. section 7.1
  • European customers use IBAN rather than routing numbers. section 7.1
  • Email confirmations send only during US business hours, which can explain missing confirmations for European customers. section 7.1
Listing 7.1 Before understanding the code, observe it in action
import logging
 
logger = logging.getLogger(__name__)
 
def process_payment(customer, amount, currency):
    logger.info(f"Processing payment: customer={customer.id}, amount={amount}, currency={currency}")
    # ... existing logic ...
    logger.info(f"Payment status: {status}, confirmation_sent={confirmation_sent}")
    logger.info(f"Timezone used: {timezone}, day_of_week: {day_of_week}")

The logging example shows how runtime observations can expose payment status and timezone behavior before code inspection. section 7.1

How Build High Value Software Systems covers it

How deep it goes
Traces rule discovery through runtime observation, tests, and code, then documents constraints; it does not define a formal rule notation.
Examples
Uses payment approval thresholds, refund deadlines, IBAN requirements, and business-hour limits on email confirmations.
What you can do after
Diagnose legacy behavior by observing runtime results, checking tests, tracing code, and recording hidden constraints before making changes.
How it connects
Connects business rules to legacy code, debugging, validation, tests, and specifications or contracts for AI-generated production code.

Also explained in

Compare how 11 books explain business rule →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.