Title
Modular Information Hiding and Type-Safe Linking for C
Abstract
This paper presents CMOD, a novel tool that provides a sound mod- ule system for C. CMOD works by enforcing a set of four rules that are based on principles of modular reasoning and on current pro- gramming practice. CMOD's rules flesh out the convention that .h header files are module interfaces and .c source files are module implementations. Although this convention is well-known, devel- oping CMOD's rules revealed there are many subtleties in applying the basic pattern correctly. We have proven formally that CMOD's rules enforce both information hiding and type-safe linking. We evaluated CMOD on a number of benchmarks, and found that most programs obey CMOD's rules, or can be made to with minimal ef- fort, while rule violations reveal brittle coding practices including numerous information hiding violations and occasional type errors. Categories and Subject Descriptors D.3.3 (Programming Lan- guages): Language Constructs and Features—Modules, packages previously developed to the point that proper information hiding and type safety are provable consequences. As a result, program- mers may be unaware of (or ignore) the subtleties of using the pat- tern correctly, and thus may make mistakes (or cut corners), since the compiler and linker provide no enforcement. The result is the potential for type errors and information hiding violations, which degrade programs' modular structure, complicate maintenance, and lead to defects. As a remedy to these problems, this paper presents CMOD, a novel tool that provides a sound module system for C by enforc- ing four rules that flesh out C's basic modularity pattern. In other words, CMOD aims to enable safe modular reasoning while match- ing existing programming practice as much as possible. We have proven formally that CMOD's four rules ensure that C programs obey information hiding policies implied by interfaces, and that
Year
DOI
Venue
2008
10.1109/TSE.2008.25
Software Engineering, IEEE Transactions
Keywords
Field
DocType
public domain software,module implementation,rules flesh,information hiding,sound module system,compiler,type-safe linking,module interface,c language,basic pattern,numerous information hiding violation,current programming practice,code design,cmod,data encapsulation,reliability,c. cmod,object-oriented programming,brittle coding practice,modular information hiding,modular reasoning,software reusability,coding tools and techniques,modules,open source programs,packages,program compilers,type safety,c,technical report
Mod,Programming language,Computer science,Information hiding,Theoretical computer science,Coding (social sciences),Modular reasoning,Implementation,Header,Modular design,Type safety
Journal
Volume
Issue
ISSN
34
3
0098-5589
ISBN
Citations 
PageRank 
1-59593-393-X
4
0.53
References 
Authors
17
4
Name
Order
Citations
PageRank
Saurabh Srivastava118419.27
Michael W. Hicks2106161.49
Jeffrey S. Foster32035174.45
Patrick Jenkins440.53