Monday, September 19, 2005

What's a Unit Test?

A Set of Unit Testing Rules "A test is not a unit test if:
* It talks to the database
* It communicates across the network
* It touches the file system
* It can't run at the same time as any of your other unit tests
* You have to do special things to your environment (such as editing config files) to run it."

"If you write code in a way which separates your logic from OS and vendor services, you not only get faster unit tests, you get a ‘binary chop’ that allows you to discover whether the problem is in your logic or in the things are you interfacing with."

1 comment:

Tom Adams said...

A thanks, I'd been looking for this when I wrote my SPARQL rant but couldn't remember where I found it.