<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Software testing mocking tutorials and videos</title>
	<atom:link href="https://www.softwaretestingmagazine.com/tag/mocking/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.softwaretestingmagazine.com</link>
	<description></description>
	<lastBuildDate>Fri, 21 Aug 2026 19:49:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.softwaretestingmagazine.com/wp-content/uploads/favicon.png</url>
	<title>Software testing mocking tutorials and videos</title>
	<link>https://www.softwaretestingmagazine.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Mocking Framworks Considered Harmful?</title>
		<link>https://www.softwaretestingmagazine.com/videos/mocking-framworks-considered-harmful/</link>
		
		<dc:creator><![CDATA[Software Testing Magazine]]></dc:creator>
		<pubDate>Fri, 09 Sep 2022 16:24:15 +0000</pubDate>
				<category><![CDATA[Software Testing Videos]]></category>
		<category><![CDATA[mocking]]></category>
		<category><![CDATA[test automation]]></category>
		<guid isPermaLink="false">https://www.softwaretestingmagazine.com/?p=8572</guid>

					<description><![CDATA[<p>Software development without test automation can no longer be considered professional. However, you might have existing code bases or want to rely on external libraries that may make writing effective and fast unit tests hard or even near to impossible. A typical work-around for these situations is to introduce test stubs for such external dependencies to make your code testable. Some propose to use mocking frameworks together with unit testing frameworks to ease the specification of the replacement objects. These mocking frameworks often come with their own domain-specific language (DSL) to describe the behavior and expected usage of the mock object. In addition to a learning curve, the DSLs often do not help much, when things do not work. The current lack of standardized reflection in addition requires macro trickery making fixing problems even harder. A second issue, is that existing code often must be prepared to suite the mocking frameworks interception mechanism to allow to inject the mock objects. Last but not least test-driven-development (TDD) together with the use of a mocking framework can lead to high coupling, that TDD usually strives to reduce. The latter fact was described in Gerard Meszaros seminal work &#8220;XUnit Test Patterns&#8221; but, as what often happens with the fine print or Pattern’s liabilities, ignored by many. This talk demonstrates &#8220;classical&#8221; mocking frameworks, shows the problems and demonstrates how Cevelop’s Mockator approach can help refactoring existing code to get it under test and how a very simple plain C++ solution can be used instead <a class="mh-excerpt-more" href="https://www.softwaretestingmagazine.com/videos/mocking-framworks-considered-harmful/" title="Mocking Framworks Considered Harmful?">[...]</a></p>
The post <a href="https://www.softwaretestingmagazine.com/videos/mocking-framworks-considered-harmful/">Mocking Framworks Considered Harmful?</a> first appeared on <a href="https://www.softwaretestingmagazine.com">Software Testing Magazine</a>.]]></description>
		
		
		
			</item>
		<item>
		<title>Unit Testing: Fakes, Mocks and Stubs</title>
		<link>https://www.softwaretestingmagazine.com/knowledge/unit-testing-fakes-mocks-and-stubs/</link>
		
		<dc:creator><![CDATA[Software Testing Magazine]]></dc:creator>
		<pubDate>Tue, 23 May 2017 08:12:08 +0000</pubDate>
				<category><![CDATA[Knowledge]]></category>
		<category><![CDATA[Software Testing Articles & Tutorials]]></category>
		<category><![CDATA[mocking]]></category>
		<category><![CDATA[unit testing]]></category>
		<guid isPermaLink="false">http://www.softwaretestingmagazine.com/?p=5571</guid>

					<description><![CDATA[<p>When you perform unit testing, there are many situations where you don&#8217;t have the full code or the right context that is needed to execute it. It might be that part of the code is not written yet or that you interact with an external system that is difficult to access or you don&#8217;t want to impact with unit tests. In these cases, you need to create a test double, an object that behaves like its production equivalent. In this article, Michał Lipski describes three types of test doubles &#8211; fake, stub and mock &#8211; and gives you examples when to use them in your unit testing. Author: Michał Lipski, Pragmatists, http://pragmatists.pl/ In automated testing it is common to use objects that look and behave like their production equivalents, but are actually simplified. This reduces complexity, allows to verify code independently from the rest of the system and sometimes it is even necessary to execute self validating tests at all. A &#8220;test double&#8221; is a generic term used for these objects. Although test doubles come in many flavors (Gerard Meszaros introduced five types in this article), people tend to use term &#8220;mock&#8221; to refer to different kinds of test doubles. Misunderstanding and mixing test doubles implementation may influence test design and increase the fragility of tests, standing on our way to seamless refactoring. This article describes three implementation variations of testing doubles: fake, stub and mock and give you examples when to use them. Fake Fakes are objects that have <a class="mh-excerpt-more" href="https://www.softwaretestingmagazine.com/knowledge/unit-testing-fakes-mocks-and-stubs/" title="Unit Testing: Fakes, Mocks and Stubs">[...]</a></p>
The post <a href="https://www.softwaretestingmagazine.com/knowledge/unit-testing-fakes-mocks-and-stubs/">Unit Testing: Fakes, Mocks and Stubs</a> first appeared on <a href="https://www.softwaretestingmagazine.com">Software Testing Magazine</a>.]]></description>
		
		
		
			</item>
		<item>
		<title>Testing with Mockito</title>
		<link>https://www.softwaretestingmagazine.com/videos/testing-with-mockito/</link>
		
		<dc:creator><![CDATA[Software Testing Magazine]]></dc:creator>
		<pubDate>Tue, 20 Dec 2016 08:45:12 +0000</pubDate>
				<category><![CDATA[Software Testing Videos]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mocking]]></category>
		<category><![CDATA[test automation]]></category>
		<category><![CDATA[unit testing]]></category>
		<guid isPermaLink="false">http://www.softwaretestingmagazine.com/?p=5080</guid>

					<description><![CDATA[<p>Mockito is a popular and powerful open source Java mocking framework. In order to achieve good unit tests, you need to make use of mocks and stubs. And that&#8217;s exactly what this talk will be about: What is a mock? What&#8217;s the difference between a mock and a stub? Are mocks the only way to provide relevant data for your unit tests? What do I do with all the final classes/methods in the Android SDK? How do I architect my app to make it easier to test? After having adopted TDD as my main development workflow for almost a year now, the presenter feels comfortable saying everything can be tested. Its just a matter of having someone experience show you how. Video producer: http://www.devoxx.com/ Further reading: Mockito &#8211; Open Source Java Mocking Framework</p>
The post <a href="https://www.softwaretestingmagazine.com/videos/testing-with-mockito/">Testing with Mockito</a> first appeared on <a href="https://www.softwaretestingmagazine.com">Software Testing Magazine</a>.]]></description>
		
		
		
			</item>
		<item>
		<title>Software Testing One Mock Too Far</title>
		<link>https://www.softwaretestingmagazine.com/videos/one-mock-too-far/</link>
		
		<dc:creator><![CDATA[Software Testing Magazine]]></dc:creator>
		<pubDate>Mon, 29 Jun 2015 15:23:22 +0000</pubDate>
				<category><![CDATA[Software Testing Videos]]></category>
		<category><![CDATA[mocking]]></category>
		<guid isPermaLink="false">http://www.softwaretestingmagazine.com/?p=3777</guid>

					<description><![CDATA[<p>Tests should save our money and time. How is it that they often become the stumbling block and slow down the work? They fail every time you try to do some refactoring and are difficult to maintain ultimately increasing the cost of software maintenance. If you have such problems it means that you may have gone a &#8220;one mock too far &#8221; &#8211; testing the wrong things, and you are using testing mock in the wrong places. During my talk I will give examples how to test different types of code wisely, so tests will protect your application and will not be a burden for you. https://vimeo.com/120678992 Video producer: https://geecon.org/</p>
The post <a href="https://www.softwaretestingmagazine.com/videos/one-mock-too-far/">Software Testing One Mock Too Far</a> first appeared on <a href="https://www.softwaretestingmagazine.com">Software Testing Magazine</a>.]]></description>
		
		
		
			</item>
		<item>
		<title>Bad Tests, Good Tests</title>
		<link>https://www.softwaretestingmagazine.com/knowledge/bad-tests-good-tests/</link>
		
		<dc:creator><![CDATA[Software Testing Magazine]]></dc:creator>
		<pubDate>Mon, 26 Jan 2015 15:47:52 +0000</pubDate>
				<category><![CDATA[Knowledge]]></category>
		<category><![CDATA[Software Testing Books]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mocking]]></category>
		<category><![CDATA[unit testing]]></category>
		<guid isPermaLink="false">http://www.softwaretestingmagazine.com/?p=3485</guid>

					<description><![CDATA[<p>Tomek Kaczanowski writes that the idea behind its &#8220;Bad Tests, Good Tests&#8221; book is &#8220;to present test code snippets and discuss ways of making them better.&#8221; To achieve this goal, he explores a large amount of code and tests to discuss all the issues that you can meet in your software testing activities. The book discusses how to write unit tests that are strong, maintainable and easy to read. The book mixes parts the concepts needed to achieve these objectives with many examples that contain real Java code of real applications. It is well structured and easy to read with a casual style. Java testing tools (JUnit, Mockito) specific issues are also discussed in the book. I liked the fact that helpful tips and important things to remember were put in evidence. Many code parts discussed in the book can also be found on github: https://github.com/tomekkaczanowski/bad-tests-good-tests-code Although this book has a stronger appeal for Java developers, I will recommend it to every software developer as many of its advices can be applied to other programming languages. As there is a free pdf version available, your risk of reading it is minimal. Reference: Bad Tests, Good Tests, Tomek Kaczanowski, http://practicalunittesting.com/btgt.php Quotes The worrying thing about writing tests is that there are numerous accounts of people introducing tests into their development process and… ending up with even more junk code to support than they had to begin with! Why? I guess, mainly because they lacked the knowledge and understanding needed to write <a class="mh-excerpt-more" href="https://www.softwaretestingmagazine.com/knowledge/bad-tests-good-tests/" title="Bad Tests, Good Tests">[...]</a></p>
The post <a href="https://www.softwaretestingmagazine.com/knowledge/bad-tests-good-tests/">Bad Tests, Good Tests</a> first appeared on <a href="https://www.softwaretestingmagazine.com">Software Testing Magazine</a>.]]></description>
		
		
		
			</item>
		<item>
		<title>Mock Python Mocking and Testing Library</title>
		<link>https://www.softwaretestingmagazine.com/resources/mock-python-mocking-and-testing-library/</link>
		
		<dc:creator><![CDATA[Software Testing Magazine]]></dc:creator>
		<pubDate>Mon, 05 May 2014 16:07:51 +0000</pubDate>
				<category><![CDATA[Software Testing Resources]]></category>
		<category><![CDATA[mocking]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[unit testing]]></category>
		<guid isPermaLink="false">http://www.softwaretestingmagazine.com/?p=2988</guid>

					<description><![CDATA[<p>In unit testing, you use mocks to simulate the behavior of other code parts in controlled ways. mock is a Python library for testing that allows you to replace parts of the system under test with mock objects and make assertions about how they have been used. mock has been integrated the Python standard library since version 3.3 under the name unittest.mock. The mock library provides a core Mock class that removes the need to create stubs. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way. mock also provides a patch() decorator that handles patching module and class level attributes within the scope of a test, along with sentinel for creating unique objects. Mock is based on the ‘action -&#62; assertion’ pattern instead of ‘record -&#62; replay’ used by many mocking frameworks. The documentation of mock is really well written with a user guide that provides multiple examples on how to use this library in your python unit tests. It goes beyond being a simple documentation of the tool and provides valuable material on how to do mocking in python with plenty of code. Read the full mock documentation on https://www.voidspace.uk/python/mock/</p>
The post <a href="https://www.softwaretestingmagazine.com/resources/mock-python-mocking-and-testing-library/">Mock Python Mocking and Testing Library</a> first appeared on <a href="https://www.softwaretestingmagazine.com">Software Testing Magazine</a>.]]></description>
		
		
		
			</item>
		<item>
		<title>Using Mocks and Stubs in PHPUnit</title>
		<link>https://www.softwaretestingmagazine.com/knowledge/using-mocks-and-stubs-in-phpunit/</link>
					<comments>https://www.softwaretestingmagazine.com/knowledge/using-mocks-and-stubs-in-phpunit/#comments</comments>
		
		<dc:creator><![CDATA[Software Testing Magazine]]></dc:creator>
		<pubDate>Mon, 19 Aug 2013 16:57:46 +0000</pubDate>
				<category><![CDATA[Knowledge]]></category>
		<category><![CDATA[Software Testing Articles & Tutorials]]></category>
		<category><![CDATA[mocking]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[unit testing]]></category>
		<guid isPermaLink="false">http://www.softwaretestingmagazine.com/?p=2361</guid>

					<description><![CDATA[<p>In my previous column PHP Unit Testing with PHPUnit,I showed how to set up PHPUnit and how to run a few simple tests. You should be able to test any function or method now that doesn&#8217;t rely on making calls out to other methods or functions – which is of course very few, as most applications are a complex combination of methods and, in PHP&#8217;s case, functions. Author: Kendrick Curtis, Stainless Software, http://www.stainless-software.com/ Writing unit tests for any application relies upon being able to isolate the object under test, which can be difficult in these situations. Here we&#8217;ll take a look at a few strategies for properly isolating the code that you are trying to test in order to prove that it works without having to test your entire system. Depending on what you read, different distinctions are drawn between mock objects, fake objects and stubs. PHPUnit natively provides mock objects with enough functionality to supply both predetermined inputs to the code under test and also to verify whether certain methods were called. Injecting Input With Mock Objects Simply, a mock object is a “fake” version of a code object (usually an object in the OO sense as well). In order to isolate your object under test, it&#8217;s usually necessary to mock out all of the other objects that it interacts with. A mock object has the same interface as the real thing, but responds in a way pre-programmed by your test code. Let&#8217;s look at an example, a simple <a class="mh-excerpt-more" href="https://www.softwaretestingmagazine.com/knowledge/using-mocks-and-stubs-in-phpunit/" title="Using Mocks and Stubs in PHPUnit">[...]</a></p>
The post <a href="https://www.softwaretestingmagazine.com/knowledge/using-mocks-and-stubs-in-phpunit/">Using Mocks and Stubs in PHPUnit</a> first appeared on <a href="https://www.softwaretestingmagazine.com">Software Testing Magazine</a>.]]></description>
		
					<wfw:commentRss>https://www.softwaretestingmagazine.com/knowledge/using-mocks-and-stubs-in-phpunit/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Using Mock Objects in C#</title>
		<link>https://www.softwaretestingmagazine.com/knowledge/using-mock-objects-in-c/</link>
		
		<dc:creator><![CDATA[Software Testing Magazine]]></dc:creator>
		<pubDate>Mon, 03 Jun 2013 20:18:47 +0000</pubDate>
				<category><![CDATA[Knowledge]]></category>
		<category><![CDATA[Software Testing Articles & Tutorials]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[mocking]]></category>
		<category><![CDATA[unit testing]]></category>
		<guid isPermaLink="false">http://www.softwaretestingmagazine.com/?p=2242</guid>

					<description><![CDATA[<p>When you need to perform unit testing in an independent way, you use mock objects. Mock objects are simulated objects that mimic the behavior of real objects in controlled ways. In this excerpt of their book &#8220;Pragmatic Unit Testing in C# with NUnit&#8221;, Andy Hunt, Dave Thomas and Matt Hargett explain how to avoid coupling when you build your C# unit tests. Instead of testing against the real code, you can use a mock object that is kind of close to the real code but easier to work with for your unit testing objectives. The explain that mock objects are useful when: * The real object has nondeterministic behavior * The real object is difficult to set up * The real object has behavior that is hard to trigger * The real object is slow. * The real object does not yet exist They discuss the differences betweens stubs, fakes and mock objects, explaining for each category when and how you should use them. Read the complete article on http://media.pragprog.com/titles/utc2/mocks.pdf Find the book home page on http://pragprog.com/book/utc2/pragmatic-unit-testing-in-c-with-nunit</p>
The post <a href="https://www.softwaretestingmagazine.com/knowledge/using-mock-objects-in-c/">Using Mock Objects in C#</a> first appeared on <a href="https://www.softwaretestingmagazine.com">Software Testing Magazine</a>.]]></description>
		
		
		
			</item>
	</channel>
</rss>
