Wednesday, August 1, 2007

Unit testing advice

Good stuff from the guys over at the Google Testing Blog.

I had never really given much thought to naming the methods in a unit test class. But if you give it a little though, the method names by themselves can read like a list of low-level functional requirements.

Why write test methods like
  • testClient() or
  • testURI() or
  • testRun()
when you can name the methods
  • testTryToInvokeServiceBehindFirewallDirect() or
  • testCompiledInputCommandIsConvertedAndDispatched() or
  • testWriteDataToFile()?

2 comments:

rosen said...

A software testing engineer is entrusted with the task of ratifying the software for eliminating design errors and other flaws associated with the development process.STC Technologies

Jeff Black said...

Good old Uncle Bob talking about related topic of TDD. http://ht.ly/pchcF