• DocumentCode
    3142722
  • Title

    Program transformations to fix C integers

  • Author

    Coker, Zachary ; Hafiz, Munawar

  • Author_Institution
    Auburn Univ., Auburn, AL, USA
  • fYear
    2013
  • fDate
    18-26 May 2013
  • Firstpage
    792
  • Lastpage
    801
  • Abstract
    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.
  • Keywords
    digital arithmetic; integer programming; programming; arithmetic operations; fix C integers; integer code; integer problems; integer types; integer usage; program transformations; source code; Arrays; Computer bugs; Context; Guidelines; Libraries; Runtime; Semantics; Integer Problem; Program Transformation;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Engineering (ICSE), 2013 35th International Conference on
  • Conference_Location
    San Francisco, CA
  • Print_ISBN
    978-1-4673-3073-2
  • Type

    conf

  • DOI
    10.1109/ICSE.2013.6606625
  • Filename
    6606625