Hacker News new | ask | show | jobs
by projektfu 2726 days ago
Since we're referring to Bob Martin, I suspect the answer is through a functional test that captures that requirement. Thus, if a naive editor makes a change that breaks the requirement, it will not pass the test and cannot be committed to mainline.
1 comments

That catches a change, but doesn't give the reader the answer for why the code is like it is until they find the right test.
True enough, but in my limited experience it's more likely that such little requirements are hidden in code (and possibly commented) than that they have been properly captured by specifications and tests.