With Spock, application testing is only logical

Developers have lots of excuses for not testing their apps, but at the end of the day their resistance is counterproductive

Software builders often have a lot of excuses for not doing application testing, says consultant Howard M. Lewis Ship, creator of the Apache Tapestry Web development framework. But he is not buying any of them.

During a presentation Tuesday at the Emerging Technologies for the Enterprise conference in Philadelphia, Ship listed reasons developers do not test their code:

  • It is hard to get started.
  • Code is too monolithic.
  • More code is more code.
  • Test code is hard to maintain.
  • The tests broke and nobody fixed them.
  • Developers believe their code is already perfect.

Ship stressed the importance of testing just the same, despite any burdens it might entail. For testing Java and Groovy apps, Ship advocates a framework that shares a name with perhaps the most beloved science-fiction character of all time: Spock, of "Star Trek" TV and movie fame.

"What if we had a system where we had test code that was actually readable? What if we had a system where the test code was concise, so you cut through all the clutter," Ship asked. "What if failures themselves were really well-described so you could figure out exactly what's wrong?"

This is where Spock comes in. Created four years ago, the open source Spock framework serves as a Groovy domain-specific language for testing and rests atop of the JUnit 4 Java testing framework. "Its goals are to keep your tests concise and maintainable," Ship said.

Ship is not a developer of Spock but is nonetheless a champion of the framework. He also acknowledges alternatives, such as the Cucumber framework.

Whether developers use Spock or another testing framework, they need to test their code. Reducing errors in code and getting software to work correctly before it is deployed and causes big problems is only logical. With software testing, developers' builds are more likely to live long and prosper -- and ultimately saving developers time and effort.

This story, "With Spock, application testing is only logical," was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Join the discussion
Be the first to comment on this article. Our Commenting Policies