1,721,018 research outputs found

    A Quick Tutorial on JET

    Get PDF
    JET is an automated unit testing tool for Java classes annotated with JML specifications; JML is a formal interface specification language for Java to document the behavior of Java classes and interfaces. JET tests each method of the class under test separately. For each method, it generates a collection of test data, executes them, and decides test results (i.e., pass/fail) by using JML specifications as test oracles, thereby fully automating unit testing of Java classes. This document gives a quick tutorial introduction to JET

    Are Java Programming Best Practices Also Best Practices for Android?

    Get PDF
    Android apps are written in Java. Android beginners assume that Java programming best practices are equally applicable to Android programming. In this paper, we perform a small case study to show that the assumption can be wrong. We port a well-written Java application to Android. A certain key assumption of object-oriented programming doesn\u27t hold on the Android platform. Thus, some of the best practices in writing Java programs are not best practices for Android. In fact, they are anti-patterns that Android programmers should avoid. We show concrete examples of these anti-patterns or watch-outs along with their fixes

    Toward Unification of Explicit and Implicit Invocation-Style Programming

    Get PDF
    Subprograms like procedures and methods can be invoked explicitly or implicitly; in implicit invocation, an event implicitly causes the invocation of subprograms that are registered an interest in the event. Mixing these two styles is common in programming and often unavoidable in developing such software as GUI applications and event-based control systems. However, it isn\u27t also uncommon for the mixed use to complicate programming logic and thus produce unclean code, code that is hard to read and understand. We show, through a small but realistic example, that the problem is not much on mixing two different styles itself but more on using them in an unconstrained manner. We propose a few principles or guidelines for unifying the two styles harmoniously and also describe a simple, proof-of-concept framework for converting one style to the other for the unification. Our work enables one to blend the two different invocation styles harmoniously and in a properly constrained fashion to produce clean code

    Functional Specification and Verification of Object-Oriented Programs

    Get PDF
    One weakness of Hoare-style verification techniques based on first-order predicate logic is that reasoning is backward from postconditions to preconditions. A natural, forward reasoning is possible by viewing a program as a mathematical function that maps one program state to another. This functional program verification technique requires a minimal mathematical background as it uses equational reasoning based on sets and functions. Thus, it can be easily taught and used in practice. In this paper, we formalize a functional program specification and verification technique and extend it for object-oriented programs. Our approach allows one to formally specify and verify the behavior of an object-oriented program in a way that is natural and closer to the way one reasons about it informally

    Writing Self-testing Java Classes with SelfTest

    Get PDF
    This document provides a tutorial introduction to Java annotations called SelfTest. The SelfTest annotations allow one to annotate Java classes with test data, and the SelfTest annotation processor generates executable JUnit test classes from annotated Java classes by translating test cases to executable JUnit tests. The SelfTest annotations not only automate unit testing of Java classes significantly but also provides a step toward writing self-testing Java classes by embedding test data in source code for both compile and runtime processing

    Extending Java for Android Programming

    Get PDF
    Android is one of the most popular platforms for developing mobile applications. However, its framework relies on programming conventions and styles to implement framework-specific concepts like activities and intents, causing problems such as reliability, readability, understandability, and maintainability. We propose to extend Java to support Android framework concepts explicitly as built-in language features. Our extension called Android Java will allow Android programmers to express these concepts in a more reliable, natural, and succinct way

    Automated Random Testing to Detect Specification-Code Inconsistencies

    Get PDF
    An interface specification language such as JML provides a means to document precisely the behavior of program modules such as Java classes, and it is being adopted by industry. However, few practical tools exist for programmers to assure the correctness of their interface specifications. Nonetheless, the correctness of an interface specification is a prerequisite for the use of the specification, both as a precise API documentation and as a foundation for formal verification of and reasoning about the implementation. We propose automated random testing as a practical tool to assure the correctness of interface specifications. The key idea of our approach is to fully automate dynamic, random testing to detect as many inconsistencies as possible between the specification and its implementation. For this, we use a runtime assertion checker as a test oracle, and the goal of our testing is to generate as many non-duplicate test cases as possible that incur a certain type of runtime assertion violations. Our approach has been implemented for Java/JML in a prototype tool called JET, and a preliminary experiment shows that it has potential to be a valuable testing tool for Java/JML. Our approach can be adapted for other interface specification languages

    Coding Overhead of Mobile Apps

    Get PDF
    A mobile app runs on small devices such as smartphones and tablets. Perhaps, because of this, there is a common misconception that writing a mobile app is simpler than a desktop application. In this paper, we show that this is indeed a misconception, and it\u27s the other way around. We perform a small experiment to measure the source code sizes of a desktop application and an equivalent mobile app written in the same language. We found that the mobile version is 19% bigger than the desktop version in terms of the source lines of code, and the mobile code is a lot more involved and complicated with code tangling and scattering. This coding overhead of the mobile version is mostly due to the additional requirements and constraints specific to mobile platforms, such as diversity and mobility

    Going Beyond Counting First Authors in Author Co-citation Analysis

    Get PDF
    The present study examines one of the fundamental aspects of author co-citation analysis (ACA) - the way co-citation counts are defined. Co-citation counting provides the data on which all subsequent statistical analyses and mappings are based, and we compare ACA results based on two different types of co-citation counting - the traditional type that only counts the first one among a cited work's authors on the one hand and a non-traditional type that takes into account the first 5 authors of a cited work on the other hand. Results indicate that the picture produced through this non-traditional author co-citation counting contains more coherent author groups and is therefore considerably clearer. However, this picture represents fewer specialties in the research field being studied than that produced through the traditional first-author co-citation counting when the same number of top-ranked authors is selected and analyzed. Reasons for these effects are discussed
    corecore