Modeling
Software engineering has always relied on abstraction. Large systems exceed what any engineer can reason about directly, so engineers understand them through purposeful views. A dependency graph exposes relationships among components; a state machine exposes legal behavior; a schema exposes permitted structure; a quantitative model exposes a resource bound. Each representation preserves what an engineering question needs and suppresses what it does not.
Explicit models cost work to create, maintain, and keep consistent with a changing system. Those costs help explain why models have often remained secondary to code in software practice. Commodity intelligence changes the economics: agents can help derive, regenerate, reconcile, and query structured representations. Rapid autonomous software implementation** Here, implementation means writing software. Throughout the book, the term can also refer to an agent carrying out other kinds of delegated work, including specification, design, and validation. also increases their value. Knowledge that an engineer once reconstructed for an occasional change may now be needed by many agents working on many tasks. A maintained model gives those tasks a shared starting point.
Key Ideas
Modeling Principle. Externalize engineering knowledge and intent into explicit, structured models that both engineers and agents can reason through.
Appropriate representations make broader engineering questions tractable and make additional properties available for Alignment.
MAGE therefore treats Modeling as an engineering activity in its own right:
What should I model, and what will the model let me know?
Which model is useful depends on what the engineer needs to know. A concurrency question may require ownership and lifecycle; an architectural-boundary question may require components and permitted communication edges. Different questions about the same system therefore call for different reductions.
We will develop three familiar modeling questions in detail: what is connected to what, what may happen, and what should happen next. We will then connect models to answer questions that cross individual views. The examples illustrate a broader engineering skill: recognizing which representation makes a particular question tractable.
The main text develops each modeling question through a small example. Four worked insets apply those ideas to DocAble, the production accessibility service introduced in Chapter 1. DocAble accepts a document, distributes accessibility repairs across workers and services, validates the result, and returns the corrected document with a record of what changed. Each inset introduces the part of the system it needs, so the main argument remains readable without the case details.
Four terms recur throughout the chapter. A property is a claim about a system that we can express using a model. An invariant is a property that must always hold within a specified scope. An analysis or check produces evidence about whether a property holds. Enforcement prevents violations through a mechanism in the running system or development process. Chapter 3 examines enforcement.
For example, a job-ownership model can record which worker may modify each job. “Each job has at most one modifying worker” is a property; requiring it throughout every job's lifetime makes it an invariant. An analysis can search the modeled transitions for a state in which two workers both hold permission. In a service where a worker must claim the job before changing it, an atomic claim can enforce exclusive ownership: it assigns an unowned job to one worker and rejects competing claims.
Four questions for every model
Read each worked model with these four questions in mind:
- Engineering question — what am I trying to know or decide?
- Model — what representation makes the question tractable?
- Property — what can I now state precisely?
- Quality attribute — what engineering concern does that property serve?
Chapter 3 adds a fifth question: what enforces the property? Modeling makes properties explicit; Alignment makes selected obligations enforceable.
- Chapter 1 — The New Engineering Problem: go to Chapter 1
- Chapter 2 — Modeling (current chapter)
- Chapter 3 — Alignment: go to Chapter 3
- Chapter 4 — MAGE in Motion: Engineering Through Models: go to Chapter 4
- Chapter 5 — DocAble Among Other Software Factories: go to Chapter 5
- Chapter 6 — The Theory: go to Chapter 6
- Chapter 7 — The Profession: go to Chapter 7