About Juri Strumpflohner

Juri Strumpflohner mainly operates in the web sector developing rich applications with HTML5 and JavaScript. Beside having a Java background and developing Android applications he currently works as a software architect in the e-government sector.

Why Automated Tests Boost Your Development Speed

Many critics against writing automated tests directly address the additional time that is needed for coding them, which alternatively could have been invested in writing new functionality. Writing tests definitely needs time, and especially developers that are new to unit testing will need to invest more.

While the methodology (test-first or test-last) plays a major role in the efficiency of the invested time and resulting quality of the tests, in this post I’d like to highlight some of the immediately visible improvements that automated testing strategies introduce with regards to development speed.

Functionality Verification

While developing you continuously roughly verify whether your implemented code works as expected. Considering a web application environment, this means to start the app in the browser and to check whether everything works. This is connected to a lot of effort, you need to open the browser, click through the UI to arrive to the point where your implemented functionality will take effect and then verify the according output. If it doesn’t yet work, the cycle needs to be repeated. This takes time!
Instead, using a test-driven approach you would

  • write a small test, instantiating your object, invoking – say – the method on it you wrote and asserting the according result.
  • check whether the bar/dot whatever your xUnit framework is, is green or red
  • if it’s red, change your implementation, re-run the written test etc…
Note how much time you save here: no opening (and waiting for) the browser, no clicking on dummy buttons.

Whenever you are tempted to type something in a print statement or a debugger expression, write it as a test.
Martin Fowler

Regression Testing

What many don’t immediately see is the huge amount of time you save with each new test in terms of building a regression test suite. With each new test you write, this test suite gets bigger and bigger, and more of your app’s functionality gets covered.  By then re-running all of the written tests, each time you implement something, you re-verify all of your existing logic, executing hundreds of different scenarios, within seconds. Imagine what this would mean without an automated test approach? I doubt you’re that fast clicking through the UI ;).

Less Bugs?
This really depends on the quality of your tests and on the overall test coverage. There are a lot of papers analyzing this kind of relationship. From my experience I can say that it has definitely a positive effect. What I’ve seen is that the kind of bugs change. You’ll experience less source code defects (i.e. missing null reference checks). What usually remains are small bugs that are quickly fixed and those that arose due to a misunderstanding between the customer and developer.

The Downside…
As with every thing, there are also downsides. Usually a rule of thumb is the “less code you write, the less you have to maintain”. Tests help you in the maintenance phase of your product, while fixing bugs or extending with new functionalities in that they provide you with a safety net that ensures you didn’t break anything existing. But on the other side, writing tests means writing additional code that needs to be maintained as well!
Therefore, writing good, maintainable tests needs to be learned and that learning curve shouldn’t be underestimated.

So, give unit-testing a try and don’t give up immediately. The initial learning phase will be quite tough, but once you got it, you cannot live without ‘em any more ;).

Reference: Why Automated Tests Boost Your Development Speed from our JCG partner Juri Strumpflohner.

Related Articles:

Related Whitepaper:

Software Architecture

This guide will introduce you to the world of Software Architecture!

This 162 page guide will cover topics within the field of software architecture including: software architecture as a solution balancing the concerns of different stakeholders, quality assurance, methods to describe and evaluate architectures, the influence of architecture on reuse, and the life cycle of a system and its architecture. This guide concludes with a comparison between the professions of software architect and software engineer.

Get it Now!  

Leave a Reply


six × 6 =



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.

Sign up for our Newsletter

15,153 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books