﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Don’t mock my integration tests</title><description>It is the anti pattern name.
  
N is the number of posts per blog, to each we have to issue a select
  
1 is the first select, to bring the list of blogs
  
  
n+1
  
  
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment9</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment9</guid><pubDate>Thu, 14 May 2009 13:35:41 GMT</pubDate></item><item><title>Peter Morris commented on Don’t mock my integration tests</title><description>What I don't understand here is not really related to your post :-)
  
  
Why do you call this N+1?
  
  
If "O" is the number of selects then for each Blog ("O") you will have "N" selects not N+1.  So shouldn't this be SelectN and not SelectNPlusOne, or am I missing something?
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment8</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment8</guid><pubDate>Thu, 14 May 2009 13:32:39 GMT</pubDate></item><item><title>Vagif Abilov commented on Don’t mock my integration tests</title><description>Oren, I think your statement "we can assert on the actual end model of the system, without really trying to deal with what is actually going on" exposes just part of the picture ("assert" part). But there is an "arrange" part that unfortunately often requires dealing with system internals. Setting up necessary data. Properly written unit tests usually don't need to go deep into data layers and if necessary fake/mock away anything that is not relevant to validate given functionality. On the other hand, properly written integration tests should be careful about not faking dependencies, and this is what makes them harder to write and set up.
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment7</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment7</guid><pubDate>Wed, 13 May 2009 15:39:58 GMT</pubDate></item><item><title>Dave commented on Don’t mock my integration tests</title><description>Like the pirates of the Caribbean I don't see TDD as a rule, but more like a guideline ;-)  I do write my unittests before writing the code, but I do *not* follow the make one change rule. The unittests are written based on specifications. If the specifications say 1 + 1 = 3 than I must thread that as correct (even when I disagree).
  
  
Testing specifications is a hard subject to cover. As the architect I write most of the unittests. However several lead developers also contribute some unit tests to complement the specifications (like trowing exceptions and testing condidtions not part of the specification). 
  
  
Integration tests are easier to write because you only have to setup the classes, most of the time you invoke some sort of method on a facade and evaluate the result. Why writing integration tests take so long. Most of the time it takes to write a integration test is not consumed by the test itself. I think 70-80% is spent to make sure that there is a consistent (persistent) data storage. 
  
  
Integration tests are shallow tests, unit tests are in-depth tests. They both serve a different but equally important purpose. 
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment6</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment6</guid><pubDate>Wed, 13 May 2009 07:04:51 GMT</pubDate></item><item><title>Andrea Dallera commented on Don’t mock my integration tests</title><description>This looks to me like a low level spec. In an integration test I do care about what's been called and not what the results look like. In my scenario mocks are a necessary evil... they hurt readability real bad, i agree with that.
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment5</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment5</guid><pubDate>Wed, 13 May 2009 06:16:04 GMT</pubDate></item><item><title>Ayende Rahien commented on Don’t mock my integration tests</title><description>Not really. What I took objection to is the "There is however another solution instead" part, because that is not a solution to the problem at hand
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment4</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment4</guid><pubDate>Wed, 13 May 2009 06:14:30 GMT</pubDate></item><item><title>Eli Lopian commented on Don’t mock my integration tests</title><description>Great, Now we can discuss the real issue that was posted.
  
  
Do our frameworks make unit testing easier? Not compared to integration tests, but compare to writing unit tests without the tools.
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment3</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment3</guid><pubDate>Wed, 13 May 2009 05:57:15 GMT</pubDate></item><item><title>Ayende Rahien commented on Don’t mock my integration tests</title><description>The comparison being made doesn't really hold, that is the problem. Saying that using TypeMock will make unit testing easier is false, because it is not that that makes unit tests harder than integrations
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment2</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment2</guid><pubDate>Wed, 13 May 2009 05:52:02 GMT</pubDate></item><item><title>Eli Lopian commented on Don’t mock my integration tests</title><description>I don't get your logic Oren.
  
Dror is talking about /Unit Tests/ and making them *easier* to write and you are giving an example of /Integration tests/ (are you comparing apples and oranges).
  
  
No one should mock integration tests, but you must agree that we should strive to make authoring unit tests easier.
</description><link>http://ayende.com/4008/don-t-mock-my-integration-tests#comment1</link><guid>http://ayende.com/4008/don-t-mock-my-integration-tests#comment1</guid><pubDate>Wed, 13 May 2009 05:49:44 GMT</pubDate></item></channel></rss>