An interactive simulation of the software development process as a stock and flow system, based on Will Larson's Developer Experience Model.
This application helps visualize and understand how different factors in the development process impact overall velocity:
- Error rates at different stages (testing, deployment, production)
- Flow rates for each development stage
- Capacity constraints on work in progress
- Initial conditions and simulation duration
The model demonstrates that production error rate is often the primary constraint on velocity, not development speed. Increasing development velocity while maintaining high error rates can actually be counterproductive.
- Python 3.8 or higher
- pip package manager
-
Clone or download this repository
-
Install dependencies:
pip install -r requirements.txtLaunch the Streamlit app:
streamlit run app.pyThe application will open in your default web browser at http://localhost:8501.
-
Configure Parameters: Use the sidebar to adjust simulation parameters:
- Error Rates: Set the percentage of work that encounters errors at each stage
- Flow Rates: Set how many tickets can be processed per time step at each stage
- Capacity Constraints: Set the maximum concurrent work in progress
- Initial State: Set the starting number of open tickets
- Simulation Duration: Set how many time steps to simulate
-
Run Simulation: Click the "Run Simulation" button to execute the model
-
Analyze Results: Explore three views:
- Stock Levels Over Time: Line chart showing ticket counts in each stage
- Stock & Flow Diagram: Visual representation of the development pipeline
- Flow Rates: Charts showing forward flows and error flows over time
-
Experiment: Try different scenarios to understand their impact:
- Reduce production error rate (often has the biggest impact)
- Increase development speed (may not help if error rates are high)
- Adjust capacity constraints to see bottleneck effects
- Backlog - Work waiting to be started
- In Development - Work in active development
- In Testing - Work that has been tested
- Awaiting Release - Work staged for production
- Live in Production - Completed work deployed to users
- Ticket Opening → Start Coding → Testing → Deployment → Closing
- Bugs Found in Testing: In Testing → In Development
- Release Blocked: Awaiting Release → In Development
- Defects in Production: Live in Production → Backlog
- Tickets flow left-to-right through the development process
- Errors cause tickets to flow backward (rework)
- Each stage has a maximum flow rate
- Capacity constraints limit work in progress
- The system reaches equilibrium when error generation balances completion rate
Default ranges are scaled for a typical development organization:
- Error Rates: 0% to 50% (0.0 to 0.5)
- Flow Rates: 1 to 100 tickets per time step
- Max Concurrent: 1 to 200 tickets
- Initial Backlog Size: 10 to 1000
- Simulation Duration: 20 to 200 time steps
Adjust these ranges in the code if your organization operates at a different scale.
Production Error Rate: 25%
Other Errors: 10-15%
Flow Rates: All at 10
Result: System reaches equilibrium quickly. Items live in production plateau as production defects keep returning work to the backlog.
Production Error Rate: 10% (reduced!)
Testing Error Rate: 20% (increased)
Other parameters: Same as baseline
Result: More time spent in testing loop (catching errors early), but many more items successfully go live over time.
All Flow Rates: 30 (3x faster)
Error Rates: Same as baseline
Result: Minimal improvement in items going live. The constraint is error rate, not development speed.
devsim/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── README.md # This file
├── simulation/
│ ├── __init__.py
│ ├── engine.py # Core simulation logic
│ └── config.py # Configuration dataclass
├── visualization/
│ ├── __init__.py
│ └── diagram.py # Plotly diagram renderer
└── tests/
├── __init__.py
└── test_simulation.py # Unit tests
Run the test suite:
pytest tests/Or with verbose output:
pytest tests/ -vEdit the slider parameters in app.py to adjust ranges for your organization's scale.
The simulation tracks stock levels and flows. You can add custom metrics by:
- Calculating them from the history DataFrames
- Adding new visualizations in
app.py
The model can be extended to include:
- Multiple development teams
- Different ticket priorities
- Seasonal variations in ticket opening rates
- More granular error types
- Resource constraints (engineers, infrastructure)
Edit simulation/engine.py to modify the core model logic.
- Push this repository to GitHub
- Go to share.streamlit.io
- Connect your GitHub repository
- Deploy the app
The app will be publicly accessible via a streamlit.io URL.
Create a Dockerfile:
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]Build and run:
docker build -t devsim .
docker run -p 8501:8501 devsim- Will Larson's Blog Post - Original systems model
- System Dynamics - Methodology background
- Streamlit Documentation - UI framework
- Plotly Documentation - Visualization library
See LICENSE file for details.
This is a demonstration project. Feel free to fork and modify for your organization's needs.
Created as a learning tool to understand developer velocity dynamics through systems thinking.