Category · 80 posts
Art Of Unit Testing
2011
-
A week in Stockholm - Open for consulting or training
I'll be spending the week of September 12-16 in Stockholm, Sweden. While i'm there I will be doing consulting gigs and possibly training. If you're interested in me coming to your company for a day or two and teach Test…
2009
-
Comments on Corey Haines’ String Calculator TDD Kata Implementation
Corey Haines recreated my TDD Kata on his KataCasts blog. ( click here to learn more about TDD katas ) Since Corey is an experienced TDD practitioner I was honored that he’d given it a go, and was eager to see the…
-
Test driven design – Willed vs. Forced Designs
I’m writing this as a typemock employee, but also as someone who has sat on the other side of the line for several good years, and can argue in both ways. The following, I feel, is true no matter where I work. There are…
-
Art of Unit Testing on Hanselminutes
Scott Hanselman took me in for a 30 minute interview about Unit Testing Dos and Don’ts in his podcast, Hanselminutes. It was a pleasure, and I hope to be there once more about other topics. Maybe in TechEd Berlin.. Have…
-
NDC 2009 – Done!
NDC 2009 was a blast! Thanks for all the great conversations :) Here’s what it looked like when you look up at a full room in NDC
-
Questions every team and dev lead should ask themselves
here are the questions that teams and team leads should be asking themselves on a daily\weekly basis. There are more, but these are the basics, to me. It’s part of the summary for the talk “Beautiful teams I am giving…
-
Art Of Unit Testing available at Amazon
My book, The Art Of Unit Testing , is now in stock at Amazon. If you’ve read the book, I’d love it if you put in a review on that page.
-
Using Explicit Arrange,Act,Assert scopes in tests – thoughts?
What are your thoughts on this style of writing? Specifically the “Explicit” way of defining arrange, act and assert scopes. also, given the name of the test, where should the call to “OnApplyTemplate” be (if you’ve…
-
Testing that an event was raised
This question keeps coming up: “How can I test that an event was actually raised from my class under test?” actually, there is an easy way to check if an event was raised. you subscribe to the event in your test, and in…
-
Art Of Unit Testing (The Samurai Book)– Get it now, it’s done.
The time has actually come. After 2.5 years, and two kids, my book is finally done and is available in full form as an EBook. at the end of the month it will be in print form. Now would be the time to get it, when it is…
-
Test Review #3 – Unity
Watch previous videos: Test Review #1 – NerdDinner Test Review #2 – ASP.NET MVC //TestReviewUnity.mp4 In this video I go over the tests for Microsoft Unity Application Block. Overall the quality of the tests in Unity is…
-
Test Review #2 – ASP.NET MVC Unit Tests
See other reviews: Review #1: NerdDinner Here’s the second video review of Unit Tests. This is another one written by Microsoft – ASP.NET MVC ( source ). First, it’s important to state how surprised I was by the high…
-
Test Review #1 - NerdDinner
I’ve decided to start doing some test reviews of tests that I see in the wild. I figured it’s the best way to show people what I mean when I say they do not have readable, maintainable or trustworthy tests. The first…
-
API design values and decision matrix
We’ve come to a nice way of deciding upon features in the Isolator API. This is what happens when your end product is an API for programmers. First, we realized that we must argue about it . For each type of new feature…
-
Art of unit Testing goes to print in April
The book of never ending production is now actually near the end. the projected print date of “Art Of Unit Testing” is now April 30 and I’m happy to see the Amazon page for the book already has one review of the early…
2008
-
Unit Testing in silverlight land with Typemock Isolator
I’ve been asked quite a lot recently whether one can write unit tests and isolate logical code that runs inside a silverlight application. Up until today my initial answer was ‘no’ because silverlight runs under…
-
Isolator Feature Focus: Duck Typing and Isolate.Swap
Typemock Isolator 5.1.1 has been released, and this release brings with it some awesome (seriously) features that are unique fro any other framework I've seen. a good overview of features can be found here . The…
-
Art Of Unit Testing – Book done, Wiki ready
I’m happy to report that my book has finally hit the “last review” stone, which means all chapters are done and the book should be in book stores around jan-feb 2009 . If you’d like to read the E-Book version right…
-
Unit Testing decoupled from TDD as well== Adoption
The discussion on the future of unit testing for the masses has shifted from the standard “if they are too stupid to learn it, we don’t want them” to “TDD without good design will make really bad tests”. and this is a…
-
Unit Testing decoupled from Design == Adoption
In my previous post I started talking in more coherent words about feelings I’ve had lurking in the past year. This post is an expansion of that, after having some great twitter conversations in the past few days with…
-
Goodbye mocks, Farewell stubs
About 4 years ago I was consulting for one of the largest companies in Israel (about 15,000+ employees) and helping them grok TDD and automated unit testing. I had spent there over a year and a half, on and off, and was…
-
Over Specification in Tests
I've gotten the chance to visit and consult various companies and I see this all the time: Over specification in tests, especially when doing mocks and stubs . One main reason for that is that people use their stub as a…
-
A sneak Preview of Typemock Racer : Thread Deadlock Finder
Here's a sneak preview of the upcoming Typemock Racer product, which I'm currently working on. We should be out in private CTP in a couple of weeks I hope. Typemock Racer tries to solve one huge problem for developers…
-
Introducing Depender - Testability Problem Finder
Update : Here's how you can extend Depender with your own dependency rules Depender is a tool that I created to illustrate several concepts both for my book and both for my training classes. I think it should prove…
-
Over-testable systems, and mocks as bad test smells
This is an interesting problem I've been running into at work. Sometimes we would try to write a test against the system or a component and we would literally have too many choices of how to write it or where to…
-
Unit Testing Interview at TechEd
My interview at teched us on advanced unit testing and legacy code can be seen here: http://msdn.microsoft.com/en-us/events/teched/cc676818.aspx or downloaded here We occasionally stop and laugh a bit because "speaker…
-
Fit/Fitnesse Fixture Gallery -Real world help for FIT and Fitnesse users
This great news was just published at the alt.net mailing list. putting it here for future reference. "Fixture Gallery 2.0 (release 2008-06-09) is now available for download from SourceForge. Fixture Gallery is a…
-
Unit testing vs. Integration Testing : The Restaurant Analogy
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…
-
Tough Questions about unit testing - Your comments required
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…
-
"Swapping" instead of "Injecting" calls between classes
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…
-
NullObject.For<T> - As simple as it gets, but no simpler
This NullObject Factory from Paul is very nice, simple and clean in its design. I really like it and I can see many uses for it, in parallel with working with your standard mocking framework or IoC Container…
-
Unit Testing Denial Pattern #1: Pretending the test is no longer valid
Today was both a good day for e and a bad day for me. Good day because I managed to get a full suite of tests that were somehow failing to work again after a refactoring that got out of hand. Bad - because out of all…
-
Pros and Cons and of using an Auto Mocking container in your tests
In regards to my post about injecting mocks and stubs using a container in your tests, Dave asks in the comments: Why would you want to do this in the first place? Here are the things I can think about right now (pros…
-
Testing XML serialization attributes
Not sure how I feel about this particular brand of testing syntax . still, it's good that someone thought this problem through - testing xml serialization attributes. [via the morning brew ]
-
Injecting Typemock Stubs and Mocks using the StructureMap container in a unit test
Someone asked for examples of how you'd inject stubs and mocks when you'd like your object under test to use a container such as StructureMap . here are a couple of simple tests to show this using Typemock Isolator .…
-
What is a good example of unit test over specification?
I'm working on chapter 8 of my upcoming book and I need to come up with a good example of over specification in unit tests, that leads to an unmaintainable test in the long run (fragile test). I have my ideas on how to…
-
Future of Mock Frameworks: AEIS - Abstract Expectations & Isolation Syntax
As I was looking back and forward on the changing syntax of testing and mock frameworks, it occurs to me that there are still things that need to be solved in the mocking space. many things. It's hard to choose a…
-
Typemock Isolator 4.2 Beta released with cool new features (Previously Typemock.NET)
We just released the beta of Typemock Isolator 4.2 beta (Previously just named Typemock.NET). You can get it here . Some of the cool new things: Mocked methods will be highlighted in the debugger if you step into them.…
-
The Case For Typemock
I just wrote an email to someone regarding Typemock . We were discussing why they don't think Typemock holds the values that other mocking frameworks hold when I suddenly realized what I've been wanting to say all along…
-
TDD Anti Patterns
James Carr lists a nice bunch of TDD anti patterns . via Jeremy . Here's one example I run into often: "The Liar An entire unit test that passes all of the test cases it has and appears valid, but upon closer inspection…
-
The evolution of Unit Testing Syntax and Semantics
The semantics of how you write a unit test, the basic syntax, or Domain Specific language of how we write them, has been relatively stale for quite some years now. But under the covers, the syntax revolution seems to be…
-
Refactoring private methods is like...?
I'm still struggling away with my book, and was wondering what you thought about this analogy. I am referring to the problem of testing private\public method, and in that regard I refer to the ease of changeability of…
2007
-
Basic Guidelines for using RowTest and data driven tests
I took a look at the code that was used to create the NUnit RowTest Extension (which is pretty neat) and found this in one of the samples: The highlighted areas in the code show something which I feel is problematic and…
-
[RowTest] for NUnit, File System Interfaces for unit testing
Two small things of note in the unit testing field for me today: 1) There is am implementation of the [RowTest] Attribute available for NUnit, created using the NUnit Addin model (which you probably didn't know…
-
Data Layer Testing: Test Inheritance Patterns
I'm preparing for my tutorial on Database and Data Layer unit testing that I will be giving at the Agile Practices Conference next week. It's always nice to have a full 3 hours to get pretty deep into something. 75…
-
Style Macros for technical authors working in Word
One of the things you do as an author of a book working in MS Word, is do a lot of formatting on the text that you write. When working with the manning word templates, for example, you are expected to use a list of…
-
Mocking LINQ Queries, Extension methods and Anonymous Types
One of the things I wanted to show at my Interactive session on unit testing tips and tricks at TechEd this year was how you can "Stub" out results from LINQ Queries, or mock\stub Extension methods in .NET 3.5 ( what's…
-
The various meanings of TDD
Update : more on this here and here , and Jim has a whole article on this here . Now that I'm having some real time to write something I thought I'd try to write down my thoughts starting all the way back from JAOO and…
-
Code-Reuse in unit tests is more important than you think
Scott Bellware mentions how he really likes the new ideas in XUnit.NET , especially the lack of [Setup] and [TearDown] methods. (Brad Wilson wrote in the comments to my post about XUnit.NET that you can mimic this…
-
XUnit.NET aims to be the Next NUnit, but it's too soon
Update 1 : Brad answers some of my concerns on his blog. Too bad you can't write comments on his posts... Another update : There's a syntax comparison matrix between NUnit, XUnit and MbUnit. James Newkirk , one of the…
-
The Art Of Unit Testing - Help me choose a book cover
Here's a question for those of you who are interested in my upcoming book . You can influence my decision on choosing the book cover design. The book will be available for purchase as part of the Manning Early Access…
-
TDD Pattern: Composite Logic Development and Testing
Here's a video I made that captures my current thoughts on writing complex business rules which have lots of validation logic. Here's the scenario I show in the video: A Validate method on an object actually uses lots…
-
Mocks and Stubs - The difference is in the flow of information
In class today when explaining the difference between stubs and mocks, I realized a simple explanation to this: Stubs and mocks may seem the same but the flow of information from each is very different. Stubs provide…
-
Throw-Away Tests Vs. Tests that Last
TATs - That's what I call the tests people write when they are writing unit tests for the first time on a real project. Those tests usually don't last more that a few months before they either get deleted or ignored…
-
ClassTester - Test automatically all the stuff you don't bother testing with hand written tests
A dude named Josh sent me an email about a Class Tester he's developed, available here . The idea is to take care of all the things I usually avoid writing unit tests for because it takes too much effort for too little…
-
Implementing Unit Test MetaData using XtUnit custom attributes
Regarding my last post on xml comments used inside a unit test Here's how you can implement the same "metadata on a test" equivalent using XtUnit custom attributes (note that you need to inhering from a custom class for…
-
Unit Test Tip: Encode test data as part of your test xml comments
What a cool idea, and simple too. You can encode various test data as XML comments on your test, and then use them in your test by parsing the XML file generated by the compiler. More details here . Lars Thurop wrote…
-
Multi Threaded Unit Tests with Osherove.ThreadTester
The title says "unit tests" but they are really integration tests, since we rely on the cpu and the context switching mechanisms of the OS to do the work for us, but still ,this tries to solve a scenario many people…
-
Art Of Unit Testing Book Available Shortly
Parts of it, at least. My upcoming book, The Art Of Unit Testing , has just gone in to the first review cycle, on the 1\3 complete mark (five chapters complete so far, we want to review and get feedback).I'm excited!…
-
Tips for Testable code and for testing legacy code
I was consulting for a project today, and I was helping the team figure out how to test a method inside their business logic. Here's the thing - it was one of the least testable method's I've seen. It took me about 4 -5…
-
List of Unit Testing Frameworks
Update : The site seems to be alive and kicking. Great list there. Check it out! There used to be a great list of unit test frameworks at http://www.xprogramming.com/software.htm . The site seems to be dead now. I…
-
Chapter 5 - Mock Object Frameworks - Done
Last night I finally Finished chapter five in my upcoming book about unit testing . Chapter five was all about Mock Object frameworks and was the longest and hardest to write so far. Some of the reasons it was hard to…
-
Automating web tests with FitNesse and Selenium
Here's a nice article details to little known tools in the "mainstream" developer community: Selenium, a browser and web automation framework, and Fitnesse, an acceptance and integration automation solution that uses a…
-
Poll: What Mock Frameworks do you use?
I've been looking for a good way to add simple polls to my blog for a while now, and then I came across this blog post which reviews 12 free online poll sites (some of them actually dedicated to bloggers). I chose…
-
Choosing a Mock Object Framework
Update : I've added a simple Poll at the bottom of this post which you can answer on your most used frameworks. ----------------------- My upcoming book is going forward ever so slowly, mostly due to my beautiful new…
-
Writing A book Is Like Developing Software
I'm in the process of writing my upcoming book: The Art Of Unit Testing , and it's proving to be a big challenge. Bigger than I imagined. ( Here's the first sample chapter - PDF ) Book == Software Development. The…
-
Test Reviews Vs. Code Reviews - Some Helpful Tips
One of the things that I like to show people during my TDD courses, is how much easier it is to do a test review rather than a simple code review. A code review is like literally debugging the code with your eyes,…
-
Testable Designs - Round 2: Tooling, Design Smells and Bad Analogies
Eli Lopian , the guy who runs TypeMock.NET (An amazing Mocking product, BTW - a bit too powerful for it's own good, perhaps) and myself share what seem to be conflicting views on how "Testable" object Oriented…
-
Why you should think about TOOP- Testable Object Oriented Programming
Update: Mark has a point - Using "TOOP" and "TOOD" are catchier acronyms - I've changed them accordingly. I think it's time that Object Oriented Design\Programming got a little face lift. We live in interesting times,…
-
Introducing FxCopUnit - A framework for integrated FxCop rule testing
This post is a continuation of my Quest to test FxCop rules. The previous one was about writing pure unit tests for FxCop rules . This one is about writing Integration tests with a new framework I’ve developed called…
-
Writing real unit tests for your custom FxCop rules
Update : You might also be interested in FxCopUnit for FxCop Integration testing. It’s possible to create elegant small tests which require little to no configuration whatsoever that test out your custom rule’s ability…
2006
-
Agile Development Sessions - Slides and Demos from TechEd
Update : here's a video that yosi made of my draft song before the preconference... Que sera sera... Yesterday was a full day of pre-conference goodness. I've had a blast doing 4 sessions dealing with Agile Development…
-
MassDataHandler: generate test data to help with data layer testing
Yet another tool to help with integration tests against the database layer(got this by email: "I wanted to let you know about an open source tool I created to help unit test the data access layer.…
-
DataFresh - Database rollback library for unit tests
A while ago I wrote an article about database unit testing , and the various ways you could "rollback" the database state to the way it was before the test ran. Today I got an interesting comment from Mike Brockey : "I…
-
The Art Of Unit Testing - Download Chapter 1
I'm happy to announce that draft of chapter 1 from my upcoming book " The Art of Unit Testing " is available for download immediately - click here for the PDF . the book will also be available to download from Manning's…
-
Avoid multiple asserts in a single unit test: revisited
James Avery argues that what he'd really like to see in a unit test framework is the ability to run (and fail) multiple asserts within the same test. As some background, I personally am in favor of the " single assert…
-
Using TypeMock vs. Design for testability
Eli Lopian, the Israeli guy who is now running TypeMock - one of the most powerful Mocking frameworks out there for.NET developers, opened a blog . I personally know the guy and he is a brilliant coder and architect -…
-
MbUnit vs. NUnit Vs. Team System Unit Testing - Choosing a unit test framework
Update : There's a new Unit test framework called XUnit.NET. More info here. MbUnit is gaining some momentum as one of the nicest unit testing frameworks for .NET out there. I just came out as an RC2 release with many…
-
Unit Testing Pros And Cons
" Unit Testing is teh suck " - this post, and some of the comments to it, represent just about every conceivable FUD (fear, Uncertainty, Doubt) about Unit Testing and Test Driven development I've heard, so I'd urge you…
-
The Art Of Unit Testing - Starting out My First Book
I'm happy to announce my new Book Project : "The Art Of Unit Testing". The book will use examples in .NET, but it should be general enough so that any java or C++ developer should be able to read it and learn things.…