3 research outputs found

    Exception-aware Lifecycle Model Construction for Framework APIs

    Full text link
    The implementation of complex software systems usually depends on low-level frameworks or third-party libraries. During their evolution, the APIs adding and removing behaviors may cause unexpected compatibility problems. So, precisely analyzing and constructing the framework/ library's API lifecycle model is of great importance. Existing works have proposed the API existence-changing model for defect detection, while not considering the influence of semantic changes in APIs. In some cases, developers will not remove or deprecate APIs but modify their semantics by adding, removing, or modifying their exception-thrown code, which may bring potential defects to upper-level code. Therefore, besides the API existence model, it is also necessary for developers to be concerned with the exception-related code evolution in APIs, which requires the construction of exception-aware API lifecycle models for framework/library projects. To achieve automatic exception-aware API lifecycle model construction, this paper adopts a static analysis technique to extract exception summary information in the framework API code and adopts a multi-step matching strategy to obtain the changing process of exceptions. Then, it generates exception-aware API lifecycle models for the given framework/library project. With this approach, the API lifecycle extraction tool, JavaExP, is implemented, which is based on Java bytecode analysis. Compared to the state-of-the-art tool, JavaExP achieves both a higher F1 score (+60%) and efficiency (+7x), whose precision of exception matching and changing results is 98%. Compared to the exception-unaware API lifecycle modeling on 60 versions, JavaExp can identify 18% times more API changes. Among the 75,433 APIs under analysis, 20% of APIs have changed their exception-throwing behavior at least once after API introduction, which may bring many hidden compatibility issues.Comment: in Chinese languag

    On the Evolution of Exception Usage in Java Projects

    No full text
    Programming languages use exceptions to handle abnormal situations during the execution of a program. While programming languages often provide a set of standard exceptions, developers can further create custom exceptions to capture relevant data about project- and domain-specific errors. We hypothesize that, given their usefulness, custom exceptions are used increasingly as software systems mature. To assess this claim, we empirically analyze the evolution of exceptions and exception-handling code within four, popular and long-lived Java systems. We observe that indeed the amount of error-handling code, together with the number of custom exceptions and their usage in catch handlers and throw statements increase as projects evolve. However, we find that the usage of standard exceptions increases more than the usage of custom exceptions in both catch handlers and throw statements. A preliminary manual analysis of throw statements reveals that developers encode the domain information into the standard Java exceptions as custom string error messages instead of relying on custom exception classes
    corecore