- Research Article
- 10.1016/j.scico.2019.102316
Dependency safety for Java – Implementing and testing failboxes
- Sep 27, 2019
- Science of Computer Programming
- Dan Zhang + 6 more +6
Dependency safety for Java – Implementing and testing failboxes
Exception mechanisms help to ensure that a program satisfies the important robustness criterion of dependency safety: if an operation fails, no code that depends on the operation's successful completion is executed anymore nor will wait for the completion. However, the exception handling mechanisms available in languages like Java do not provide a structured way to achieve dependency safety. The language extension failbox provides dependency safety for Java in a compositional manner. So far, there only exists an implementation of failbox in Scala. It requires the assumption of absence of asynchronous exceptions inside the failbox code. In this paper, we are the first to provide an implementation without the above mentioned assumption, this time in Java. First, we present and discuss a direct reimplementation of failbox in Java that is still restricted. Then, we show that using uncaught exception handlers the earlier assumption can be essentially weakened to only concern code before setting the thread handler. Finally, we provide an implementation using the Java native interface that completely removes the assumption.
Dependency safety for Java – Implementing and testing failboxes
Dependency safety for Java – Implementing and testing failboxes
Do android developers neglect error handling? a maintenance-Centric study on the relationship between android abstractions and uncaught exceptions
Do android developers neglect error handling? a maintenance-Centric study on the relationship between android abstractions and uncaught exceptions
Read moreTaming Exceptions in Android Applications
The popularity of the Android platform can be attributed to their ability to run apps, end-user programs that leverage the many capabilities of mobile devices, potentially in unforeseen ways. Apps are in widespread use and App crashing is the most common cause of complaints about Android mobile phone apps according to recent studies. Android apps are usually written in the Java programming language. Java includes an exception handling mechanism that allows programs to signal the occurrence of errors by throwing exceptions and to handle these exceptions by catching them. All the Android-specific abstractions, such as activities and asynctasks, can throw exceptions when errors occur. When an app catches the exceptions that it or the libraries upon which it depends throw, it can resume its activity or, at least, fail in a graceful way. On the other hand, uncaught exceptions make the app crash. The exception handling mechanism for the Android platform has two liabilities: (1) the "Terminate ALL" approach and (2) a lack of a holistic view on exceptional behavior. This research investigates the relationship between Android abstractions and robustness of apps during evolution and proposes a new exception handling mechanism to tame exceptions in Android applications.
Read moreContrasting exception handling code across languages: An experience report involving 50 open source projects
Exception handling mechanisms have been introduced into programming languages in an effort to help deal with runtime irregularities. These mechanisms aim to improve code reliability by providing constructs for sectioning code into exception scopes (e.g. Java try blocks) and exception handlers (e.g. Java catch blocks). Whilst exception handling mechanisms have been the focus of much research over the past years, empirical studies have only focused on characterising exception handling code of Java and C# programs. There exists little empirical evidence on how exception handling mechanisms are used to develop software with other programming languages. Moreover, to date there exists no empirical study which has examined the structure of exception scopes across software projects. We address these shortcomings by examining the commonalities and differences of both exception scopes and handlers implemented with a wider range of languages. To this end, we analysed 50 software projects, containing code developed in C++, JavaScript, PHP, Java and C#. More than 9 million lines of code and over 20,000 exceptional code blocks were analysed. Our findings revealed significant differences in the frequency, structure and length of exception scopes and exception handlers across languages. This finding suggests that certain exception handling mechanisms are less explored by programmers using certain programming languages. However, regardless of language, exception handlers remained simplistic and in general only ever one handler was associated with each scope. Finally, our analysis confirms the existing belief that developers often pay little attention to developing exception scoping and handling behaviour.
Read moreTrading robustness for maintainability: an empirical study of evolving c# programs
Mainstream programming languages provide built-in exception handling mechanisms to support robust and maintainable implementation of exception handling in software systems. Most of these modern languages, such as C#, Ruby, Python and many others, are often claimed to have more appropriated exception handling mechanisms. They reduce programming constraints on exception handling to favor agile changes in the source code. These languages provide what we call maintenance-driven exception handling mechanisms. It is expected that the adoption of these mechanisms improve software maintainability without hindering software robustness. However, there is still little empirical knowledge about the impact that adopting these mechanisms have on software robustness. This paper addressed this gap by conducting an empirical study aimed at understanding the relationship between changes in C# programs and their robustness. In particular, we evaluated how changes in the normal and exceptional code were related to exception handling faults. We applied a change impact analysis and a control flow analysis in 119 versions of 16 C# programs. The results showed that: (i) most of the problems hindering software robustness in those programs are caused by changes in the normal code, (ii) many potential faults were introduced even when improving exception handling in C# code, and (iii) faults are often facilitated by the maintenance-driven flexibility of the exception handling mechanism. Moreover, we present a series of change scenarios that decrease the program robustness.
Read moreExceptions all Over the Shop: Modular, Customizable, Language-Independent Exception Handling Layer
The introduction of better abstractions is at the forefront of research and practice. Among many approaches, domain-specific languages are subject to an increase in popularity due to the need for easier, faster and more reliable application development that involves programmers and domain experts alike. To smooth the adoption of such a language-driven development process, researchers must create new engineering techniques for the development of programming languages and their ecosystems. Traditionally, programming languages are implemented from scratch and in a monolithic way. Conversely, modular and reusable language development solutions would improve maintainability, reusability and extensibility. Many programming languages share similarities that can be leveraged to reuse the same language feature implementations across several programming languages; recent language workbenches strive to achieve this goal by solving the language composition and language extension problems. Yet, some features are inherently complex and affect the behavior of several language features. Most notably, the exception handling mechanism involves varied aspects, such as the memory layout, variables, their scope, up to the execution of each statement that may cause an exceptional event—e.g., a division by zero. In this paper, we propose an approach to untangle the exception handling mechanism dubbed the exception handling layer: its components are modular and fully independent from one another, as well as from other language features. The exception handling layer is language-independent, customizable with regards to the memory layout and supports unconventional exception handling language features. To avoid any assumptions with regards to the host language, the exception handling layer is a stand-alone framework, decoupled from the exception handling mechanism offered by the back-end. Then, we present a full-fledged, generic Java implementation of the exception handling layer. The applicability of this approach is presented through a language evolution scenario based on a Neverlang implementation of JavaScript and LogLang, that we extend with conventional and unconventional exception handling language features using the exception handling layer, with limited impact on their original implementation.
Read moreA New Mechanism for Exception Handling in Concurrent Control Systems
A New Mechanism for Exception Handling in Concurrent Control Systems
Unveiling and taming liabilities of aspects in the presence of exceptions: A static analysis based approach
Unveiling and taming liabilities of aspects in the presence of exceptions: A static analysis based approach
Exception Flows Made Explicit: An Exploratory Study
Most of the exceptions exert a global design impact as they tend to flow through multiple module interfaces of a software system. Exception handling mechanisms in programming languages were originally proposed to improve the robustness and comprehension of error handling code. These mechanisms are traditionally based on the fundamental assumption that global exception flows should be always implicit. However, it has been empirically found that the implementation of global exception handling in real-life software projects tends to exhibit poor quality. This paper presents an exploratory study to assess the benefits and drawbacks of explicit exception flows (or exception channels), as opposed to implicit exception flows. The experiment design involved 15 participants using three alternative mechanisms for exception handling. Our analysis was driven by key indicators of software usability: (i) implementation time, (ii) number of uncaught exceptions, and (iii) number of incorrect answers by the participants.
Read moreThe development and evaluation of exception handling mechanisms for order fulfillment process based on BPEL4WS
The advance of Internet technology fosters the order fulfillment process in a supply chain across heterogeneous information systems. In order to monitor states between partners in the process, this study develops exception handling mechanisms based on Web service stack. After detecting exceptions, the first step is to make use of the fault and compensation handlers provided by the BPEL4WS (Business Process Execution Language for Web Services) specification to roll back planned or even executed business processes belonging to the same scope to the original state. The second step is to utilize the resource searching mechanisms, including BE4WS (Business Explore for Web Services) and BCME (Business Criteria Matchmaking Engine), to find suitable substitutes to make a replacement or find fitting partners to cooperate with the original one. The third step is to take advantage of the extensibility, flexibility and scalability of BPEL4WS business process to adjust and re-form a new one to handle unexpected situations. This study uses the LCD (Liquid Crystal Display) supply chain as an example to evaluate the proposed exception handling mechanisms. The results show that the proposed methods obtain encouraging performance. The major contribution of this research is the initiative efforts on developing exception handling mechanisms based on Web service technologies to improve the exception handling performance.
Read moreWhole program analysis of Java programs for virtual calls and exception handling
Java Programs suffer performance degradation due to the presence of virtual calls and the lack of an efficient exception handling mechanism. In this dissertation, we show how virtual calls can be statically resolved to one or two target methods. The resolved calls can then be potentially inlined and hence improve the performance of the program. Analyzing the whole program (including the Java runtime library) instead of only user code has a positive effect on the performance of the program. We present two exception handling mechanisms, Direct Path Analysis and Display Catch Exception Handling, that improve the performance of programs as compared to the existing popular techniques, Stack Unwinding and Stack Cutting. The first analysis shows that the number of the stack frames needed to be unwound is lower in our analysis than Stack Unwinding. In the second analysis, we propose the Display Catch Exception Handling mechanism which is better than Stack Cutting in terms of operations required to catch exceptions.
Read moreWhole program analysis of Java programs for virtual calls and exception handling
Java Programs suffer performance degradation due to the presence of virtual calls and the lack of an efficient exception handling mechanism. In this dissertation, we show how virtual calls can be statically resolved to one or two target methods. The resolved calls can then be potentially inlined and hence improve the performance of the program. Analyzing the whole program (including the Java runtime library) instead of only user code has a positive effect on the performance of the program. We present two exception handling mechanisms, Direct Path Analysis and Display Catch Exception Handling, that improve the performance of programs as compared to the existing popular techniques, Stack Unwinding and Stack Cutting. The first analysis shows that the number of the stack frames needed to be unwound is lower in our analysis than Stack Unwinding. In the second analysis, we propose the Display Catch Exception Handling mechanism which is better than Stack Cutting in terms of operations required to catch exceptions.
Read moreReasoning About Multi-Lingual Exception Handling Using RIPLS
Reasoning About Multi-Lingual Exception Handling Using RIPLS
Title index to volumes 44, 45, and 46
Title index to volumes 44, 45, and 46
Exploring Exception Handling Mechanism In Android Development
Building a one hundred percent robust, error-prone Android application is a hard thing to sustain considering all the assumptions of the foreign environment differences that the developers of the mobile applications must consider. However, there are some known mechanisms that help the developers get a closer step toward making precautions and calculating the assumption of different errors and scenarios to achieve the application robustness, such as the exception handling mechanism- ‘EHM’. EHM is a mandatory step in Java development which indeed is the core of the Android application platform. In this research, we analyzed an Android representative sample of 24 applications that consists of 6 major categories, 4 applications for each. The static analysis was done to the under-test sample applications using a Java exception parser automation tool developed specifically for this research. Our study contributes directly to creating the Java exception parser tool to parse the total source code of the application so that it extracts the exception handling code blocks from it, then to automate its static analysis to indicate the types and classes percentages and types of exception handling mechanisms used in the targeted applications. The overall result that we can conclude is that in general, although error handling techniques was reported to be misused before, by being overly generic and simple handlers aimed to log or are left empty in most of the researchers results that we came across while doing this research, now the android developers of our representative sample at least are moving forward to write a more robust application that can be significant in the competitive new technological world and this is proven by the logic handlers exceptions percentage of 49% of the total LOC from all the 24 analyzed applications. As per our knowledge, this is the first research that aims to study how the programmers use the EHM inside android application development.
Read more