Refactoring into Testability
“This code is simply too hard to unit test.” That is a common refrain
when dealing with software that hasn't been expressly written to be
testable. In this section we look at “untestable code”
and explore various ways to make it more testable. What you'll come to
realize is that “untestable code” is really another way of saying
“poorly architected code.” We'll demonstrate simple, common-sense
strategies that solve both problems.
We will take a look at some poorly written code and refactor it into something testable.
About Scott Davis
Scott Davis is the founder of ThirstyHead.com, a training company that specializes in Groovy and Grails training.
Scott published one of the first public websites implemented in Grails in 2006 and has been actively working with the technology ever since. Author of the book Groovy Recipes: Greasing the Wheels of Java and two ongoing IBM developerWorks article series (Mastering Grails and in 2009, Practically Groovy), Scott writes extensively about how Groovy and Grails are the future of Java development.
More About Scott »