﻿<?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 Fixing test failures using binary search</title><description>zvolkov,
  
It means disable a big parts of the tests, run the test.
  
Enable some tests, run the test
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment15</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment15</guid><pubDate>Mon, 18 May 2009 20:48:38 GMT</pubDate></item><item><title>zvolkov commented on Fixing test failures using binary search</title><description>I thought you said you used binary search? I mean it's pretty obvious but some people may find the title confusing... The logic above is linear: you just remove a test after test. Instead your logic should be "recursively disable half of the tests and see if that helped", right?
  
  
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment14</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment14</guid><pubDate>Mon, 18 May 2009 20:46:04 GMT</pubDate></item><item><title>Ayende Rahien commented on Fixing test failures using binary search</title><description>Actually, it is a horrible idea.
  
The problem is that when you DO have such a problem, you have a really hard time figuring it out.
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment13</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment13</guid><pubDate>Sat, 16 May 2009 12:53:33 GMT</pubDate></item><item><title>Nathan commented on Fixing test failures using binary search</title><description>Sounds like it might be a good feature for test frameworks to not run their tests in a pre-determined  order?
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment12</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment12</guid><pubDate>Sat, 16 May 2009 12:45:35 GMT</pubDate></item><item><title>Jonathon Rossi commented on Fixing test failures using binary search</title><description>I'm not surprised that running your tests in concrete would cause them to fail :)
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment11</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment11</guid><pubDate>Sat, 16 May 2009 05:58:45 GMT</pubDate></item><item><title>Ayende Rahien commented on Fixing test failures using binary search</title><description>Gerardo,
  
Order, that was the problem.
  
That test went last on the queue, for some reason. 
  
And other tests went after it didn't use the same thing.
  
It was only when I created some tests that did use it that it started failing, and that was long after that.
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment10</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment10</guid><pubDate>Sat, 16 May 2009 04:28:53 GMT</pubDate></item><item><title>Ayende Rahien commented on Fixing test failures using binary search</title><description>Joe,
  
Those are integration tests.
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment9</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment9</guid><pubDate>Sat, 16 May 2009 04:16:10 GMT</pubDate></item><item><title>Gerardo Contijoch commented on Fixing test failures using binary search</title><description>I wonder why didn't you spot the problem when you wrote (and ran) the test that didn't release the file. It seems, from your description, that that particular test was written some time ago.
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment8</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment8</guid><pubDate>Sat, 16 May 2009 01:38:14 GMT</pubDate></item><item><title>Kevin Gadd commented on Fixing test failures using binary search</title><description>The last time I had a problem like this, I made a change to the test runner I was using (in this particular case, python's unittest module) to let me binary search my full set of tests. It ended up being worthwhile since this sort of problem can come up often, and having to do the search manually is pretty painful.
  
  
I wouldn't be surprised if it was pretty easy to do the same in NUnit (or whatever runner you happen to be using).
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment7</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment7</guid><pubDate>Sat, 16 May 2009 00:30:13 GMT</pubDate></item><item><title>Joe Gutierrez commented on Fixing test failures using binary search</title><description>@Ayende
  
  
I think you may have missed an abstraction. Have you thought of getting rid of the specific dependency  (an interface) on the file for these tests and application?
  
  
From the follow on comments you stated that the application maintains the file during it's lifetime. Do you not want your tests to reflect their real-world usage?
  
  
Dependencies of resources and primitives in tests, to me have a code-smell of state based testing. 
  
  
I believe that the failing tests were indicating changes to the code are required. Fixing the tests IMHO seems a pretty anemic solution. It may come back and bite you in the ass.
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment6</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment6</guid><pubDate>Fri, 15 May 2009 19:34:15 GMT</pubDate></item><item><title>Greg Young commented on Fixing test failures using binary search</title><description>Ayende, I have some similar tests (not surprisingly on a similar problem, a transaction file to be specific).
  
  
I ended up supporting temp files to avoid this so there would not be dependencies between my tests.
  
  
Cheers,
  
  
Greg
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment5</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment5</guid><pubDate>Fri, 15 May 2009 15:59:47 GMT</pubDate></item><item><title>Ayende Rahien commented on Fixing test failures using binary search</title><description>Billy,
  
Duh!
  
The problem was a bug in the tests
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment4</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment4</guid><pubDate>Fri, 15 May 2009 13:41:21 GMT</pubDate></item><item><title>Ayende Rahien commented on Fixing test failures using binary search</title><description>Bruno,
  
Tests do things that the real app never does.
  
In that example, the problem was that one of the tests wasn't releasing a file. That never happens in the app, because that file it used throughout the lifetime of the app
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment3</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment3</guid><pubDate>Fri, 15 May 2009 13:40:19 GMT</pubDate></item><item><title>Billy Stack commented on Fixing test failures using binary search</title><description>This is a code smell anyway. Any tests that effect the actual outcome of other test results should be looked at and made more isolated!
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment2</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment2</guid><pubDate>Fri, 15 May 2009 12:35:33 GMT</pubDate></item><item><title>Bruno Mart&amp;#237;nez commented on Fixing test failures using binary search</title><description>You could make your code less dependent on global state, replacing a static class with a normal class and a single static variable. Normal code uses the static but tests use the normal class, which is created for each test.
  
  
In my code I usually have conflicting tcp ports. You can let the OS chose the port for a listening socket with Socket.Bind.
  
  
Lastly, I think that if you have hard to pinpoint failures in your tests, you have tested and failed in the debuggeability of your system. It's time to fire up serious debuggers like WinDbg and make changes in your program so as to make determining the problem easier. If it's hard to debug unit tests is surely hard to debug the same program in production, so it pays off to have better debug procedures in place.
</description><link>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment1</link><guid>http://ayende.com/4014/fixing-test-failures-using-binary-search#comment1</guid><pubDate>Fri, 15 May 2009 12:31:39 GMT</pubDate></item></channel></rss>