Title :
Inference of field initialization
Author :
Spoto, Fausto ; Ernst, Michael D.
Author_Institution :
Dipt. di Inf., Univ. di Verona, Verona, Italy
Abstract :
A raw object is partially initialized, with only some fields set to legal values. It may violate its object invariants, such as that a given field is non-null. Programs often manipulate partially-initialized objects, but they must do so with care. Furthermore, analyses must be aware of field initialization. For instance, proving the absence of null pointer dereferences or of division by zero, or proving that object invariants are satisfied, requires information about initialization. We present a static analysis that infers a safe over-approximation of the program variables, fields, and array elements that, at run time, might hold raw objects. Our formalization is flow-sensitive and interprocedural, and it considers the exception flow in the analyzed program. We have proved the analysis sound and implemented it in a tool called Julia that computes initialization and nullness information. We have evaluated Julia on over 160K lines of code. We have compared its output to manually-written initialization and nullness information, and to an independently-written type-checking tool that checks initialization and nullness. Julia´s output is accurate and useful both to programmers and to static analyses.
Keywords :
inference mechanisms; program diagnostics; program verification; field initialization; flow-sensitive formalization; independently-written type-checking tool; inference; initialization computation; interprocedural formalization; nullness information; partially-initialized objects; program variable over-approximation; static analysis; Approximation methods; Arrays; Java; Manuals; Receivers; Semantics; Software; abstract interpretation; initialization; static analysis;
Conference_Titel :
Software Engineering (ICSE), 2011 33rd International Conference on
Conference_Location :
Honolulu, HI
Print_ISBN :
978-1-4503-0445-0
Electronic_ISBN :
0270-5257
DOI :
10.1145/1985793.1985826