Static analysis is a method that one can use in order to analyze, understand, and assess the quality of a program. The main strength of static analysis is the pinpointing of coding errors without the execution of a program. In this blog post, we discuss how static analysis can contribute to the evaluation of the existing exceptions of a program and how static analysis can help in the prediction of possibly thrown exceptions by a program.
The execution of a program can suddenly terminate for several reasons. To prevent unexpected program behaviors, developers can include error handling mechanisms in their programs. Specifically, in Java, developers can use two types of exceptions: checked and unchecked. Checked exceptions (IOException, DataFormatException, ParseException, SQLExceptions, etc.) are always caught on compile time, whereas unchecked exceptions (OutOfMemoryError, ArithmeticException, NullPointerException, IllegalArgumentException, IllegalStateException, etc.) can occur on runtime and lead a program to an unexpected termination (crash)—if there is no prevention mechanism in the source code to caught the exception. However, there is a debate regarding the use of the unchecked exceptions in the source code (see Unchecked Exceptions — The Controversy, in the Java documentation).
In my previous post, I briefly mentioned that if the execution order of iterations in a loop can be altered without affecting the result, it is possible to parallelize the loop. In this post, we will take a look at why this is the case, i.e., how is execution order related to parallelism. Moreover, we will see how this idea can be further exploited to optimize code for data locality, i.e., how can reordering of loop iterations result in using the same data (temporally or spatially) as much as possible, in order to efficiently utilize the memory hierarchy. Continue reading
Mobile devices have become an indispensable part of our everyday lives, mastering our on-line transactions and influencing our communication with others. However, most smartphone users experience application crashes once in a while. A crash manifests when, for example, you are using your favorite application and it suddenly stops working properly or closes. Sometimes, this can be really troublesome, especially when you try to send an important message or proceed with a financial transaction. There are many reasons that can lead mobile applications to crashes—and the causes are not always tractable. This blog entry discusses the causes of application crashes in mobile devices, based on the examination of a corpus of crash reports from Android applications .
“As soon as an Analytical Engine exists, it will necessarily guide the future course of the science. Whenever any result is sought by its aid, the question will then arise — by what course of calculation can these results be arrived at by the machine in the shortest time?”
Charles Babbage (1864)
Points to Ponder
Would it not be wonderful, if we could write all our simulations as serial programs, and parallelized code (highly optimized for any given supercomputer) would be generated automatically by the compiler? Why is this not the case today? How come supercomputing centers require teams of highly trained developers to write simulations?
Scientists around the world develop mathematical models and write simulations to understand systems in nature. In many cases, simulation performance becomes an issue either as datasets (problem size) get larger, and/or when higher accuracy is required. In order to resolve the performance issues, parallel processing resources can be utilized. Since a large number of these simulations are developed using high level tools such as Matlab, Mathematica, Octave, etc., the obvious choice for the scientist is to use the parallel processing functions provided within the tool. A case in point is the
parfor function in Matlab, which executes iterations of a for-loop in parallel. However, when an automation tool fails to parallelize a for-loop, it can be hard to understand why parallelization failed, and how one might change the code to help the tool with parallelization. Continue reading