mock object

A mock object is a simulated object that mimics the behavior of a real object in controlled ways. Mock objects are often employed in unit testing to scrutinize the performance of actual objects. In this context, an object is a smallest testable part of an application... (Continued)

A mock object is a simulated object that mimics the behavior of a real object in controlled ways. Mock objects are often employed in unit testing to scrutinize the performance of actual objects. In this context, an object is the smallest testable part of an application. A mock object makes use of the same interface as the element of code it is intended to imitate.

A mock object can be useful in place of a real object that:

  • Runs slowly or inefficiently in practical situations
  • Occurs rarely and is difficult to produce artificially
  • Produces non-deterministic results
  • Does not yet exist in a practical sense
  • Is intended mainly or exclusively for conducting tests.
This was first published in March 2007

Continue Reading About mock object

Glossary

'mock object' is part of the:

View All Definitions

Dig deeper on Software Testing and QA Fundamentals

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

File Extensions and File Formats

Powered by:

SearchSOA

TheServerSide

SearchCloudApplications

SearchAWS

SearchBusinessAnalytics

SearchFinancialApplications

SearchHealthIT

Close