Advanced 30 min read

Writing a Technical Design Document

By the end of this lesson, you'll be able to:

  • Write a technical design document for a realistic feature
  • Include the sections that matter: approach, data model, edge cases, testing plan
  • Recognize this as a formalized version of every project module's "Design" lesson

Prerequisites: "Scrum for Salesforce Teams"

Why write this down at all

Every project module since Module 12 has started with a design lesson — "Design the Requirement," "Design the Data Model," "Design the Payment Flow" — precisely because thinking through an approach before coding catches problems cheaply, on paper, rather than expensively, mid-implementation. A TDD formalizes this into a written artifact a team can actually review and discuss before any code exists.

A realistic TDD outline

# Technical Design: Automatic Case Escalation

## Problem
High-priority Cases open longer than 24 hours aren't being noticed
by support managers in time.

## Approach
A Scheduled Apex job (Module 38) runs hourly, querying open,
High-priority Cases older than 24 hours, and notifies the assigned
manager.

## Data Model
No new fields required — uses existing Case.Priority, Case.Status,
Case.CreatedDate.

## Edge Cases
- A Case reassigned mid-escalation-window (handled by re-checking
  the current OwnerId each run, not caching it).
- Bulk Case creation (handled — the query and notification logic
  are bulk-safe, Module 25).

## Testing Plan
Unit tests for the escalation query logic (Module 31); a scheduled-
job test confirming System.schedule fires correctly.

Every section maps directly onto habits this course has built: "Approach" (Module 26's requirement design), "Data Model" (Module 12), "Edge Cases" (Module 17), "Testing Plan" (Module 31) — a TDD isn't a new skill, it's these existing skills, written down in one shareable document.

Who a TDD is actually for

A TDD is written for other developers and reviewers, not just yourself — the goal is that a teammate reading it can spot a missed edge case, a scaling concern, or a security gap (Module 28) before any code is written, when catching the problem is nearly free, rather than discovering it during code review or, worse, in production.

Exercise

As a comment, write the "Edge Cases" section of a TDD for Module 27's Leave Management overlap-checking feature.

Show hint

Think back to what Module 27 specifically had to account for.

APEX

Writing a Technical Design Document Quiz

1. Who is a technical design document primarily written for?

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

A technical design document (TDD) captures a feature's planned approach in writing before implementation begins — genuinely the same discipline as every project module's opening "Design" lesson, now given a formal, reusable template.