One Piece Flow

How does a lean manufacturing principle apply to software development? That's a good question and I'll provide some answers, but first let's define one piece flow.

Definition

From Learn Lean 6 Sigma: One Piece Flow, also known as Single Piece Flow or Continuous Flow, is a fundamental concept in Lean Manufacturing and Lean Six Sigma. It refers to the practice of moving one workpiece at a time between operations within a production process, rather than batching work. This approach is designed to improve efficiency, reduce waste, and enhance product quality.

Inventory is a Cost

As you can see from the definition, one piece flow reduces batching inventory in front of each station. Inventory is considered a cost in lean because it costs money everytime you interact with it until you sell it.

In software, unreleased code is inventory. It doesn't make money and you pay developers to maintain it until if or when it's released.

How One Piece Flow Limit Inventory

Once piece flow limits inventory because only one workpiece is moved through the value stream.

This may sound inefficient, but even if you build things a little slower, you save costs by not paying to manage inventory.

Here's a letter stuffing experiment you can do to test one piece flow.

What you'll need: * 100 or so sheets of paper * 100 or so envelopes * Small sponges and water (optional) * Tiny PostIt notes to act as stamps

  1. Take an even number of people and divide them into two groups
  2. Divide the supplies evenly amongst the groups
  3. Setup one group in an assembly line
    1. A folder who folds the paper to fit the envelopes
    2. A stuffer who puts the folded paper in the envelope
    3. A sealer who seals the envelope
    4. A stamper who "stamps" the envelope with the PostIt
  4. Let the other group organize the supplies how they want
    1. Each member will fold, stuff, seal and stamp
  5. Time how long it takes each group to complete all the envelopes
    1. Occasionally stop the stop watch and observe how much incomplete inventory is in front of each station in the assembly line
    2. Observe how each pile of inventory is shuffled, stacked, faced, etc

Every time I've facilitated this experiment, the one piece flow team completes the task first.

Not only is one piece flow not inefficient, but at anytime during production there's only one pile of inventory instead of four.

What Does All This Have To Do With Software?

Kanban and mog programming encourage one piece flow.

In Kanban the board is setup with WIP limits that encourage pull midnightblueand flow.

Mob programming has the whole team work on one story at a time. There's only one piece of inventory (unsellable software) at a time.

Of course to truly take advantage of one piece flow you'll have to get very good at CI/CD to the point where every push is a deploy to production.

No branches (unless you branch to remote mob).

No code reviews.

Summary

Unfinished code is a cost. You've paid very expensive developers to build it just to have it sit in unmerged branches waiting on a code review, then QA to test, then wait for the release train to come a steaming by.

Lead time is your friend. The quicker you can get a story from backlog to deployed, the lower your costs. One piece flow can help you get there.