Adding complexity in code is easy. Removing it often takes a little bit more effort. Using root cause analysis, we can sometimes remove this unneeded complexity. Here’s an example my pair and I went through today.
Me: Why is this test breaking?
Pair: Because we have to specify a different value than that one.
Me: Why do we have to a specify a different value than that one?
Pair: Because we have different values in this configuration file for tests.
Me: Why do we have different values in the configuration file for tests?
Pair: So that we can bind services to a different name?
Me: Why do we want to bind services to a different name? (since we have a contract with our clients that never change)
Pair: I’m not so sure… Let’s ask our BA.
Me (to the BA): Why do we want to bind services to a different name?
BA: I don’t know. (Thinks about it for a while…) I don’t think we would.
Now knowing that we wouldn’t ever deploy our application with a different configuration, we got to delete a whole lot of code, and an unnecessarily complicated configuration file. Awesome!