8
Introduction
What are runnable specications?
Okay, it’s time to addres the book’s title, Runnable Specications.
The phrase needs some explanation. It means three things:
• separating specication from implementation
• modeling your domain in code
• seeking fast, rich feedback
Let’s consider each one.
Separating specication from implementation
Separating specication from implementation has been called
the most important skill that dierentiates juniors from seniors.
Some people say “interface” instead of “specication.” But it
means the same thing. We separate the meaning of the soware
from how it is implemented.
When we say something is messy or undesigned, oen we
mean there is no way to understand the interface except by un-
derstanding exactly what it does. In such cases, there is no sep-
aration between specication and implementation. In this book,
you will learn how to reason about the interfaces separately from
the implementation. In fact, even though there is plenty of code
in this book, we will do very little implementation—just enough
to make things runnable.
Modeling your domain in code
Domain modeling means to encode an abstraction of the problem
domain. That can get technical and a lot of this book is about the
skills of modeling. It’s too much to explain in detail here in the
introduction—but here’s a short description.
An abstraction maps information from the concrete to an ab-
stract representation. The mapping is good if it preserves opera-
tions. That is, the important operations in the concrete domain
are also available in the abstract representation.
How do we choose what to represent? What operations are
important? Those are hard questions to answer in general. And
they’re also hard in the specic. It takes trial-and-error and lots
of iteration. And for that, we need rich feedback.
Vocabulary
Why is it that if I use the word
meaning, people are confused,
but if I use the word semantics,
they nod their heads? They
mean the same thing, but se-
mantics is so technical, peo-
ple ignore it. Meaning still has
some impact, so I’m using it.