Separating Intent from Implementation

An implementation is simply one way of many to accomplish an intent. If you have a clear understanding of the boundary between implementation and intent, you have a better mental model with which to write and test your software. Not infrequently, the implementation strongly resembles the intent. For example, an intent of “reward winning players” may implement as “query for winning users, iterate over them, and add a badge to each of their accomplishment lists.” The implementation language closely corresponds to the statement of intent, but it’s not the same thing.

Clearly delineating intent and implementation helps your testing efforts scale with your software. The more you can test the intent without incorporating ...

Get Quality Code: Software Testing Principles, Practices, and Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.