Computing Reviews

TypeChef:toward type checking #ifdef variability in C
Kenner A., Kästner C., Haase S., Leich T.  FOSD 2010 (Proceedings of the 2nd International Workshop on Feature-Oriented Software Development, Eindhoven, the Netherlands, Oct 10, 2010)25-32,2010.Type:Proceedings
Date Reviewed: 05/19/11

The technique of generating a number of versions of a program from a single body of text goes back at least to the 1960s, when macro assembly languages were used to configure operating systems for differing mixes of hardware. Testing such programs has always been a problem, because of the combinatorial explosion of possible versions. This paper applies recent results in whole-text testing to situations in which the C preprocessor (cpp) is used for version generation.

After giving an overview of the problem and available approaches to mitigation, the authors discuss the particular difficulties that arise from cpp as a version generator: file inclusion, lexical macro substitution, and the ability to ignore syntactic structure. They describe a few straightforward restrictions on cpp usage; present TypeChef, a tool based on these; and apply TypeChef to an open-source program from which cpp can generate about 1,000 different versions.

Although TypeChef isn’t capable of handling arbitrary C programs, the limitations are consistent with good coding practices and present no difficulty for newly developed code. Timing tests indicate that, if more than 20 versions can be generated from a body of text, using TypeChef is quicker than generating and testing those versions individually.

I found the paper to be interesting and informative, both in its explanation of the general techniques and its exploration of the details. It should be accessible to anyone who is familiar with C and cpp.

Reviewer:  W. M. Waite Review #: CR139072 (1112-1300)

Reproduction in whole or in part without permission is prohibited.   Copyright 2024 ComputingReviews.com™
Terms of Use
| Privacy Policy