May 2008 - Posts
Here's an analogy I came up with to explain the difference between unit tests and integration tests.
Imagine going to a restaurant with a bunch of your friends. there are some couples there as well as singles. At the end of the meal, it is time to pay. Unit testing is like giving a separate bill to each couple or single. Each person knows only what they needs to pay as well as tip, but do not care what anyone else had, or what the total meal amount is. as long as they pay what they need, they can go home peacefully.
Integration testing is like giving one big check to the group, with everyone having to calculate on their own how much they need to pay. sometimes everyone things they are good, but in the end the total amount may be too high or too low. There is a lot of interaction going on to decide who pays for what and who has already paid.
I installed Firefox 3 beta and the addon I missed the most was Tab Mix Plus (along with IETab, but that works on the beta). Here's how I was able to have Tab Mix Plus working on Firefox 3:
1) Try downloading the latest dev build of the addon from this link.
2) If it won't install for security reasons, you can disable the security check and also disable the comparability check as outlines here.
3) If all else fails, you can install the firefox nightly tester tools addon, which will allow you to force compatibility of all non compatible extensions. if Firefox won't startup and crash , start it up in safe mode (in the start menu you'll have a firefox safe mode shortcut) and disable all addons. then enable only those who don't cause the the crash.
You can tell someone really tried to do the right thing, only to fail by the best intentions:
this is from WixEdit.
Awesome idea. this will only live if the community contributes, and it should. First videos up are all about unit NUnit, for total beginners. Highly recommended.
Oh, this is going to save a whole lot of time when setting up new windows boxes or Virtual machines:
A dvd image with all the security updates - so that you won't have to download them the hard way - through windows update.
this is a weird one (while running our build)

In continuation to my last post about duplicity in the ALT.NET community and around, Eli has a nice post up that basically says
"In other languages where objects can be swapped without Dependency Injection, there is no-one, calling these features - Bad Practice, just the opposite. They are called ‘Power features’, because that is what they are."
That is a great point. Just because ruby is the new Alt.Sweetheart, and you can hear talks about it all over, people don't refer to it as "too powerful" (as is SmallTalk, BTW).
I remember multiple threads in the alt.net mailing lists and from people like Jeremy and Oren (I might be wrong) saying how cool it would be to have mockability and testability as part of the .NET framework, where things could be easily replaced at whim. Wouldn't that be the same argument that it can hinder good design practices? Isn't there duplicity there?
more examples of products (in the alt.net mailing list) being tossed aside for not being "up to par" with the current design principles of people:
- Rocky Lhotka's CSLA Framework. A highly successfull and powerful framework used in many production apps and with "different" design features has been treated like it is the single greatest risk to humanity. no "it could be good if.." no "I agree that it serves a good purpose but..." . only bashing.
- Microsoft Unity is getting flanked as a container for having attributes. I personally found it much easier to start working with than the other leading containers. (People don't even like to TALK about spring BTW). But Castle ActiveRecord, which also uses attributes is regarded as "OK". LINQ to SQL? "Not OK" for having those attributes (and other reasons)
- The "Managed Extensibility framework" from microsoft is getting pooped on with most people openly admitting they haven't even looked at it personally. I can tell you it is innovative and solves a whole bunch of problems. But it is "no" by default - the exact opposite of what the community is about.
disclaimer: I work at Typemock.
There is a big trend I am starting to notice in the "Advanced" unit testing community. That trend feels more and more like hypocrisy. Take Daniel's post about mocking statics without Typemock. (Daniel is the creator of Moq, an open source mocking framework) Granted, it is important to know that you can always refactor things for testability, but just looks at what he writes:
"So, don't buy a product just because you're lazy and want to avoid creating a few wrapper classes and interfaces"
followed by
"Always use the simplest thing that could possibly work."
Which is it, community? The idea of being prgamatic is using the right tool for the job. if that tools makes your job easier than not using it "cause you're lazy otherwise" is plain old hypocrisy.
The same argument also holds for tools like FinalBuilder vs. Nant\MsBuild\Other XML Hell. Tools don't create problems if you use them correctly. The community (especially the ALT.NET community) is going in a too extreme direction. so extreme that their advice are sometimes skewed too much to be considered pragmatic, sometimes falling into "dogmatic".
As part of My Book I have a chapter on the challenges of integrating unit testing practices into an organization. One of the sections deals with "Tough questions and answers". In short, what are the tough questions you will have to deal with when introducing unit testing.
here are the questions I've come across but I'd love to see if there are some that I am missing. Also, I am looking for great answers and references as responses to these questions. Your comments are appreciated:
- 1 How much time will this add to the current process?
- 2 Will my QA job be at risk because of this?
- 3 How do we know this is actually working?
- 4 How much time will this add to the current process?
- 5 Is there proof that unit testing helps?
- any other tough questions?
- Got good answers?
Comments:
I'm using a beta test of Disqus.com's comments INSIDE this post so please try to respond there:
blog comments powered by
Eli Lopian, Typemock CEO and awesome Coder, just created a nice little API wrapper around Typemock Isolator that would allow a very simple and readable "Swapping" effect between classes. It would allow you to write code like this:
[Test]
public void SwapStatic_CallsFake()
{
Swap.StaticCalls<TypeA, TypeB>();
Assert.AreEqual(2, TypeA.StaticReturnOne());
Swap.Rollback();
}
[TestMethod]
public void SwapInstance_CallsFake()
{
Swap.NextNew<OriginalClass, FakeClass>();
OriginalClass swappedInstance = new OriginalClass();
Assert.AreEqual(2, swappedInstance.ReturnOne());
}
The first test uses the "Swap" class to replace static calls and redirect them to your own class with static methods. The second one is more advanced and will mock all instance calls made on the next instance that will be created of that type. so the last line on the second test will actually call a method against the FakeClass type.
pretty cool and very readable. download the code and binaries from his post.
More Posts
Next page »