14 April 2015
I'm fascinated with Test-Driven Development (TDD) in Java and a bit OCD about getting coverage tools to show the coveted 100% report, formally certifying that I'm a badass. This blog will start out showing how to get the hard-to-test bits but will most likely end up covering other aspects of unit testing as well.
I'm a software engineer at MapQuest in Lancaster, PA and of the various applications I've worked on I have managed to get 2 non-trivial projects to 100% coverage using Cobertura running on Jenkins. The first is a RESTful service available to clients pushing data to our servers, and the other is an HTTP service taking key/value pair GET requests and returning HTML, XML, and JSON/P. I incorporate TDD into every project I'm involved with at MapQuest and in my own free time (though not all can get to 100% due to time constraints), but when I find the time on Saturdays or can convince my project manager that getting 100% coverage is tech debt, I refactor until I get it. I'm mostly a backend service developer so I don't get too involved with UI testing but as I learn I'll add posts detailing my experiences.