Program Transformations to Fix C Integers

被引:0
|
作者
Coker, Zack [1 ]
Hafiz, Munawar [1 ]
机构
[1] Auburn Univ, Auburn, AL 36849 USA
关键词
Program Transformation; Integer Problem;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
C makes it easy to misuse integer types; even mature programs harbor many badly-written integer code. Traditional approaches at best detect these problems; they cannot guide developers to write correct code. We describe three program transformations that fix integer problems-one explicitly introduces casts to disambiguate type mismatch, another adds runtime checks to arithmetic operations, and the third one changes the type of a wrongly-declared integer. Together, these transformations fixed all variants of integer problems featured in 7,147 programs of NIST's SAMATE reference dataset, making the changes automatically on over 15 million lines of code. We also applied the transformations automatically on 5 open source software. The transformations made hundreds of changes on over 700,000 lines of code, but did not break the programs. Being integrated with source code and development process, these program transformations can fix integer problems, along with developers' misconceptions about integer usage.
引用
收藏
页码:792 / 801
页数:10
相关论文
共 50 条
  • [41] PROGRAM TRANSFORMATIONS FOR CONFIGURING COMPONENTS
    MASON, IA
    TALCOTT, CL
    SIGPLAN NOTICES, 1991, 26 (09): : 297 - 308
  • [42] EQUIVALENCY AND TRANSFORMATIONS OF PROGRAM SCHEMES
    YANOV, YI
    DOKLADY AKADEMII NAUK SSSR, 1957, 113 (01): : 39 - 42
  • [43] Specification method of program transformations
    Liu, Zongtian
    Jisuanji Yanjiu yu Fazhan/Computer Research and Development, 35 (01): : 87 - 90
  • [44] Automating Mathematical Program Transformations
    Agarwal, Ashish
    Bhat, Sooraj
    Gray, Alexander
    Grossmann, Ignacio E.
    PRACTICAL ASPECTS OF DECLARATIVE LANGUAGES, PROCEEDINGS, 2010, 5937 : 134 - +
  • [45] Mathematical foundations for program transformations
    Ben Ayed, R
    Desharnais, J
    Frappier, M
    Mili, A
    LOGIC-BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 1999, 1559 : 319 - 321
  • [46] EQUIVALENCE TRANSFORMATIONS PROGRAM SCHEMES
    SABELFELD, VK
    ACTA INFORMATICA, 1978, 10 (02) : 127 - 155
  • [47] Implementing typeful program transformations
    Chen, CY
    Xi, HW
    ACM SIGPLAN NOTICES, 2003, 38 (10) : 260 - 268
  • [48] The appearance of big integers in exact real arithmetic based on linear fractional transformations
    Heckmann, R
    FOUNDATIONS OF SOFTWARE SCIENCE AND COMPUTATION STRUCTURES, 1998, 1378 : 172 - 188
  • [49] Integers out of sorts? Program an FPGA to put them in order
    Peichel, C
    EDN, 1997, 42 (17) : 95 - &
  • [50] WHAT IF 2C AND 3C ARE INTEGERS
    WILANSKY, A
    AMERICAN MATHEMATICAL MONTHLY, 1976, 83 (06): : 473 - 473