skip to main content
10.1145/1028664.1028765acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Mock roles, not objects

Published:23 October 2004Publication History

ABSTRACT

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.

References

  1. Astels, D. Test-Driven Development: A Practical Guide, Prentice-Hall, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Beck, K. and Cunningham, W. A Laboratory For Teaching Object-Oriented Thinking. In SIGPLAN Notices (OOPLSA'89), 24, 10, October 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Fowler, M. et al. Refactoring: Improving the Design of Existing Code, Addison-Wesley, Reading, MA, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Freese, T. EasyMock 2003. Available at: http://www.easymock.orgGoogle ScholarGoogle Scholar
  5. Hudak, P. Building domain-specific embedded languages. ACM Computing Surveys, 28(4es), December 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Hunt, A. and Thomas, D. Tell, Don't Ask, May 1998. Available at: http://www.pragmaticprogrammer.com/ppllc/papers/1998_05.htmlGoogle ScholarGoogle Scholar
  7. Kiczales, G., et al. Aspect-Oriented Programming, In proceedings of the European Conference on Object-Oriented Programming (ECOOP), Finland. Springer-Verlag LNCS 1241. June 1997.Google ScholarGoogle ScholarCross RefCross Ref
  8. JUnit. 2004. Available at http://www.junit.orgGoogle ScholarGoogle Scholar
  9. Mackinnon, T., Freeman, S., Craig, P. Endo-testing: unit testing with mock objects. In Extreme Programming Examined, Addison-Wesley, Boston, MA. 2001. 287--301. Also available from http://www.mockobjects.com Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Marx, K. Critique of the Gotha Program, 1874.Google ScholarGoogle Scholar
  11. Mikhajlov, L. and Sekerinski, E. A Study of the Fragile Base Class Problem. In E. Jul (Ed.), ECOOP'98 - Object-Oriented Programming 12th European Conference, Brussels, Belgium, July 1998, pp 355--382, Lecture Notes in Computer Science 1445, Springer-Verlag,1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Massol, V. and Husted, T. JUnit in Action, Manning, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Moore, I. and Cooke, M. MockMaker, 2004. Available at: http://www.mockmaker.orgGoogle ScholarGoogle Scholar
  14. Lieberherr, K. and Holland, I. Assuring Good Style for Object-Oriented Programs IEEE Software, September 1989, 38-48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Poppendieck, M. Principles of Lean Thinking, In OOPSLA Onward!, November 2002.Google ScholarGoogle Scholar
  16. Sun Microsystems, Java Messaging Service, Available at: http://java.sun.com/products/jmsGoogle ScholarGoogle Scholar
  17. Williams, L. and Kessler, R. Pair Programming Illuminated. Addison-Wesley, Reading, MA, 2002. ISBN 0201745763. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Wirfs-Brock, R. and McKean, A. Object Design: Roles, Responsibilities, and Collaborations, Addison-Wesley, Reading, MA, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Mock roles, not objects

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        OOPSLA '04: Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications
        October 2004
        348 pages
        ISBN:1581138334
        DOI:10.1145/1028664

        Copyright © 2004 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 23 October 2004

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader