ACM Home Page
Please provide us with feedback. Feedback
ASTEC: a new approach to refactoring C
Full text PdfPdf (110 KB)
Source Foundations of Software Engineering archive
Proceedings of the 10th European software engineering conference held jointly with 13th ACM SIGSOFT international symposium on Foundations of software engineering table of contents
Lisbon, Portugal
SESSION: Software change analysis table of contents
Pages: 21 - 30  
Year of Publication: 2005
ISBN:1-59593-014-0
Also published in ...
Authors
Bill McCloskey  University of California, Berkeley, CA
Eric Brewer  University of California, Berkeley, CA
Sponsors
SIGSOFT: ACM Special Interest Group on Software Engineering
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 6,   Downloads (12 Months): 54,   Citation Count: 4
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1081706.1081712
What is a DOI?

ABSTRACT

The C language is among the most widely used in the world, particularly for critical infrastructure software. C programs depend upon macros processed using the C preprocessor, but these macros are difficult to analyze and are often error-prone[4]. Existing tools that analyze and transform C source code have rudimentary support for the preprocessor, leading to obscure error messages and difficulty refactoring. We present a three part solution: (1) a replacement macro language, ASTEC, that addresses the most important important deficiencies of the preprocessor and that eliminates many of the errors it introduces; (2) a translator, MACROSCOPE, that converts existing code into ASTEC semi-automatically; and (3), an ASTEC-aware refactoring tool that handles preprocessor constructs naturally.ASTEC's primary benefits are its analyzability and its refactorability. We present several refactorings that are enabled by ASTEC. Additionally, ASTEC eliminates many of the sources of errors that can plague C preprocessor macros; Ernst et al.[4] estimate that more than 20% of macros may contain errors. In this paper, we describe our translation and refactoring tools and evaluate them on a suite of programs including OpenSSH and the Linux kernel.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
ANSI/ISO/IEC 9899. Programming Languages - C, 1999.
 
2
Greg J. Badros. PCP3: A C front-end for preprocessor analysis and transformation. Technical report, University of Washington, October 1997.
 
3
Eclipse.org. http://www.eclipse.org.
 
4
 
5
6
 
7
Alejandra Garrido and Ralph Johnson. Refactoring C with conditional compilation. In Proceedings of the 18th IEEE International Conference on Automated Software Engineering, October 2003.
 
8
Panos Livadas and David T. Small. Understanding code containing preprocessor constructs. Technical report, Software Engineering Research Center, June 1994.
 
9
Microsoft Visual Studio. http://msdn.microsoft.com/vstudio/.
 
10
 
11


Collaborative Colleagues:
Bill McCloskey: colleagues
Eric Brewer: colleagues