Show simple item record

dc.contributor.authorSankaranarayanan, Hemaiyer
dc.contributor.authorKulkarni, Prasad A.
dc.date.accessioned2013-07-30T20:26:01Z
dc.date.available2013-07-30T20:26:01Z
dc.date.issued2013-05-01
dc.identifier.citationSankaranarayanan, H. and Kulkarni, P.A. (2013) Source-to-Source Refactoring and Elimination of Global Variables in C Programs. A Journal of Software Engineering and Applications, 1-10. http://dx.doi.org/10.4236/jsea.2013.65033
dc.identifier.urihttp://hdl.handle.net/1808/11547
dc.descriptionA grant from the One-University Open Access Fund at the University of Kansas was used to defray the author’s publication fees in this Open Access journal. The Open Access Fund, administered by librarians from the KU, KU Law, and KUMC libraries, is made possible by contributions from the offices of KU Provost, KU Vice Chancellor for Research & Graduate Studies, and KUMC Vice Chancellor for Research. For more information about the Open Access Fund, please see http://library.kumc.edu/authors-fund.xml.
dc.description.abstractA global variable in C/C++ is one that is declared outside a function, and whose scope extends the lifetime of the entire program. Global variables cause problems for program dependability, maintainability, extensibility, verification, and thread-safety. However, global variables can also make co ding more convenient and improve program performance. We have found the use of global variables to remain unabated and extensive in real-world software. In this paper we present a source-to-source refactoring tool to au tomatically detect and localize global variables in a program. We implement a compiler based transformation to find the best location to redefine each global va riable as a local. For each global, our algorithm initializes the corresponding new local variable, pa sses it as an argument to necessary functions, and updates the source lines that used the global to now instead use th e corresponding local or argumen t. We also characterize the use of global variables in standard benchmark programs. We study the effect of our transformation on static program properties, such as change in the number of function ar guments and program state visibility. Additionally, we quantify dynamic program features, including memory and runtime performance, before and after our localizing transformation.
dc.publisherScientific Research
dc.rightsCopyright ©2013 Hemaiyer Sankaranarayanan, Prasad A. Kulkarni. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
dc.rights.urihttp://creativecommons.org/licenses/by/4.0/
dc.rights.urihttp://creativecommons.org/licenses/by/2.0
dc.titleSource-to-Source Refactoring and Elimination of Global Variables in C Programs
dc.typeArticle
kusw.kuauthorKulkarni, Prasad A.
kusw.kudepartmentDepartment of Electrical Engr & Comp Science
kusw.oastatusfullparticipation
dc.identifier.doi10.4236/jsea.2013.65033
kusw.oaversionScholarly/refereed, publisher version
kusw.oapolicyThis item meets KU Open Access policy criteria.
dc.rights.accessrightsopenAccess


Files in this item

Thumbnail

This item appears in the following Collection(s)

Show simple item record

Copyright ©2013 Hemaiyer Sankaranarayanan, Prasad A. Kulkarni. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Except where otherwise noted, this item's license is described as: Copyright ©2013 Hemaiyer Sankaranarayanan, Prasad A. Kulkarni. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.