Testing, active reading and code reading

After reading Cem Kaner’s and James Bach’s slides on exploratory testing I noticed a technique I didn’t know about before, active reading, which can be distilled into SQ3R. Basically when you have a document to read, start by skimming the headings/topic sentences, determine questions to ask, read the document to answer the questions, distill the information into proper recall and review it.

This fits into spaced repetition quite nicely. After the information is distilled for recall, input it into a spaced repetition system for review.

The emphasis in the exploratory testing slides is to use this technique to rapidly gain information from documentation such as user manuals, design specs, etc. This is important, but I wonder if it can be used in code reading.

For example, for the YAJII project it might be broken into steps like this:

  • Scan the names of public classes
  • Ask questions about functionality
    • What is the public API and how is it used?
    • What are the areas that are highest risk?
    • What are the inflection points where unit tests can easily be added?
  • Read the code in detail while trying to answer these questions.
  • Write unit tests and additional documentation to record the answers found.
  • Reread the new documentation and unit tests, verifying against the code.

I’m going to try to do this in detail for my book on structured programming, even though I’ve read through it once, it’s very dense and some parts are hard to apply to modern programming languages. Some questions that I’ll want to answer (probably using my type system for objects book) are:

What are the terminologies used in structured programming and how do they relate to modern languages and object oriented programming? What techniques do they recommend for reading structured programs that can be applied to modern languages? What techniques need to be adapted? Are there techniques for unstructured program reading and modification that can be applied to modern languages?

Comments are closed.