A software design specification explains how a system will meet its requirements: its components, data, interfaces, decisions, failure handling and verification. A useful specification lets another engineer implement or challenge the design without guessing what happens when requests are duplicated, permissions change or a dependency stops responding.
Start with the riskiest workflow rather than a long list of headings. The worked example here is a fictional merchant refund service. Its design decisions are illustrative, not a claim about an existing payment provider. You can reuse the structure for a booking system, customer portal or internal approval workflow.
Separate requirements from the software design specification
| Document | Question it answers | Refund example |
|---|---|---|
| Requirements | What must be true? | A refund must never exceed the remaining refundable amount. |
| Design specification | How will the system make it true? | Reserve the amount atomically before requesting the provider operation. |
| Acceptance evidence | How will we verify it? | Run concurrent partial-refund requests and inspect the ledger. |
The NASA Software Engineering Handbook describes design documentation covering architectural relationships, interfaces, execution, traceability and decision rationale. Those categories are useful outside aerospace, but the amount of detail should match the system’s risk and the team’s needs. Copying a large organisation’s template does not establish compliance with its standards.
Keep the commercial agreement separate. The software development contract guide covers scope, acceptance, ownership and handover. Your design can reference agreed requirements without silently expanding contractual scope. A new feature discovered during design belongs in a recorded change decision.
Use a compact outline with named decisions
| Section | What to write | Review question |
|---|---|---|
| Scope and constraints | Goals, exclusions, assumptions and dependencies | What is intentionally outside this release? |
| Architecture | Components, ownership and trust boundaries | Where is each decision enforced? |
| Data and state | Entities, invariants and allowed transitions | What prevents an impossible state? |
| Interfaces | Inputs, outputs, errors and compatibility | Can another team integrate without guessing? |
| Failure and recovery | Timeouts, retries, reconciliation and rollback | How does the system recover safely? |
| Verification and operations | Tests, telemetry, rollout and ownership | What evidence proves it is ready? |
Give the document an owner, version, status and review date. Mark decisions as proposed, accepted or superseded. Place unresolved questions in one register with a responsible person and a deadline. An unanswered question is useful evidence; a polished diagram that hides it is not.
Write explicit exclusions. In this example, the service handles refunds against already settled payments; it does not determine a customer’s legal entitlement, calculate exchange rates or settle chargebacks. Those boundaries prevent engineers from inventing business policy while implementing an endpoint.

Describe the refund workflow and its boundaries
The example has four components: an authenticated merchant interface, a refund API, a worker that calls the payment provider, and a reconciliation process that checks uncertain results. The application’s ledger records requests and reserved amounts. The provider remains the source of truth for whether money moved. Specify that distinction before drawing arrows.
The API validates the caller’s tenant, role, payment ownership, currency and requested amount. It creates a refund request and reserves the amount in the same atomic operation. A worker later submits the request to the provider. The browser does not call the provider directly or decide whether a payment belongs to the current merchant.
For this design, every amount is an integer in the currency’s minor unit, with the currency code stored alongside it. Do not assume every currency has two decimal places. Validate positive amounts and supported currencies at the boundary. Define how historical records are interpreted if supported currency rules change.
| State | Meaning | Allowed next state |
|---|---|---|
| Requested | Validated request and amount reservation exist | Submitting or Cancelled before submission |
| Submitting | Provider operation may be in progress | Succeeded, Failed or Needs reconciliation |
| Needs reconciliation | Outcome cannot yet be confirmed | Succeeded or Failed after evidence |
| Succeeded | Provider success is confirmed | Terminal for this request |
| Failed | Failure is confirmed; reservation released | Terminal; any new attempt is a new governed action |
Define cancellation carefully. Once a provider call may have executed, an interface cannot safely promise that cancelling the local job reverses the payment operation. In this example, only a request that has not been submitted can enter Cancelled. Later customer changes require a separate business process.
Specify the interface, including duplicate requests
A useful interface contract states the method, route, authentication, schema, response states and errors. In this example, POST /refunds accepts payment_id, amount_minor, currency and reason_code, plus an idempotency key. The server derives the tenant from authenticated context rather than trusting a merchant identifier supplied by the browser.
| Contract case | Example behaviour | Evidence to preserve |
|---|---|---|
| New valid request | Return request ID and Requested state | Validated request and reserved amount |
| Same key and same payload | Return the same logical request | Original request ID |
| Same key and different payload | Reject as a conflict | Conflict reason without exposing another tenant |
| Amount exceeds remaining balance | Reject before provider submission | Current rule and validation result |
| Provider timeout | Keep uncertain state for reconciliation | Provider correlation ID and last attempt |
Scope the idempotency key to the tenant and operation, record a fingerprint of the relevant payload and define retention. A key that expires too soon can allow an old client retry to create another operation. A key reused across unrelated merchants can leak information or block legitimate work. Document the expected retry window and align it with the provider’s actual guarantees.
Concurrent requests need more than idempotency. Two different keys can request two partial refunds against the same balance. The invariant must cover completed refunds plus active reservations, using an appropriate transaction or equivalent consistency mechanism. State what happens when a transaction conflicts and which operations may retry.
Include compatibility rules. Adding an optional response field may be safe for tolerant clients; renaming a state or changing its meaning can break operational logic. Record versioning, deprecation notice and how older clients behave when they encounter a state they do not recognise.
Trace one competing request through the design
Use a concrete trace to make the invariant reviewable. In this fictional USD example, a payment has 10,000 captured cents and 2,000 cents of completed refunds. Request A asks for 6,000 cents while request B asks for 4,000. Both use different idempotency keys. Assume A obtains the reservation first.
| Step | Completed / reserved / available, cents | Expected decision |
|---|---|---|
| Before either request | 2,000 / 0 / 8,000 | Both callers must still pass tenant and permission checks |
| A reserves 6,000 | 2,000 / 6,000 / 2,000 | Commit request and reservation atomically |
| B attempts 4,000 | 2,000 / 6,000 / 2,000 | Reject insufficient refundable balance |
| A provider request times out | 2,000 / 6,000 / 2,000 | Keep reservation; reconcile the uncertain outcome |
| Provider confirms A succeeded | 8,000 / 0 / 2,000 | Move reserved to completed exactly once |
Add the recovery counterexample: if the provider confirms a permanent failure for A, completed refunds remain 2,000 cents, its 6,000-cent reservation is released, and 8,000 cents becomes available. That does not automatically authorise retrying B. Preserve the rejected request and require a deliberate new action under the agreed business rules.
A real provider contract can differ by API generation. For example, Stripe’s idempotent-request documentation says API v1 retries replay the saved response, including a 500 response, after endpoint execution begins. It also describes key pruning after at least 24 hours and different v2 retry behaviour. Record the exact API version and guarantees you integrate with; do not infer permanent duplicate protection from the word “idempotent”.
Make failure handling a first-class part of the design
Consider a worker that sends a refund, then loses its connection before receiving the response. Blindly issuing a fresh refund can duplicate the payment movement. Mark the result uncertain, retain the stable provider reference and reconcile through the provider’s supported lookup or event mechanism. Do not release the reserved amount until the outcome is known under the design’s rules.

Write down retry eligibility, maximum attempts, backoff, ownership and the manual escalation path. Distinguish a transient network problem from a permanent validation error. A worker that retries forever can hide a broken integration and build an unmanageable queue.
For callbacks, define authenticity checks, duplicate handling, event ordering and how stale events are rejected. Treat callback payloads as untrusted until verified using the provider’s documented method. A delayed event should not move a terminal request backwards. A forged event must not create a successful refund record.
A rollback plan also needs a data view. Reverting application code does not reverse provider payments or automatically undo a schema change. Specify which previous application version can read new records, how queued work is paused, and who approves recovery actions. The production security guide provides adjacent operational checks.
Connect each design claim to a reviewable test
| Design claim | Verification scenario | Pass evidence |
|---|---|---|
| Tenant isolation | Merchant B requests a refund for Merchant A’s payment | Denied without exposing A’s payment details |
| Balance invariant | Concurrent partial requests exceed the remaining total | Only allowable reservations commit |
| Idempotent submission | Client repeats the same request after a timeout | One logical refund request exists |
| Recovery correctness | Provider succeeds but response is lost | Reconciliation reaches Succeeded without a second refund |
| Operational visibility | Reconciliation remains stuck | An owned alert exposes age and request reference |
Specify performance requirements with a workload, environment and percentile. “Fast” cannot be tested. A proposed API acknowledgement target should name whether it includes provider processing or only local acceptance. Keep unmeasured targets labelled as requirements until a representative test produces results.
Define observability using request IDs, state transitions, queue age, reconciliation age and error categories. Keep secrets, payment credentials and unnecessary personal information out of logs. An alert needs an owner and a runbook; a dashboard alone does not tell an on-call engineer what action is safe.
For a small project, the specification may be short, but it still needs these decisions. Review it with engineering, operations and the person who owns the business rules. Ask each reviewer to trace one normal flow, one rejected request and one uncertain outcome from input to final evidence. Any step that depends on “the developer will figure it out” is a place to improve the document.
Use the software design review worksheet to record the inputs, decisions and checks described here.
What is a software design specification?
It describes how software will meet its requirements through architecture, data, interfaces, behaviour and operational decisions. It should connect important requirements to design choices and verification evidence.
How is it different from an SRS?
A software requirements specification describes required behaviour and constraints. A design specification explains the implementation approach chosen to satisfy them.
How long should a design specification be?
Use enough detail for another engineer to implement and review the risky decisions. Length depends on complexity, interfaces and consequences of failure, not a universal page count.
Should it include code?
Small schemas, interface examples or pseudocode can clarify a decision. Avoid duplicating entire implementations that will quickly drift from the running code.
When should the design be updated?
Update it when accepted decisions, interfaces, invariants or operational assumptions change. Preserve the rationale for superseded decisions so future maintainers understand the history.
Need help building this?
Let our team build it for you.
Dude Lemon builds production-grade web apps, APIs, and cloud infrastructure. Get a free consultation and project proposal within 48 hours.
Start a project