Skip to content

How the analysis works

One service can implement two business actions

Customer cancellation and a support override may share an update method. The domain model gives each action a name, its own actor and a place to attach the rule that determines when it can run.

Domain modeling from source code

The model

See how a domain model connects order states, cancellation actions and business rules to code, schema and requirements evidence.

Actors, actions, rules and states for cancellation. Support override is drawn dashed: it may share the code, but it is a different business action.

performschangesguardsperformsfromtoENTITYCustomerACTIONCancel orderFIELDOrder.statusRULEShipped orders stay putENTITYSupport agentSTATEPLACEDSTATECANCELLED
  • Entity
  • Field
  • Action
  • Rule
  • State
  • API
  • Event
  • Service
Database schemastatus VARCHAR(20) NOT NULL

Never empty

V12__orders.sql:7
ORM mapping@Column(nullable = true) private String status;

May be empty

Order.java:31
API contractstatus?: OrderStatus

Optional

openapi.yaml:212

Three honest answers to “can status be empty?”. A tool that merged these by name would pick one and hide the other two. The twin keeps all three, flags the conflict, and leaves the decision to a person.

Walkthrough

Step by step.

  1. Start from declarations and behaviour

    A status column is evidence of storage. A route is evidence of registration. A guard and a write support an order-state transition on a specific path. Keep each witness available when an assertion connects them.

  2. Label the interpretation

    Reading the guard supports the shipped-order rejection on the customer path. Calling that path a customer policy is an interpretation. A requirement for future line-item cancellation is intended behaviour. An observed test result applies to its test inputs and version.

  3. Preserve conflicting representations

    An API field can be optional, an ORM mapping can allow nulls and a database can enforce a constraint. Keep the three claims separate. A plausible mapping or shared name needs evidence before it can settle their meaning.

Three claims about the same state

ClaimClassificationEvidence
Order status is storedExtractedColumn declaration in the captured schema
The shipping guard protects customer cancellationObserved in source within scopeGuard and customer path in the captured version
Support can cancel one unshipped lineIntendedApproved version of the proposed requirement