Software Engineering Rust crate
Software engineering metrics models, structs, calculations, and examples — 27 modules covering delivery flow, developer experience, code and test quality, product and business outcomes, reliability and security, and AI-assisted development. One module per topic, based on the book Software Engineering Metrics.
The crate is std-only with minimal dependencies: no module's public
API takes or returns a rusty-money
type, but a few financial modules' docs show how to combine their plain
f64 functions with rusty_money::Money directly in your own code (see
each module's own "Money" section). All quantities are f64 (except a few
naturally integer or enum-typed values, such as McCabe cyclomatic
complexity and severity levels), and functions return Option<f64>
wherever a denominator could be zero.
Install
Add the dependency to your Cargo.toml:
[]
= "0.3"
Quickstart
A DORA delivery-stability improvement, turned into a financial case:
use change_failure_rate_percent;
use roi;
// A platform team's change failure rate falls from 25% to 8% across
// 100 production deployments/year.
let cfr_before = change_failure_rate_percent.unwrap;
let cfr_after = change_failure_rate_percent.unwrap;
assert_eq!;
assert_eq!;
// 17 fewer failed deployments/year, each avoiding $12,000 of incident
// cost, is $204,000/year of benefit against a $150,000 investment.
let failed_deployments_avoided = 100.0 * / 100.0;
assert_eq!;
let benefit = failed_deployments_avoided * 12_000.0;
assert_eq!;
// ROI = (benefit − cost) / cost = 36%.
let return_on_investment = roi.unwrap;
assert!;
Money
technical_debt, unit_economics, and return_on_investment each show,
in their own module docs, how to use
rusty-money's Money type
directly alongside their plain-f64 functions — this crate has no
Money-wrapping functions of its own:
use ;
use roi;
let benefit = from_major;
let cost = from_major;
// rusty_money's own sub() catches a currency mismatch before it ever
// reaches roi(), which only ever sees plain, same-unit f64 amounts.
let net_benefit = benefit.sub.unwrap;
assert_eq!;
let r = roi.unwrap;
assert!;
// A benefit and cost in different currencies is an error, not a silent
// unit mismatch.
let eur_cost = from_major;
assert!;
Module index by theme
Flow metrics
flow_framework— flow velocity, flow distribution, flow time, flow load, Little's law, flow efficiencycycle_time— the five-stage cycle-time breakdown (coding, pickup, review, test, deploy)queueing_theory— utilization and queue stabilitylean_value_stream_metrics— percent complete and accurate, rolled throughput yield, takt timepull_request_metrics— time to first review, reviewer load concentrationdora_metrics— deployment frequency, lead time for changes, change failure rate, recovery time
Developer experience
space_framework— the five SPACE dimensions and coverage checksdeveloper_experience_metrics— focus time, survey response ratesatisfaction_metrics— eNPS-style satisfaction score, satisfaction trendactivity_metrics— commit-splitting gaming signal, activity rate as context only
Code and quality
code_complexity— McCabe cyclomatic complexitytest_effectiveness— test coverage, mutation kill ratecode_churn— code churn, hotspot scoretechnical_debt— debt carrying cost, with a directMoneyusage examplestatic_analysis_metrics— findings per KLOC, severity-weighted finding scoredocumentation_and_knowledge_metrics— bus factor, documentation coverage
Product and business
escaped_defects— escaped defect ratefeature_adoption— initial adoption, retained adoptionunit_economics— unit cost, with a directMoneyusage examplereturn_on_investment— ROI and ROI as a range, with a directMoneyusage examplecustomer_and_business_outcome_metrics— net revenue retention, honestly-scoped outcome claims
Reliability, operations, and security
error_budget— error budget and burn rateincident_metrics— MTTD, MTTA, MTTR, mean durationon_call_metrics— on-call paging concentrationvulnerability_management— severity levels, vulnerability time-to-remediate
AI-assisted development
ai_assisted_development— net cycle-time change, genuine vs false productivity gain
Metrics programs
maturity_model— minimum and average maturity scoring across dimensions
Testing
Every module reproduces its topic's worked example, or a value grounded
directly in the chapter's own text, in unit tests, and every doc example
compiles and asserts under cargo test --doc:
Citation
See CITATION.cff for citation metadata.
License
Any of MIT, Apache-2.0, BSD-3-Clause, GPL-2.0-only, or GPL-3.0-only, at
your option — or contact us for custom license options. See
LICENSE.md.
Tracking
- Package: software-engineering
- Repository: github.com/joelparkerhenderson/software-engineering-rust-crate
- Author: Joel Parker Henderson — joel@joelparkerhenderson.com