Results 1 - 10
of
15
Type qualifier inference for Java
- In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA
, 2007
"... Java’s type system provides programmers with strong guarantees of type and memory safety, but there are many important properties not captured by standard Java types. We describe JQual, a tool that adds user-defined type qualifiers to Java, allowing programmers to quickly and easily incorporate extr ..."
Abstract
-
Cited by 17 (0 self)
- Add to MetaCart
Java’s type system provides programmers with strong guarantees of type and memory safety, but there are many important properties not captured by standard Java types. We describe JQual, a tool that adds user-defined type qualifiers to Java, allowing programmers to quickly and easily incorporate extra lightweight, application-specific type checking into their programs. JQual provides type qualifier inference, so that programmers need only add a few key qualifier annotations to their program, and then JQual infers any remaining qualifiers and checks their consistency. We explore two applications of JQual. First, we introduce opaque and enum qualifiers to track C pointers and enumerations that flow through Java code via the JNI. In our benchmarks we found that these C values are treated correctly, but there are some places where a client could potentially violate safety. Second, we introduce a readonly qualifier for annotating references that cannot be used to modify the objects they refer to. We found that JQual is able to automatically infer readonly in many places on method signatures. These results suggest that type qualifiers and type qualifier inference are a useful addition to Java. Categories and Subject Descriptors D.2.4 [Software Engineering]:
Compile-Time Views of Execution Structure Based on Ownership
- In Intl. Workshop on Aliasing, Confinement and Ownership
, 2007
"... A developer often needs to understand both the code structure and the execution structure of an object-oriented program. Class diagrams extracted from source are often sufficient to understand the code structure. However, existing static or dynamic analyses that produce raw graphs of objects and rel ..."
Abstract
-
Cited by 13 (11 self)
- Add to MetaCart
A developer often needs to understand both the code structure and the execution structure of an object-oriented program. Class diagrams extracted from source are often sufficient to understand the code structure. However, existing static or dynamic analyses that produce raw graphs of objects and relations between them, do not convey design intent or readily scale to large programs. Imposing an ownership hierarchy on a program’s execution structure through ownership domain annotations provides an intuitive and appealing mechanism to obtain, at compile-time, a visualization of a system’s execution structure. The visualization conveys design intent, is hierarchical, and thus is more scalable than existing approaches that produce raw object graphs. We first describe the construction of the visualization and then evaluate it on two real Java programs of 15,000 lines of code each that have been previously annotated. In both cases, the automatically generated visualization fit on one page, and gave us insights into the execution structure that would be otherwise hard to obtain by looking at the code, at existing class diagrams, or at unreadable visualizations produced by existing compile-time approaches. 1.
Static Extraction of Sound Hierarchical Runtime Object Graphs
, 2008
"... For many object-oriented systems, it is often useful to have a runtime architecture that shows networks of communicating objects. But it is hard to statically extract runtime object graphs that provide architectural abstraction from existing programs written in general purpose languages, and that fo ..."
Abstract
-
Cited by 7 (5 self)
- Add to MetaCart
For many object-oriented systems, it is often useful to have a runtime architecture that shows networks of communicating objects. But it is hard to statically extract runtime object graphs that provide architectural abstraction from existing programs written in general purpose languages, and that follow common design idioms. Previous approaches extract low-level non-hierarchical object graphs that do not provide architectural abstraction, change the language too radically for many existing implementations, or use a dynamic analysis. Static analysis, which takes all possible executions into account, is essential to extract a sound architecture, one that reveals all objects and relations that could possibly exist at runtime. Ownership domain type annotations specify in code architectural intent related to object encapsulation and communication. We propose a static analysis that leverages such types and extracts a hierarchical approximation of all possible runtime object graphs. The representation provides architectural abstraction, first by ownership hierarchy, and then by types. We proved core soundness results for the technique and evaluated it on 68 KLOC of real code.
Static Inference of Universe Types
- In IWACO
, 2008
"... The Universe type system is an ownership type system which enforces the owners-as-modifiers model. In this paper, we present a static analysis for inference of Universe types. We have implemented the analysis and performed preliminary experiments. Our results are promising. 1. ..."
Abstract
-
Cited by 7 (1 self)
- Add to MetaCart
The Universe type system is an ownership type system which enforces the owners-as-modifiers model. In this paper, we present a static analysis for inference of Universe types. We have implemented the analysis and performed preliminary experiments. Our results are promising. 1.
Inference of Reference Immutability
"... Abstract. Javari is an extension of Java that supports reference immutability constraints. Programmers write readonly type qualifiers and other constraints, and the Javari typechecker detects mutation errors (incorrect side effects) or verifies their absence. While case studies have demonstrated the ..."
Abstract
-
Cited by 7 (2 self)
- Add to MetaCart
Abstract. Javari is an extension of Java that supports reference immutability constraints. Programmers write readonly type qualifiers and other constraints, and the Javari typechecker detects mutation errors (incorrect side effects) or verifies their absence. While case studies have demonstrated the practicality and value of Javari, a barrier to usability remains. A Javari program will not typecheck unless all the references in the APIs of libraries it uses are annotated with Javari type qualifiers. Manually converting existing Java libraries to Javari is tedious and error-prone. We present an algorithm for inferring reference immutability in Javari. The flow-insensitive and context-sensitive algorithm is sound and produces a set of qualifiers that typecheck in Javari. The algorithm is precise in that it infers the most readonly qualifiers possible; adding any additional readonly qualifiers will cause the program to not typecheck. We have implemented the algorithm in a tool, Javarifier, that infers the Javari type qualifiers over a set of class files. Javarifier automatically converts Java libraries to Javari. Additionally, Javarifier eases the task of converting legacy programs to Javari by inferring the mutability of every reference in a program. In case studies, Javarifier correctly inferred mutability over Java programs of up to 110 KLOC. 1
Static Conformance Checking of Runtime Architectural Structure
, 2008
"... It is hard to statically check a system’s conformance to its runtime architectural structure. Previous approaches address the code architecture, change the language radically, mandate implementation frameworks, or use dynamic analyses that cannot check all possible program runs. We propose a static ..."
Abstract
-
Cited by 4 (3 self)
- Add to MetaCart
It is hard to statically check a system’s conformance to its runtime architectural structure. Previous approaches address the code architecture, change the language radically, mandate implementation frameworks, or use dynamic analyses that cannot check all possible program runs. We propose a static approach that supports existing object-oriented implementations, but relies on program annotations to encode architectural intent. We statically extract a hierarchical view of the runtime object graph from the annotated program and map it into an as-built runtime architecture. We then check and measure the structural conformance of the as-built and the as-designed architectures.
Detecting Inefficiently-Used Containers to Avoid Bloat
- ACM SIGPLAN 2010 CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION
, 2010
"... Runtime bloat degrades significantly the performance and scalability of software systems. An important source of bloat is the inefficient use of containers. It is expensive to create inefficiently-used containers and to invoke their associated methods, as this may ultimately execute large volumes of ..."
Abstract
-
Cited by 4 (3 self)
- Add to MetaCart
Runtime bloat degrades significantly the performance and scalability of software systems. An important source of bloat is the inefficient use of containers. It is expensive to create inefficiently-used containers and to invoke their associated methods, as this may ultimately execute large volumes of code, with call stacks dozens deep, and allocate many temporary objects. This paper presents practical static and dynamic tools that can find inappropriate use of containers in Java programs. At the core of these tools is a base static analysis that identifies, for each container, the objects that are added to this container and the key statements (i.e., heap loads and stores) that achieve the semantics of common container operations such as ADD and GET. The static tool finds problematic uses of containers by considering the nesting relationships among the loops where these semantics-achieving statements
Practical Static Analysis for Inference of Security-Related Program Properties
"... We present a static analysis framework for inference of security-related program properties. Within this framework we design and implement ownership, immutability and information flow inference analyses for Java. We perform empirical investigation on a set of Java components, and on a set of establi ..."
Abstract
-
Cited by 3 (2 self)
- Add to MetaCart
We present a static analysis framework for inference of security-related program properties. Within this framework we design and implement ownership, immutability and information flow inference analyses for Java. We perform empirical investigation on a set of Java components, and on a set of established security benchmarks. The results indicate that the analyses are practical and precise, and therefore can be integrated in program comprehension tools that support reasoning about software security and software quality. 1
Practical Static Ownership Inference
"... Abstract. There are many proposals for ownership type systems designed to control aliasing in object-oriented programs. Most systems require significant annotation effort and therefore it may be difficult to adopt these systems in software practice. Ownership inference has received less attention, w ..."
Abstract
-
Cited by 3 (1 self)
- Add to MetaCart
Abstract. There are many proposals for ownership type systems designed to control aliasing in object-oriented programs. Most systems require significant annotation effort and therefore it may be difficult to adopt these systems in software practice. Ownership inference has received less attention, while it is an important problem because it could ease the annotation effort and facilitate application of ownership type systems in real-world software systems. This paper presents novel static analyses for Java that infers ownership according to two known ownership protocols: the owner-as-dominator protocol, and the owner-as-modifier protocol. Our analyses do not require annotations. They are based on the cubic Andersen-style points-to analysis, and therefore, remains relatively inexpensive. We perform experiments on a set of Java programs. The experiments show that the analyses are practical and relatively precise. In addition, the experiments show that ownership occurs frequently in real-world applications, and that the owner-as-dominator protocol and the owner-asmodifier protocol capture distinct ownership properties. 1
ReIm & ReImInfer: Checking and Inference of Reference Immutability and Method Purity
"... Reference immutability ensures that a reference is not used to modify the referenced object, and enables the safe sharing of object structures. A pure method does not cause side-effects on the objects that existed in the pre-state of the method execution. Checking and inference of reference immutabi ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
Reference immutability ensures that a reference is not used to modify the referenced object, and enables the safe sharing of object structures. A pure method does not cause side-effects on the objects that existed in the pre-state of the method execution. Checking and inference of reference immutability and method purity enables a variety of program analyses and optimizations. We present ReIm, a type system for reference immutability, and ReImInfer, a corresponding type inference analysis. The type system is concise and context-sensitive. The type inference analysis is precise and scalable, and requires no manual annotations. In addition, we present a novel application of the reference immutability type system: method purity inference. To support our theoretical results, we implemented the type system and the type inference analysis for Java. We include a type checker to verify the correctness of the inference result. Empirical results on Java applications and libraries of up to 348kLOC show that our approach achieves both scalability and precision.

