1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
//! # The SPACE Framework
//!
//! SPACE measures developer productivity across five dimensions instead of
//! one: **Satisfaction and well-being**, **Performance**, **Activity**,
//! **Communication and collaboration**, and **Efficiency and flow**. No
//! single dimension is meant to stand alone; the framework's real
//! contribution is the discipline of holding all five in view together, so a
//! team cannot look productive on one axis while quietly damaging another.
//!
//! ## Formula
//!
//! ```text
//! SPACE dimensions (five, not a computed ratio):
//! S = Satisfaction and well-being
//! P = Performance
//! A = Activity
//! C = Communication and collaboration
//! E = Efficiency and flow
//!
//! Minimum balanced composition:
//! at least one metric from at least 3 of the 5 dimensions,
//! mixing objective instrumentation with subjective survey data
//! ```
//!
//! ## Why it matters
//!
//! Single-number developer productivity metrics — lines of code, commit
//! count, story points — are trivially gamed and routinely mislead. A team
//! can be highly active while performing poorly, or perform well in the
//! short term while satisfaction craters, a leading indicator of the
//! attrition and quality collapse that shows up months later. A
//! single-dimension metric set is a known anti-pattern: the book insists on
//! covering multiple dimensions together, mixing subjective (survey) and
//! objective (instrumented) data sources.
//!
//! ## Example
//!
//! ```rust
//! use software_engineering::space_framework::{
//! SpaceDimension, covers_all_dimensions, missing_dimensions,
//! };
//!
//! // A team that tracks only Activity is the book's classic anti-pattern.
//! let activity_only = [SpaceDimension::Activity];
//! assert!(!covers_all_dimensions(&activity_only));
//! assert_eq!(missing_dimensions(&activity_only).len(), 4);
//!
//! // A team that tracks all five is fully covered.
//! let all = [
//! SpaceDimension::Satisfaction,
//! SpaceDimension::Performance,
//! SpaceDimension::Activity,
//! SpaceDimension::Communication,
//! SpaceDimension::Efficiency,
//! ];
//! assert!(covers_all_dimensions(&all));
//! assert!(missing_dimensions(&all).is_empty());
//! ```
//!
//! ## Pitfalls
//!
//! - **Adopting SPACE in name only** while remaining activity-dominated in
//! practice defeats the framework's entire purpose.
//! - **Applying SPACE dimensions to individual scorecards** misapplies a
//! framework validated for team and system-level insight, not individual
//! performance.
//! - **Reviewing dimensions in isolation** rather than watching for
//! cross-dimensional trade-offs misses the pattern SPACE is specifically
//! designed to catch.
//! - **Treating a single satisfaction survey score as sufficient** without
//! objective data loses the balance the framework calls for.
//!
//! ## Sources
//!
//! - Chapter 3.1, The SPACE framework.
//! - Forsgren, Storey, Maddila, Zimmermann, Houck, and Butler, "The SPACE of
//! Developer Productivity," *ACM Queue* (2021).
//!
//! Topic doc: software-engineering-metrics/locales/en-001/chapters/03-01-the-space-framework.md
/// One of the five SPACE dimensions.
///
/// Canonical order follows the acronym: Satisfaction, Performance, Activity,
/// Communication, Efficiency.
/// The five canonical SPACE dimensions, in acronym order.
const ALL_DIMENSIONS: = ;
/// Whether a measured set of dimensions covers all five SPACE dimensions.
///
/// The book's recommended minimum is at least three of five dimensions with
/// mixed subjective and objective sources; this function checks full
/// coverage (all five), which `missing_dimensions` can help diagnose
/// against that minimum.
///
/// # Arguments
///
/// * `measured` — the SPACE dimensions currently measured by a team.
///
/// # Returns
///
/// `true` iff every one of the five canonical dimensions appears in
/// `measured` (duplicates are ignored).
///
/// # Examples
///
/// ```rust
/// use software_engineering::space_framework::{SpaceDimension, covers_all_dimensions};
///
/// let activity_only = [SpaceDimension::Activity];
/// assert!(!covers_all_dimensions(&activity_only));
/// ```
/// The SPACE dimensions not present in a measured set, in canonical order.
///
/// # Arguments
///
/// * `measured` — the SPACE dimensions currently measured by a team.
///
/// # Returns
///
/// A vector of the missing dimensions, in the order Satisfaction,
/// Performance, Activity, Communication, Efficiency. Empty when `measured`
/// already covers all five.
///
/// # Examples
///
/// ```rust
/// use software_engineering::space_framework::{SpaceDimension, missing_dimensions};
///
/// // A single-dimension metric set is the book's classic anti-pattern.
/// let activity_only = [SpaceDimension::Activity];
/// let missing = missing_dimensions(&activity_only);
/// assert_eq!(missing.len(), 4);
/// assert!(missing.contains(&SpaceDimension::Satisfaction));
/// ```