The Ten Minute Build

Given a development environment any developer should be able to get hold of the source code, click a button or type a simple command and run a build. The build should compile and perform its unit tests within about ten minutes.

This is the Ten Minute Build rule in James Shore’s and Shane Warden’s book The Art of Agile Development and it’s easy to see why this is a good idea because builds that don’t run easily are both frustrating, which lowers moral, and burn project time shoveling your company’s money into some metaphorical furnace.

If you build takes more than about 10 minutes there are a couple of things you should look at. The things to consider are tooling and infrastructure, which in plain English really means: do you have a dedicated build machine and are you using the right tool set? Getting a dedicated build machine shouldn’t be too hard as there is a cost benefit here: a developer’s time verses the cost of a virtual or real box, whilst many of the tools you’ll need are open source: Maven, CruiseControl / Hudson, GIT/Subversion etc.

If you already have a dedicated build machine and are using all the right tools then the next thing to look at are your unit tests. Builds that include lots of “end to end” or integration tests are usually the culprit. End to end tests are useful in that they prove your classes will work together, but your main testing thrust should be your class’s full set of isolated unit tests covering all necessary cases and edge conditions.

This is because end to end test usually involve setting up and tearing down some external service such as a database. Some say, that you don’t really need any end to end tests, but I think that you do as you need to prove that your classes will work together. So how many integration tests should you use? I like to aim for about one or two per scenario, but only if I’ve got a large number (say 10-20) unit tests per class to give me confidence that everything will work.

Some time ago, I mentioned the FIRST Acronym (taken from Bob Martin’s Clean Code) where tests should be FAST, INDEPENDENT, REPEATABLE, SELF-VALIDATING and TIMELY, which is a very good starting point when reviewing unit test performance.

Being pragmatic, there will be those applications that will never build within 10 minutes. In this case consider splitting your program up in to smaller modules as recommended by the Maven builds manual. Ask your self whether or not you’re building database access classes into the same JAR file as your business logic or presentation code and if so, split them up. You could take this one step further, and create a distributed parallel build environment, but be careful here you may unintentionally break Agile’s ‘keep it simple’ rule.  

Reference: The Ten Minute Build from our JCG partner at the Captain Debug blog.

Related Articles :

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

Leave a Reply


5 × = forty five



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
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.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close