Some solutions to a programming problem are more elegant or more simple than others and thus more understandable for students. We review desirable properties of example programs from a cognitive and a measurement point of view. Certain cognitive aspects of example programs are captured by common software measures, but they are not sufficient to capture a key aspect of understandability: readability. We propose and discuss a simple readability measure for software, SRES, and apply it to object-oriented textbook examples. Our results show that readability measures correlate well with human perceptions of quality. Compared with other readability measures, SRES is less sensitive to commenting and white-space. These results also have implications for software maintainability measures.
Studien undersöker begripligheten av objektorienterade exempelprogram. Läsbarhet är en avgörande faktor för begriplighet. Vi presenterar ett mått för läsbarhet (SRES) och applicera det på exempel från vanliga läroböcker. Resultaten visar att SRES korrelerar väl med experters subjektiva kvalitetsintryck. Objektorientering, kvalitet, läsbarhet av kod.