Chapter 2. Intent of Code

Have you ever found yourself working in your favorite IDE with all of its bells and whistles (syntax checking, auto-completion, static analysis, and other features) and lamented the lack of one particular feature that hasn’t been invented yet? Yes, I’m referring to the Intention Checker. You know it. The feature you wanted when you thought, “I wish it would code what I meant and not what I typed!” Maybe you wanted it when you were struggling with a tricky algorithm. Perhaps you invoked it when you found that silly one-character bug. Whatever the circumstance, you’ve encountered the complexity of translating intention into implementation.

On the other side, we’ve all asked questions like “What is this code doing?” or the more extreme “What the @$!%& was this developer thinking?” Testing is all about verifying that the implementation matches the explicit or implicit intent of the development: explicit in that the code is supposed to accomplish some goal, implicit in that it is also supposed to do it with certain characteristics of usability, robustness, and so forth, regardless of whether they were specifically considered.1

1. It is important to consider that this occurs at many levels in the software development process. We translate what the user wants into what we think they want, what features we should add to address their need, how we map those features to our existing or desired application, how that fits into our architecture and design, and how we code it. Many of the points made in this chapter can extrapolate to the other levels.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.107.85