Agile Legacy Code

Primary Menu

Covering Code In Practice – Part 2

This is the second video of me adding tests to a real working project. You can take a look my last video here.

First things first, in the previous video I added asserts to a set of test that where already built but didn’t had the asserts. Turns out that the branch I was working on wasn’t synced with the forked repository so I rebased after this recording.

Unit Tests

In this video I add a second test project because I want this project to be focused only on unit tests. I use NUnit framework because that’s a great tool and that’s what I am accustomed to and then I proceed covering the class SqlBuilder.

While building the characterization tests I encounter some cases that are probably wrong so I added some failing asserts and will ask the main maintainer to check the behavior of the method.

Without further ado, here’s the video:

Next Time

This has been pretty easy so far… Next time I’ll find some parts of the code that requires some special techniques to isolate the dependencies.

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.