testing

Python data-driven testing, ddt and @unpack

less than 1 minute read

Several eons ago, I wrote a blog post about using the python ddt package. My only criticism was that you had to manually pack/unpack the test case arguments.

The fundamentals of unit testing (series)

less than 1 minute read

I’ve not written about testing for a while, but I still enjoy writing automated tests (I am boring) and trying to coach people on good testing practices (I a...

Data-Driven Testing with Python

4 minute read

Hello tests. It’s been a while since I blogged about automated testing, so it’s nice to welcome an old friend back to the fold. I’ve missed you. I’ve recentl...

Multiple Mocks?

2 minute read

This post was in response to a post on the fragmental.tw blog (the comments aren’t working for me, so I thought I’d post it here) which I read via Roy Oshero...

Unit? Integration? Functional? Wha?

4 minute read

I answered a question titled, “What’s the difference between unit, functional, acceptance and integration tests?” on Stackoverflow and thought it’d be useful...

Data-driven testing tricks

3 minute read

It’s a fairly common occurrence - somebody wants to use NUnit’s data driven testing, but they want to vary either the action under test, or the expectation. ...

More readable data-driven tests

2 minute read

When the logic of a test method remains constant but the data varies, data-driven testing is a great tool. It allows you, the test author, to write compact c...

AutoMapper and Test Data Builders

2 minute read

I’ve recently been tinkering with WCF and, as many people already know, writing data transfer objects is a pain in the balls. Nobody likes writing repetitive...

Debug.Assert vs. Exceptions

1 minute read

“When should I use Debug.Assert and when should I use exceptions?” - It’s a fairly sensible question to ask, but you’ve got to sift through a lot of articles...

Avoiding the file system

5 minute read

Going from experience and, as illustrated by Misko’s recent presentation, the more dependencies you have on your environment, the less trustworthy and mainta...

Is your test code readable?

2 minute read

One of the things that really slashes the return on investment in testing is unreadable code. “This is pretty obvious”, you say. “What’s the point in a blog ...

Understanding test doubles

4 minute read

There is a bewildering array of types of ‘mock’ object available to a tester. The canonical list of test doubles was probably coined by the venerable Martin ...

What’s in a name?

5 minute read

One of the things I try to encourage is the careful selection of names. Just as self-documenting code is easier to read, so is a self-documenting test. As I ...

Benefits of designing for testability

7 minute read

When I started my job as a Software Test Engineer, I had very little knowledge about unit testing. I had a good degree award and a load of acronyms to put on...

The big block method (binary search)

4 minute read

Have you ever been in this situation? You have thousands of tests in scores of assemblies. All of the tests pass. However, when you run the test suite a seco...

The pride of a programmer

6 minute read

I was thinking about this the other day, and something struck me (and no, it wasn’t a disgruntled developer). Automated testing is a valuable and widely acce...

Testing gotchas - c# Weak References

3 minute read

If you ever have to test a class that uses a WeakReference, or even just have to use Weak References, be very careful. Numerous strange-looking things can oc...

Why write test code?

2 minute read

It’s not uncommon to encounter developers that are wholly resistant to unit/functional/integration testing. Some of them will simply dismiss the idea due to ...