{"id":10959,"date":"2019-11-02T10:30:11","date_gmt":"2019-11-02T05:00:11","guid":{"rendered":"http:\/\/innoroo.com\/blog\/?p=10959"},"modified":"2019-11-07T13:13:58","modified_gmt":"2019-11-07T07:43:58","slug":"mock-objects-glossary-2","status":"publish","type":"post","link":"https:\/\/innoroo.com\/blog\/2019\/11\/02\/mock-objects-glossary-2\/","title":{"rendered":"Mock Objects | Glossary"},"content":{"rendered":"\n<p><strong>Definition:<\/strong><\/p>\n\n\n\n<p>A technique commonly used in automated unit test for dummy implementation of a software component. The mock objects are simulated to behave like a real object in a controlled manner as part of the testing initiative.&nbsp;<br><\/p>\n\n\n\n<p><strong>Benefits:<\/strong><\/p>\n\n\n\n<p>It is very useful when the real object is difficult to incorporate into a unit test such as;<br><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The complex real objects supply non-deterministic results<\/li><li>It is in a state difficult to reproduce<\/li><li>It is slow and may change behaviour<\/li><\/ul>\n\n\n\n<p>Mock objects can do decoupling of software components for testing purposes.<br><\/p>\n\n\n\n<p><strong>Origin:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Freeman, Mckinnon and Craig described it as a testing technique in their article \u2018Endo-Testing: Unit Testing with Mock Objects\u2019 in 2000<\/li><li>Freeman and Pryce\u2019s provided comprehensive description of mock objects integration to TDD and OO design in \u2018Growing Object-Oriented Software Guided by Tests\u2019 in 2010<\/li><\/ul>\n\n\n\n<p><strong>Further Reading:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u2018A brief History of Mock Objects\u2019 by Tim Mackinnon<\/li><li>\u2018Using Mock Objects for Complex Unit Tests\u2019 by IBM DeveloperWorks<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mock Objects | Glossary<\/p>\n","protected":false},"author":2,"featured_media":10960,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[102],"tags":[],"class_list":["post-10959","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-glossary"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/innoroo.com\/blog\/wp-content\/uploads\/2019\/11\/2.Mock-Objects.png?fit=750%2C410&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Rui8-2QL","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/posts\/10959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/comments?post=10959"}],"version-history":[{"count":1,"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/posts\/10959\/revisions"}],"predecessor-version":[{"id":10961,"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/posts\/10959\/revisions\/10961"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/media\/10960"}],"wp:attachment":[{"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/media?parent=10959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/categories?post=10959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/innoroo.com\/blog\/wp-json\/wp\/v2\/tags?post=10959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}