Skip to main content

Posts

Showing posts from January, 2012

Write Unit Tests? Start deleting them

A recent blog post by Steve Klabnik concluded with a statement about tossing unit tests if you have end to end tests covering the code in question.Don't be afraid to change the tests! As soon as you've verified that you've transcribed the code correctly, don't be afraid to just nuke things and start again. Especially if you have integration level tests that confirm that your features actually work, your unit tests are expendable. If they're not useful, kill them!A few people on Twitter found this odd, and I'd have included myself in this statement a while back.@isaacsanders@avdi seeing @KentBeck delete unit tests during his screencasts changed my TDD process forever.— Shaun Finglas (@F1nglas) January 21, 2012Kent Beck's TDD screencasts changed my view on deleting unit tests however. During the later videos, he actually deleted some tests. Pretty much all TDD resources don't really mention this. One of the key points beginner…

Log Everything

This post was originally conceived back in mid 2011, starting a new project made me think back to this event, hence the post.Any developer worth their salt will know what logging is. You could argue there are two types of logging, either developer logging or auditing. Developer logging would be what we log when something goes wrong. Using the results of this logging we can track down what went wrong, and put fixes in place to stop this event from occurring again. If this logging fails, or logs the incorrect thing it is not the end of the world. Due to this, I generally do not care for testing such scenarios. The code should behave the same with our without this logging.Auditing would come under logging which as part of the application needs to be carried out at all times. Consider visiting a cash machine. When withdrawing fifty pounds, you want to make sure your bank logs this in case anything goes wrong. This sort of logging is crucial, and must wor…