SCG News

Nullable Method Detection — Inferring Method Nullability From API Usage

Manuel Leuenberger. Nullable Method Detection — Inferring Method Nullability From API Usage. Masters thesis, University of Bern, February 2017. Details.

Abstract

Null dereferences are the cause of many bugs in Java projects. Avoiding them is hard, as they are not detected by the compiler. Many of those bugs are caused by dereferencing values returned from methods. This finding implies that developers do not anticipate which methods possibly return null and which do not. In this study we detect the nullable methods within Apache APIs by analyzing their usage in API clients. We compute the nullability of each invoked method, i.e., the ratio between null-checked and all dereferenced method return values. To collect many API clients of Apache API, we perform a targeted API client collection. Our tool, COLUMBO, exploits the widespread use of the Maven dependency management to find clients of Apache APIs. COLUMBO is fast and scalable. We collect and analyze 45638 Apache API clients and measure 31.4% of conditional expressions to be null checks. We find 65.0% of dereferenced return values of Apache API methods are never checked for null, 33.5% are sometimes checked and 1.5% are always checked. A manual inspection of the methods rarely checked in client usage shows that about a third of them can never return null, hence checking the return value for null is superfluous and hinders code readability. In the Apache API clients we also analyze their usage of the JRE and we find a similar nullability distribution as in Apache usage. We consider method nullability an important part of a method contract, but we find it to be incompletely documented in the JRE API documentation. Most method documentations do not make a statement about their nullability. To bridge this gap, we integrate the nullability data in an IDE plugin that shows developers the measured nullability for each method, giving them an estimation of the potential null return.

Posted by scg at 13 February 2017, 2:15 pm comment link

Hyperparameter Optimization to Improve the Accuracy of Predicting the Number of Bugs

Haidar Osman, Mohammad Ghafari, and Oscar Nierstrasz. Hyperparameter Optimization to Improve the Accuracy of Predicting the Number of Bugs. Submitted to MaLTeSQuE 2017: International Workshop on Machine Learning Techniques for Software Quality Evaluation. Details.

Posted by scg at 12 January 2017, 11:15 am comment link

Hyperparameter Optimization to Improve the Accuracy of Predicting the Number of Bugs

Haidar Osman, Mohammad Ghafari, and Oscar Nierstrasz. Hyperparameter Optimization to Improve the Accuracy of Predicting the Number of Bugs. Submitted to MaLTeSQuE 2017: International Workshop on Machine Learning Techniques for Software Quality Evaluation. Details.

Posted by scg at 2 January 2017, 12:15 pm comment link

NullSpy — An approach to pinpoint the origin location of a null reference

Lina Tran. NullSpy — An approach to pinpoint the origin location of a null reference. Bachelor’s thesis, University of Bern, December 2016. Details.

Abstract

A previous study found that null pointer exceptions are the most frequently occurring exceptions in Java projects. Also, it is difficult to debug because a developer is only provided with a stack trace to the line of code where the exception was thrown. This only gives insight into the effect of the fault but not into its cause. The aim of the project is to provide the developer with an additional stack trace. It shows the location where the variable that caused the null pointer exception was initially assigned to null. We attempt to achieve this goal by instrumenting Java source code while striving for minimal execution overhead. By tracking the null assignments through static analysis and bytecode instrumentation we can achieve a more efficient debugging process after an occurrence of a null pointer exception.

Posted by scg at 20 December 2016, 3:15 pm comment link

Exploring Cheap Type Inference Heuristics in Dynamically Typed Languages

Nevena Milojković and Oscar Nierstrasz. Exploring Cheap Type Inference Heuristics in Dynamically Typed Languages. In Proceedings of the 2016 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, Onward! 2016, p. 43—56, ACM, New York, NY, USA, 2016. Details.

Abstract

Although dynamically typed languages allow developers to be more productive in writing source code, their lack of information about types of variables is one of the main obstacles during program comprehension. Static type information helps developers to decrease software maintenance time. Inferring the types of variables requires complex algorithms in order to avoid false positives or negatives. Their main aim is to shorten the list of possible types for a variable. We have developed a couple of cheap heuristics that use easily accessible information about the presence of each class in the available source code to promote the correct type towards the top of the list of possible types for a variable. Our evaluation of a proof-of-concept prototype, implemented in Pharo Smalltalk, shows that both for domain- specific types and standard libraries these heuristics tend to work well. The evaluated heuristics prove to be reasonably precise, promoting the correct types of a variable towards the top of the list in 50.67% up to 89.09% of cases on average, depending on the applied heuristic. The heuristic that has proven to be the best was compared with one existing type inference algorithm and the best heuristic yields significantly better results with less effort.

Posted by scg at 1 December 2016, 10:15 am comment link
<< 1 2 3 4 5 6 7 8 9 10 >>
Last changed by scg on 17 August 2016