3 research outputs found

    Synthesizing Iterators from Abstraction Functions

    Get PDF
    A technique for synthesizing iterators from declarative abstraction functions written in a relational logic specification language is described. The logic includes a transitive closure operator that makes it convenient for expressing reachability queries on linked data structures. Some optimizations, including tuple elimination, iterator flattening, and traversal state reduction, are used to improve performance of the generated iterators. A case study demonstrates that most of the iterators in the widely used JDK Collections classes can be replaced with code synthesized from declarative abstraction functions. These synthesized iterators perform competitively with the hand-written originals. In a user study the synthesized iterators always passed more test cases than the hand-written ones, were almost always as efficient, usually took less programmer effort, and were the qualitative preference of all participants who provided free-form comments

    Test-Driven Learning in High School Computer Science

    Get PDF
    Test-driven development is a style of software development that emphasizes writing tests first and running them frequently with the aid of automated testing tools. This development style is widely used in the software development industry to improve the rate of development while reducing software defects. Some computer science educators are adopting the test-driven development approach to help improve student understanding and performance on programming projects. Several studies have examined the benefits of teaching test-driven programming techniques to undergraduate student programmers, with generally positive results. However, the usage of test-driven learning at the high school level has not been studied to the same extent. This thesis investigates the use of test-driven learning in high school computer science classes and whether test-driven learning provides benefits for high school as well as college students

    Automating abstraction functions

    Get PDF
    Thesis (Ph. D.)--Massachusetts Institute of Technology, Dept. of Electrical Engineering and Computer Science, 2010.Cataloged from PDF version of thesis.Includes bibliographical references (p. 109-119).Data abstraction has been the dominant structuring paradigm for programs for decades. The essence of a data abstraction is the abstraction function, which relates the concrete program representation to its abstract meaning. However, abstraction functions are not generally considered to be a part of the executing program. We propose that making abstraction functions an executable part of the program can enable programmers to write clearer and more concise programs with fewer errors. In particular, we show that the object equality and hashing operations (which programmers are required to write), can often be expressed more clearly and more concisely in terms of the abstract state of the object. Getting these methods right has proven to be difficult for programmers at all skill levels, from novice through expert. In a case study of the standard Java libraries we show that rewriting the code with explicit declarative abstraction functions (and generating equality and hashing methods automatically) removed object-contract compliance faults previously found by Pacheco et al. To make abstraction functions part of the executing program we develop four techniques for the dynamic evaluation of abstraction functions written in a declarative first-order logic with relations and transitive closure. We observe that the abstraction functions programmers write in practice may often be viewed as navigation queries on the heap, and two of our techniques exploit this insight to synthesize executable code from declarative abstraction functions. The performance of our research prototype is within striking distance of hand-written code.by Derek F. Rayside.Ph.D
    corecore