A
Abstraction
clarifying levels of, 201
Dijkstra’s development of, 317–319, 320
polymorphism for, 225
stepdown rule for, 202
Acceptance tests, 14, 18, 246–249
Accidental duplication, 237–238
Accurate estimates, 360–361, 365–367
Ada, Countess of Lovelace, 5, 280. See also N345TS
Adaptability, inexpensive, 256–257
Ader, Clément, 2
Agile methods
story points, 275
test automation via, 226
XP as, 14
Algorithms
incremental derivation of, 61, 82, 86
proving correctness of, 316–323
API function, 269
Arrange/Act/Assert test pattern, 103–104, 247, 267
Authenticator interface, 111
Automated tests, 246, 267–269, 340
Automatic Computing Engine (ACE), 6, 280
B
Balance, 20
Beck, Kent
design principles of, 226, 239
Extreme Programming, 14
on making it right, 306
on refactoring, 219
Behavior
anticipating, 300
refactoring to preserve, 199
vs. structure, 72, 303–304, 307, 311
Behavior-Driven Development (BDD), 104–105, 107
Bergensten, Jens, 289
Boeing, 4
Bowling score computation, 62–79, 104, 203
Branches, toggles vs., 338–340
Bubble sort algorithms, 87, 164
Bugs. See also Debugging
accumulation of, 314
quick patches for, 302
quick tests for, 218
as unacceptable, 264
Builds
Business analysis (BA) teams, 246, 248
Business rules
decoupling databases from, 148
testing the, 150
C
C language, 284
Cascading Style Sheets (CSS) code, 255–256
Cayley, Sir George, 2
CCU-CMU, 364
Certainty
London school of, 141
Changes
fear of making, 31–32, 219, 263
learning to prepare for, 277
as software necessity, 303–304, 307
to user interface, 268
via git, 335
Chicago school of TDD, 142
Chief Technical Officer (CTO), 252
Clean Agile (Martin), 358
Clean Architecture (Martin), 143, 145
Clean Code (Martin), 198
Clean Craftsmanship (Martin), xxv–xxvi
Code
building blocks of, 321
cleaning of, 32–34, 306, 342, 345
decoupling tests from, 161–184, 218, 232
designing testable, 30
early example of, 233
proving correctness of, 316–323
structural vs behavioral changes, 72
test and code communication, 236
test coverage of, 230
Coding
specific tests for generic code, 59, 82, 183–184
transformations, 185
Collaborating components, 144–145
Collaborative programming
improvement via, 356
remotely, 357
COLT (Central Office Line Tester), 361
Complexity, incremental, 92
Computers
in pop culture, 287
Concurrent Versions System (CVS), 333, 334, 336
Constant to variable transformation, 187–188
Continuous build, 249, 341–342
Continuous integration, 337
Continuous learning, 277–278, 373–374
Controllers
in component hierarchy, 144–145
in Humble Object test pattern, 159
testing, 153
Countess. See Ada
Coupling. See also Decoupling
fragile test problem and, 139
high- and low-level details, 152, 218, 224–225
minimizing, 184
Coverage, test, 229–231, 239, 343–344
Craftsmanship
in the aeronautics industry, 4
defined, xxi–xxii
as developer responsibility, 303
foundation disciplines of, 14–18, 293
Craig, Philip, 108
D
Dahl, Ole-Johann, 283
DaVinci, Leonardo, 2
Debugging
avoiding, 199
speeding up, 349
Decidability problem, 62
Decision matrix, Eisenhower’s, 310–312
Decision problem, 280
Decomposition, functional, 322–323
Decoupling
code, for testability, 232
databases, 148
high- and low-level details, 236, 308
production code/test, 161–184, 218
Degenerate tests
stairstep tests as, 66
Dependencies
dependency inversion principle, 143
eliminating unnecessary, 112–113, 114
management of, via SOLID, 309–310
with production data, 116
Deployment
and best work, 307
readiness for, 258
speeding up, 349
and structural changes, 308
Derivation, incremental. See Incremental derivation
Design
changes to, 232
four principles of, 239
fragility as problematic, 160–161
minimal size in, 239
outside-in vs. inside-out, 141–142
Development, test-driven. See Test-driven development (TDD)
Digital Equipment Corporation, 284
Digital switching, 364
Dijkstra, Edsger, 7, 282, 316–323
Diophantine equation, 62
Disciplines
Alan Turing on, 281
in Clean Craftsmanship, xxv
collaborative programming, 17–18
focus and, 13
self- vs. other-imposed, xxv
simple design, 17
test-driven development (TDD), 15–16
YAGNI, 227
Distractions, managing, 349–354
Double-entry bookkeeping, 20–22
Duplication
accidental, 238
duplicate tests, 66
E
Eisenhower’s decision matrix, 310–312
Emotional stress, 351
“Endo-Testing: Unit Testing with Mock Objects” (Freeman, McKinnon, Craig), 108
Engineering practices, 14
Enigma machine, 5
Entangled software, 224
Estimates, honest and fair, 274–275, 358–372
Ethics
in Clean Craftsmanship, xxvi
oath of, 293
single vs. multiple, xxii
Expectations, 252
Explanatory variables, 204
Exploratory testing, 267
Expressivity
as design principle, 239
and real vs. accidental duplicates, 238
role of code and tests in, 236
Extract Field refactoring, 204–216
Extract Method refactoring, 68, 201–202, 208
Extract Superclass refactoring, 214
Extract Variable refactoring, 202–204
Extreme Programming Explained (Beck), 228
Extreme Programming (XP), 13–14, 219, 226, 258
F
Failure tests
algorithms via, 82
input/output (IO), 108
for integer sort algorithm, 83
in integer stack example, 36–52
multiple solutions to, 88
in prime factors example, 52–62
Fear
Finite state machines, 105–107
First-in-last-out (FILO) behavior test, 50, 52
Flow, the, 352
Fowler, Martin
Chicago school of TDD, 142
on simple design, 229
Fragile tests
refactoring to prevent, 218
test specificity to prevent, 59, 232
user interface links and, 268
Fragility, software, 308
Fun, 30
Functional decomposition, 322–323
Functional programming, 62, 196
Functions
extract refactoring of, 201
function to nil transformation, 186–187
minimizing size of, 239
misplaced responsibility of, 71
replacing comments with, 75
tests as constraining, 127
tests tied to implementation of, 120
uncertainty principle in, 132
and underlying abstraction, 235
vs. cleaning code, 306
G
Gateway interface, 149
Generic code, 59
Git reset —hard, 220
Given-When-Then (GWT), 104, 105, 248
Goethe, Johann Wolfgang von, 21
GOTO statements, 320, 321, 322
Green step
as transformative, 185
in video rental algorithm, 165, 166, 167, 169, 173
GUI (graphic user interface)
H
Haines, Corey, 229
Harm, do no
via easy changeability, 303–304
Hendrickson, Chet, 224
Honest estimates, 274–275, 360–364, 370–372
Horn, Michael, 289
Humble Object pattern, 157–160
I
Immobility, 309
Implement Interface command, 114
Implementation, function, 120
Improvement, continuous, 262, 342–346
Incremental derivation
as solution to getting stuck, 95, 98
solving failing tests as, 86
writing tests via, 103
Inside-out design, 142
Integrity
via high productivity, 346–354
via relentless improvement, 342–346
Interactors
in component hierarchy, 144–145
Iteration, 321
J
JBehave, 104
Jennings, Jean, 282
JUnit Recipes (Rainsberger and Stirling), 154
K
Keogh, Liz, 105
Knight Capital Group, 299–300, 302
L
Languages
continuous learning of, 277, 373–374
Law of trichotomy, 89
Learning
via cleaning code, 345
Lies, estimates as, 359
Login test, 348
London school of TDD, 141
Loops, unwound, 57
Lovelace, Countess of, 5. See also Ada
M
Managers
emotional confrontation by, 276
information for, xxvi
perspective of, 252
Marick, Brian, 305
Matz, Chris, 104
McCarthy, John, 282
Meetings, 350
Memory, core, 6
Misplaced responsibility, 71
Mob programming, 242, 244, 357
Mock objects
defined, 109
fragility of testing with, 139
in test doubles, 108–110, 121–123
when to use, 126
Mojang, 289
Mood, 351
Mutation testing, 344
N
Nil to constant transformation, 187
North, Dan, 104
N345TS. See Ada
Nygard, Kristen, 283
O
Object-oriented models, 64
One-to-one correspondences, 161–162, 218
Optimistic locking, 333
Outside-in design, 141
P
Pair programming, 242, 244, 352, 357
Parent-child algorithms, 299
Perspective, 252
Pessimistic locking, 334
Pomodoro technique, 242, 352–354
Precise estimates, 360–361, 367–369
Presenters
in component hierarchy, 144–145
defined, 151
in Humble Object test pattern, 157–159
Prime factors algorithm, 52–62, 185
Probability distributions, 365
Procedural Programming, 62
Production data, 116
Production releases, 340
Productivity
inexpensive adaptability in, 256–257
perpetual readiness in, 258–259
Program Evaluation and Review Technique (PERT), 369–370
Programmer tests, 182
Programmers
continuous improvement by, 262
as craftsmen, xxi
as heroes and villains, 289–290
one path for, xxii
perspective of, 252
pop culture depictions of, 287–288
responsibility of. See Responsibility
senior, 297
senior/junior partnerships, 244
teaching new, 278
undisciplined, 256
Programming
collaborative, 17–18, 242–244, 356
decidability problem in, 62
as finite state transitions, 107
functional, 196
London school of, 141
procedural and functional, 62
Proof, repeatable, 316
Property testing, 140
Pryce, Nat, 141
Public trust, xxiv–xxv
Push function, 41
Q
Quality
continuously improved, 262
definition of poor, 255
extreme, 264
fearless competence on, 263–264
readiness for QA review, 265–267
testing the user interface, 269–270
Quality assurance (QA) department
acceptance test readability by, 246
readiness for review by, 265–267
tests by, 248
R
Rainsberger, J.B., 154
RealAuthenticator, 111–112, 116
Recursion, 100
Red/Green/Refactor loop
cleanup via, 39
as continuous, 219
as functional decomposition, 323
moral foundation for, 312
as refactor cycle, 199
transformative priorities and, 185
Red step
as additive, 185
in video rental algorithm, 165, 166, 168–169, 172
Refactor step
as restorative, 185
in video rental algorithm, 165–166
Refactoring
cleaning as, 345
code generalization via, 184
consistent, 219
and fragile tests, 139
IDE’s Extract Method, 68
Red/Green/Refactor loop, 34–35, 39, 185
restorative, 185
as Rubik’s cube solutions, 215
in video rental algorithm, 164–183
vs. placing hooks, 227
as XP practice, 14
Refactoring (Fowler), 198, 221
Remote work, 357
Responsibility
and collaborative programming, 243
of continuous learning, 374
misplaced, 71
recognition of, 306
to replace yourself, 273
single responsibility principle, 201, 214
of software developers, xxiv
Revision Control System, 333
Rigidity, 308
Ritchie, Dennis, 284
Rochkind, Marc, 333
Role Models, 289
RSpec, 104
Rubik’s cube, 215
S
Scrum, 258
Selection, 321
Selection to iteration transformation, 190
Self-Shunt pattern, 156
Semmelweis, Ignaz, 13
Sequence, 321
Setup method, 103
Simplicity
fundamental aspect of, 235
incremental derivation, 61, 82, 86
via expressive language, 233–234
via technology advances, 227
Single responsibility principle, 201, 214, 239, 246
Smalltalk, 108
Society
dependence on software, 9, 291, 306
responsibility to, 292
Software
failed estimates on, 358
invention of, 5
messy, harmful, 302
public trust in, xxiv–xxv
rigid, fragile, immobile, 256, 308–309, 345
similarity to accounting, 23
tests as documentation of, 26–28
untangled, 224
SOLID principles, 17, 143, 309–310
Sorting algorithms
Source code
continuous build of, 249
editors, 237
harm to, 303
Source Code Control System (SCCS), 333
Spies
fragility of testing with, 138, 139
mocks as, 121
in sine calculation algorithm, 133–135
for testing across boundaries, 144
Stabilization sprints, 258
Stack of integers, writing a, 36–52
StackTest, 37
Stairstep tests, 66
Standards
in Clean Craftsmanship, xxvi
defined, 252
differing perspectives on, 252
responsibility and, xix
single vs. multiple, xxii
Startups, 304
State/Transition diagram, 105–106
Statement to recursion transformation, 189–190
Stepdown rule, 202
Stevenson, Chris, 104
Stirling, Scott, 154
Story points, 275
Structure
behavior vs., 303–304, 307, 311
and collaborative programming, 244
duplication and, 237
Structured programming, 7, 319–323
Stubs
and business rule isolation, 269–270
in test double process, 115–117
Subversion, 334
Sullenberger, Chesley, 4
Surviving mutations, 344
T
Taylor series, 128, 130, 132–133
Teamwork
collaborative programming, 242–244
continuous integration and, 337
covering for each other, 272
honest/fair estimates as, 358–372
knowledge sharing via, 356
Technological advances, 227–228
Teradyne, 361
Test doubles
boundary crossing and, 144
mock objects, 108–110, 121–123
Test-driven development (TDD)
algorithm simplicity via, 61–62, 78–79
Arrange/Act/Assert pattern in, 104
BDD as, 105
continuous integration and, 337
as design technique, 312
as double-entry bookkeeping, 23
as foundational discipline, 14, 15–16
fragile test problem and, 160–161
incremental complexity in, 92
long-term mastery of, 148
uncertainty principle, 126–139
Test-Specific Subclass pattern, 155–156
Tests
Arrange/Act/Assert pattern, 103–104
assertions and spy behavior, 123
code and test communication, 236
continuous running of, 249
coverage by, 229–231, 239, 343–344
decoupling production code from, 161–184, 218
deleting stairstep, 66
excluding production data from, 116
as finite state transitions, 107
functions constrained by, 127
historic, 226
mutation testing, 344
as refactoring discipline, 218, 219–220, 221
semantic stability of, 344–345
specificity of, for generic code, 59, 82, 183–184
streamlining, 113
as theories, 323
transformations for passing, 184–196
vs. placing hooks, 227
written by/for BA and QA, 248–249
Thompson, Ken, 284
ThoughtWorks, 142
Tichy, Walter, 333
Toggles, branches vs., 338–340
Transformation priority premise, 195–196
Transistors, 6
Transition triplets, 106
Trim call, 101
Turing, Alan, 5–6, 62, 280–281
U
Uncertainty principle, 126–139, 140
Unconditional to selection transformation, 188–189
Underflow exceptions, 47
UNIX, 284
Untangling software, 224
User interface
and the Chicago school, 142
and the London school, 141
product as changed via, 304, 308
User perspective, 252
V
Vacuum tube computer, 6
Values
testing, 140
value to list transformation, 189
value to mutated value transformation, 190–191
View model, 151
Viscardi, Stacia, xix
Von Neumann, Jon, 282
W
Wake, Bill, 103
Whitehead, Gustave, 3
Work breakdown structure (WBS), 366–367
Wrap call, 100
Wright brothers, 3
X
XRay class, 155
XUnit Test Patterns (Meszaros), 110, 154
Y
Z
Zuse, Konrad, 5