Skip to main content

Crate software_engineering

Crate software_engineering 

Source
Expand description

§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

Modules§

activity_metrics
Activity Metrics and Their Limits
ai_assisted_development
Measuring AI-Assisted Software Development
code_churn
Code Churn and Hotspot Analysis
code_complexity
Code Complexity Metrics
communication_metrics
Communication and Collaboration Metrics
customer_and_business_outcome_metrics
Customer and Business Outcome Metrics
cycle_time
Cycle Time and Its Components
developer_experience_metrics
Developer Experience Metrics
documentation_and_knowledge_metrics
Documentation and Knowledge Metrics
dora_metrics
The DORA Metrics Framework
error_budget
SLIs, SLOs, and Error Budgets
escaped_defects
Escaped Defect Rate and Quality Escapes
feature_adoption
Feature Adoption and Usage Metrics
flow_framework
Flow Framework
incident_metrics
Incident Metrics
lean_value_stream_metrics
Lean Value Stream Metrics
maturity_model
Maturity Model for Engineering Metrics Programs
on_call_metrics
On-Call, Capacity, and Operational Load Metrics
performance_metrics
Performance Metrics and Outcome Proxies
pull_request_metrics
Pull Request and Code Review Metrics
queueing_theory
Queueing Theory
return_on_investment
Return on Investment for Engineering Initiatives
satisfaction_metrics
Satisfaction and Well-Being Metrics
space_framework
The SPACE Framework
static_analysis_metrics
Static Analysis and Code Smell Metrics
technical_debt
Technical Debt Measurement
test_effectiveness
Test Coverage and Test Effectiveness
unit_economics
Cost and Unit Economics of Engineering
vulnerability_management
Security and Vulnerability Management Metrics