One of the thinking points when I consider code design, and as a positive feature, is locality of effect.  Which I don't think is a formal term (except in quantum mechanics), but it's the only one I got for the idea.  An extension of that that I've just been thinking about is locality of expectation.  How well does a piece of code express everything necessary to make the code successfully execute?  The finer the grain the better – at the largest scale this is stuff like what needs to be installed, what services need to be up, etc.  Then you can move down to libraries, modules, functions, methods, each to greater effect.

Unit testing helps here, but to go a bit further you might ask: how hard is it to write an invalid unit test?  But to look at it that way you have to split the unit test into two parts: action and confirmation.  You can easily write invalid confirmations, e.g., "assertEqual(3+4, 10)" – and you can think of exceptions and other failures as kinds of confirmations.  But ignoring confirmation, how certain can you be of the validity of actions?
Shared publiclyView activity