This is a yarn about software engineering1.
There’s a luxury apartment complex. One of the nice features of the luxury apartment complex is that the master bathroom in each luxury apartment is well-appointed. It features a shower, bath, toilet, two sinks, and a bidet2. These apartments lease for many thousand dollars per month, so such features are expected by the renters.
Once every few months, some circumstances combine and violent water hammer breaks out in the bathrooms of one of these apartments. This causes noisy shaking in the walls, sure, but if allowed to continue for more than a couple of seconds, the pipes start breaking, water sprays all inside the walls, and all hell breaks loose. Substantial damage is done to the bathroom and adjoining walls. The tenants have to use their second bathroom (not nearly so luxurious, lacking the bidet, separate shower/tub, and one of the sinks) or stay somewhere else while weeks of repairs and renovation are done. It’s not really clear what combination of devices causes the behavior, but it’s clear that in each situation more than one thing was using water at a time.
A couple of tenants experience this, and when it comes time to re-lease, they decide they’ve had enough and move out. These tenants go out on the Internet and complain about the apartment. The company has to lower the rent and do its best to improve the situation so it can increase occupancy and raise rent again. They send around a memo to all existing and future tenants telling them about the water hammer. They’re advised not to use more than one water-consuming device in their bathrooms at a time.
This seems a perfect solution, but the residents complain. They have two sinks, they should be able to use two sinks, right? So the management office says “well, we’re sure that two sinks should be fine, it’s not like you’re using everything at once. Feel free to use two sinks.”
So residents start using the two sinks (in fact they never stopped in the first place, because nobody pays attention to memos and rules), and sure enough, using two sinks is fine.
But a few residents experience the water hammer, have to survive in their third-world bathrooms for a few weeks, and complain. They’re told that they’re idiots. They should have read the memo and not used more than one thing at once, though they could have used two sinks, because that’s okay.
The residents of course say “yeah, whatever” and decide not to re-lease and we’re back to the same problem.
So, it’s clear the apartment complex has to do something. It calls in its plumber, and the plumber asks what residents were doing when they experience the water hammer. They were “just using a few things” but can’t remember what. The plumber gives each device a try and says they all work and packs up for the day.
The management company sends its maintenance staff to try to reproduce the problem. It’s just six devices, it can’t be that hard to figure out the problem, right? Basic combinatorics, which every maintenance staff knows, tells the management company that they just need to test every combination of on and off for the six water-using devices. 64 tests later, they’ll know what combination of usage causes the problem, right?
Well, that sounds like a lot of work, so the maintenance staff takes some shortcuts and just tries all trios of things together. 20 tests later everything still works and they attribute the numerous incidents in the past to freak accidents that won’t ever happen again.
The plumber confirms this, since they’ve had to re-do a bunch of the plumbing anyway, it’s probably fixed.
Sure enough, another resident experiences the problem, gets pissed, and moves out. It’s time to get to the bottom of this. The shortcuts taken by the maintenance staff were uncovered via an inquisition, and the management staff demands they go through all the combinations, not just the combinations of three devices!
They go through all the combinations and nothing happens.
The plumber is consulted again, and they smartly tell the management company that that result is obvious: It’s a master bathroom, which means two people at most, most likely. Is it really likely they would be using more than three devices at a time? Why would they think that more than three devices at a time cause the problem?
So now the search space is pruned, again, but still nothing has been uncovered.
Somebody (attributed to the management company, but nobody can quite remember) has the bright idea to start thinking the problem through more carefully. There may be six water-consuming devices, but they all consume water in different ways!
After all, the sink, tub, and shower can all adjust their temperatures, which means a seemingly infinite series of output water temperatures and input hot and cold water consumption can be experienced.
Perhaps if they use enough maintenance staff and approximate various gradations of temperature along the way, they can reproduce the circumstances. The maintenance staff dives into the problem head-first.
Hours elapse, but still no water hammer. Back to the plumber, who again reminds them that they’ve over-simplifying things. The sink faucets have pressure adjustment as well as temperature. The shower head has a lever to adjust the spray which adjusts the pressure. They get into topics of differential pressure between the hot and cold water lines, and how adjusting the shower head’s spray may ultimately adjust not just the amount, but also the ratio of each type of water flowing through the shower head.
Bewildered, but satisfied, the conference call between the management company, maintenance staff, and plumber is about to end. The plumber, however, is not finished!
The plumbed starts explaining how bad the situation is. The pipes leading to the bathroom change temperature over time. The hot water heater doesn’t deliver water consistently at the same temperature. The cold water isn’t always the same temperature. The ambient temperature varies in both the apartment and the walls.
The pressure in the building varies between negative and positive pressure versus ambient. There are other water-consuming appliances in the apartment, including another bathroom and a half, dish washer, several sinks, washing machines, humidifiers for the central air, and so forth.
There are other apartments in the building and other buildings in the neighborhood, and there are pressure boosters on every 4 floors to keep the water pressure up, which also means that the pressure varies between floors. Seals and valves degrade in performance and behavior over time, such that the same handle input doesn’t produce the same result. Toilet ballasts and seals change over time, and some of the newer toilets have two different flush settings. Further they have very periodic and definite on/off behavior, whereas some faucets and things like bidets aren’t necessarily turned on full blast right away. Different shower and faucet heads have different classes of flow restriction devices depending on when they were manufactured.
Also, sometimes people take longer showers or decide to take a bath instead, and …
You get the idea. Now what?
though it certainly sounds nice!