Mock objects is an extension to Test-Driven Development that supports good object-oriented design by guiding the discovery of a coherent system of types within a code base. It turns out to be less interesting as a tec...
详细信息
ISBN:
(纸本)1581138334
Mock objects is an extension to Test-Driven Development that supports good object-oriented design by guiding the discovery of a coherent system of types within a code base. It turns out to be less interesting as a technique for isolating tests from third-party libraries than is widely thought. This paper describes the process of using Mock objects with an extended example and reports best and worst practices gained from experience of applying the process. It also introduces jMock, a Java framework that embodies our collective experience.
This paper explores a new point in the design space of formal reasoning systems - part programming language, part logical framework. The system is built on a programming language where the user expresses equality cons...
详细信息
ISBN:
(纸本)1581138334
This paper explores a new point in the design space of formal reasoning systems - part programming language, part logical framework. The system is built on a programming language where the user expresses equality constraints between types and the type checker then enforces these constraints. This simple extension to the type system allows the programmer to describe properties of his programin the types of witness objects which can be thought of as concrete evidence that the programhas the property desired. These techniques and two other rich typing mechanisms, rank-N polymorphism and extensible kinds, create a powerful new programming idiom for writing programs whose types enforce semantic properties. This kind of synthesis between a practical programming language and a logic creates a foundation for the design of languages of the future.
This paper reports our experiences using traits, collections of pure methods designed to promote reuse and understandability in object-oriented programs. Traits had previously been used to refactor the Smalltalk colle...
详细信息
ISBN:
(纸本)1581138334
This paper reports our experiences using traits, collections of pure methods designed to promote reuse and understandability in object-oriented programs. Traits had previously been used to refactor the Smalltalk collection hierarchy, but only by the creators of traits themselves. This experience report represents the first independent test of these language features. Murphy-Hill implemented a substantial multi-class data structure called ropes that makes significant use of traits. We found that traits improved understandability and reduced the number of methods that needed to be written by 46%.
Runtime verification is a special form of runtime testing, employing formal methods and languages. In this work, we utilize next-time free linear-time temporal logic (LTL\X) as formal framework. The discipline serves ...
详细信息
ISBN:
(纸本)1581138334
Runtime verification is a special form of runtime testing, employing formal methods and languages. In this work, we utilize next-time free linear-time temporal logic (LTL\X) as formal framework. The discipline serves the purpose of asserting certain design-time assumptions about object-oriented (OO) entities such as objects, methods, and so forth. In this paper we propose a linear-time logic over join-points [4], and introduce a lightweight runtime verification tool based on this logic, J2SE 5 metadata [3] and an AspectJ-based [2] runtime backend. Implementations have been proposed so far for imperative and functional languages [5]. To our knowledge our approach is the first to allow addressing of entire sets of states, also over subclass boundaries, thus exploiting the OO nature.
This poster presents MonitorMethod which helps Java programmers gain insight in the behavior of their applications. MonitorMethod instruments the Java application and relates hardware performance monitors (HPMs) to th...
详细信息
ISBN:
(纸本)1581138334
This poster presents MonitorMethod which helps Java programmers gain insight in the behavior of their applications. MonitorMethod instruments the Java application and relates hardware performance monitors (HPMs) to the methods in the Java application's source code. We present a detailed case study showing that linking microprocessor-level performance characteristics to the source code is helpful for identifying performance bottlenecks and their causes. In addition, we relate our work to a previously proposed time-based HPM profiling framework.
Examples form an integral part of learning to program. In this paper we argue that the role of examples should go beyond merely illustrating concepts or principles and should "sell" concepts to new programme...
详细信息
ISBN:
(纸本)1581138334
Examples form an integral part of learning to program. In this paper we argue that the role of examples should go beyond merely illustrating concepts or principles and should "sell" concepts to new programmers. We identify four common pitfalls to avoid when designing examples for teaching programming. We show how examples that are too abstract or too complex can be harmful in explaining new concepts to students. We also show how some examples used to illustrate new concepts can undermine previously taught concepts by not applying these concepts consistently. Finally, we show how some examples can do harm by undermining the very concept they are introducing. The aim of this paper is to encourage educators to think critically about examples before using them.
In this demonstration we will show the flow of the Mock object development process by pair-programming to develop a code example. During the session, we will introduce the declarative jMock API and show how we use it ...
详细信息
ISBN:
(纸本)1581138334
In this demonstration we will show the flow of the Mock object development process by pair-programming to develop a code example. During the session, we will introduce the declarative jMock API and show how we use it to describe relationships between objects when developing test-first. We will show how this approach helps developers concentrate on real requirements and how it encourages a design in which objects are focused with well-defined responsibilities. We will also show our practices for maintaining the readability of tests written using jUnit with jMock. This work is described in a Practitioner Report at this conference, "Mock Roles, Not objects".
Inheritance is a useful mechanism for factoring and reusing code. However, it has limitations for building extensible systems. We describe nested inheritance, a mechanism that addresses some of the limitations of ordi...
详细信息
ISBN:
(纸本)1581138318
Inheritance is a useful mechanism for factoring and reusing code. However, it has limitations for building extensible systems. We describe nested inheritance, a mechanism that addresses some of the limitations of ordinary inheritance and other code reuse mechanisms. Using our experience with an extensible compiler framework, we show how nested inheritance can be used to construct highly extensible software frameworks. The essential aspects of nested inheritance are formalized in a simple object-oriented language with an operational semantics and type system. The type system of this language is sound, so no run-time type checking is required to implement it and no run-time type errors can occur. We describe our implementation of nested inheritance as an unobtrusive extension of the Java language, called Jx. Our prototype implementation translates Jx code to ordinary Java code, without duplicating inherited code.
Programmers tend to understand programs by thinking of concrete examples. Example Centric programming seeks to add IDE support for examples throughout the process of programming. Instead of programmers interpreting ex...
详细信息
ISBN:
(纸本)1581138334
Programmers tend to understand programs by thinking of concrete examples. Example Centric programming seeks to add IDE support for examples throughout the process of programming. Instead of programmers interpreting examples in their head, the examples are written down and the IDE interprets them automatically. Advanced UI techniques are used to present the results closely integrated with the code. Traditionally distinct programming tools (the editor, Read-Eval-Print-Loop, debugger, and test runner) are unified into a single tool that might be called an example-enlightened editor. This is expected to benefit a wide spectrum of programming activities, for both novice and experienced programmers. Some novel methods for testing and development are made possible. In the longer term, example centrism has implications for the design of future programminglanguages. A prototype has been implemented for Java in Eclipse.
A simple alternative to Mockobjects is presented. Given the interface of an object required by a class-under-test, a Pseudo-Class is created implementing all methods such that they immediately fail. A test-specific su...
详细信息
ISBN:
(纸本)1581138334
A simple alternative to Mockobjects is presented. Given the interface of an object required by a class-under-test, a Pseudo-Class is created implementing all methods such that they immediately fail. A test-specific sub-class of the Pseudo-Class is created locally in the test (ex. as an anonymous inner-class in Java), over-riding only the methods required by the interaction between the object and the class-under-test for the test-scenario. Typically, the method implementations are extremely simple (a few lines, at most), and the number of methods overridden is small. This mechanism was found adequate for more than 90% of our unit-tests (in a 1000-class system with over 2000 test methods, we finally ended up with about four real Mockobject classes and more than 40 Pseudo-Classes).
暂无评论