Covering Code In Practice – Part 1

This is the first of a series of short videos about adding tests to already exsiting software.

For this videos I picked an interesting Micro ORM project called Debonair, you can find more info about the project in the Github repo.

The project was developed by James Studdart with a clear goal

The goal of debonair is to take things back to basics, providing quick data access, while stopping you (the developer) attempting to make the orm do the heavy lifting that should be done by the database. The likes of Entity Framework and Linq2SQL are great, but are very slow, produce horrible sql and let you do a lot of stuff that you really shouldn’t be doing.

During the video I’ll be adding some assertions to a list of tests that where there but didn’t have the assertions (so they didn’t actually check anything).

Why choosing Debonair

for two reasons:

  • It’s well done: I don’t have to break too many dependencies in order to add tests. I already do this all day at work and it’s not fun.
  • It deals with databases: an objection that I always get when talking about adding test to a project is “but my software saves things to the database, your tests wouldn’t work”. Here I try to demonstrate how you can add tests also to projects that have difficult external dependencies.

Next Time

In the nest video I’ll start adding unit tests to the classes by doing some interesting refactorings in order to help me break some dependencies.

If you want to see more of this subscribe to our rss feed or our newsletter or our youtube channel

Author: Daniele Pozzobon

Daniele is an aspiring software craftsman with more that ten years of experience in the software industry. He is currently a consultant in the .Net space for a big insurance company, and previously have worked as a web dev in the manufacturing industry. He has experience with C#, Java, C++, PHP, Javascript, and lately has added some F# to the sauce.
He constantly annoys his friends by talking about software and is passionate about Agile methodologies, which gives him more opportunities to talk annoy his friends even more.
When there are no friends around to annoy, he blogs on CodeCleaners and in his free he time loves go hiking with his wife and two daughters.