Testing: mock object

Source: Internet
Author: User
-Mock object
Http://www.ibm.com/developerworks/library/j-mocktest.html
Mock object generate Tool

Initially, the mock object was manually written by the tester. In this way, it will inevitably lead to the disadvantages of low efficiency in writing test cases and difficulties in writing test cases, and may even affect the passion of XP practitioners for "test first. At this time, a variety of tools have emerged to help create mock objects.

Among these tools, there are mockobjects, XDoclet, and other help tools.ProgramYou can also compile mock object implementation tools, such as easymock and mockcreator, to automatically create mock object instances/classes. This article only describes the latter.

Among these tools that can automatically create mock object instances/classes, there are two types: one is similar to easymock, they can dynamically create mock object instances; the other is like mockcreator, they can generate static mock objects.Code. The most famous and currently maintained tools include mockobjects, easymock, and mockcreator. Below, we will use these tools to write unit test code for the following classes, and compare their usage similarities and differences one by one:
Http://tech.ccidnet.com/art/3737/20051017/472031_1.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.