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
//! # Software Engineering
//!
//! Rust implementations of 29 software-engineering delivery, quality, and
//! reliability metrics — one module per topic. Each module implements the
//! formulas from its source chapter in the book *Software Engineering
//! Metrics* (`software-engineering-metrics/locales/en-001/chapters/*.md`),
//! documents them with runnable examples, and reproduces the chapter's
//! worked example (where the chapter gives one) in its unit tests.
//!
//! Dependencies are minimal: [`rusty_money`] is available for
//! currency-checked `Money` arithmetic (see each financial module's own
//! "Money" section for a direct-usage example); every module's own
//! functions still take and return plain `f64`, with no `rusty_money`
//! wrapper of any kind — combine the two directly in your own code rather
//! than through an adapter this crate provides. All quantities are `f64`
//! (or a small enum where the source material calls for a category, such
//! as a SPACE dimension or a vulnerability severity), and functions return
//! `Option<f64>` wherever a denominator could be zero.
//!
//! ## Quickstart
//!
//! A speed improvement, paired with its guardrail, funding a return:
//!
//! ```
//! use software_engineering::flow_framework::{littles_law_wip, flow_efficiency_percent};
//! use software_engineering::dora_metrics::change_failure_rate_percent;
//! use software_engineering::return_on_investment::roi;
//!
//! // A team arrives at 4 items/week with a 5-week flow time: Little's law
//! // says ~20 items are in process in the value stream at any moment.
//! let wip = littles_law_wip(4.0, 5.0);
//! assert_eq!(wip, 20.0);
//!
//! // Of those 5 weeks, only 1.5 weeks is active work: 30% flow efficiency.
//! let efficiency = flow_efficiency_percent(1.5, 5.0).unwrap();
//! assert!((efficiency - 30.0).abs() < 1e-9);
//!
//! // A speed improvement must be paired with its stability guardrail:
//! // change failure rate falls from 25% to 8% as the team ships faster,
//! // not despite it — the DORA finding that speed and stability move
//! // together in elite performers.
//! let cfr_after = change_failure_rate_percent(8.0, 100.0).unwrap();
//! assert!(cfr_after < 25.0);
//!
//! // The combined delivery investment returns 2.0 (200%) on its cost —
//! // every $1 invested returns $2 in net profit, a 3x total return.
//! let r = roi(300_000.0, 100_000.0).unwrap();
//! assert_eq!(r, 2.0);
//! ```
//!
//! ## Module index by theme
//!
//! **Flow metrics** —
//! [`flow_framework`], [`cycle_time`], [`queueing_theory`],
//! [`lean_value_stream_metrics`], [`pull_request_metrics`], [`dora_metrics`]
//!
//! **Developer experience** —
//! [`space_framework`], [`developer_experience_metrics`],
//! [`satisfaction_metrics`], [`performance_metrics`], [`activity_metrics`],
//! [`communication_metrics`]
//!
//! **Code and quality** —
//! [`code_complexity`], [`test_effectiveness`], [`code_churn`],
//! [`technical_debt`], [`static_analysis_metrics`],
//! [`documentation_and_knowledge_metrics`]
//!
//! **Product and business** —
//! [`escaped_defects`], [`feature_adoption`], [`unit_economics`],
//! [`return_on_investment`], [`customer_and_business_outcome_metrics`]
//!
//! **Reliability, operations, and security** —
//! [`error_budget`], [`incident_metrics`], [`on_call_metrics`],
//! [`vulnerability_management`]
//!
//! **AI-assisted development** —
//! [`ai_assisted_development`]
//!
//! **Metrics programs** —
//! [`maturity_model`]