Caroli on JMock with Test-Driven Development

Discussions

News: Caroli on JMock with Test-Driven Development

  1. Caroli on JMock with Test-Driven Development (6 messages)

    In this article, Paulo Caroli introduces the basics of using JMock, a Mock object framework, in conjunction with Test-Driven Development. To illustrate the technique, he works through a case study, the creation of a cache component by means of test-first development with JMock. Read Using JMock with Test-Driven Development
  2. It looks good in the view of TDD, but will it fit-in to existing web-application frameworks (primarily MVC) with so many complex object hierarchies and relationships?
  3. It looks good in the view of TDD, but will it fit-in to existing web-application frameworks (primarily MVC) with so many complex object hierarchies and relationships?
    It fits in very nicely with Spring MVC as the framework includes ready-to-run mock objects for Request, Response, Session objects etc. jmockrunner takes care of EJB / JMS objects and can be used in conjunction with jMock. See http://www.java-answers.com/index.php?topic=36.0 for an example
  4. It looks good in the view of TDD, but will it fit-in to existing web-application frameworks (primarily MVC) with so many complex object hierarchies and relationships?
    JMock is especially useful in large projects with many component sub-systems and with complex relationships between objects both within and from other sub-systems. This is so because with JMock it is possible to ensure that: 1. your tests adhere to system boundaries 2. are real unit tests in that they test exactly one class (all other interacting classes are replaced with mocks). JMock needn't necessarily be used to DRIVE design (TDD). JMock can, in conjunction with JUnit or TestNG, be used to VERIFY design, interface contracts and module functionality.
  5. But jMock is intended to help you drive your design. I suggest you read our article that Paolo has quoted where we talk about using Mocks to guide the discovery of types in your application.
  6. Mock Objects sample code[ Go to top ]

    This article's sample code and its up-to-date version is available at http://www.mocksamples.org/
  7. Nice aricle[ Go to top ]

    this article gave me a lot of new informations. thanks a lot. http://blog.mnagas.com