Figure 1: Percent null-safe code over time (approx.). Over the course of two years, we developed Nullsafe, a static analyzer for detecting NPE errors in Java, integrated it into the core developer workflow, and ran a large-scale code transformation to make many million lines of Java code Nullsafe-compliant. In 2019, we started a project called 0NPE with the goal of addressing this challenge within our apps and significantly improving null-safety of Java code through static analysis. These techniques are essential but have their own limitations in terms of time-to-signal and coverage. Since Java doesn’t provide tools to express and check nullness invariants, developers have to rely on testing and dynamic analysis to improve reliability of their code. On Android, NullPointerException (NPE) errors are the largest cause of app crashes on Google Play. Null dereferencing is a common type of programming error in Java. This shows the value of static analysis in solving real-world problems at scale.
0 Comments
Leave a Reply. |