Stop Writing Code You Can’t Yet Test

This content is syndicated from LeadingAgile by Dennis Stevens. To view the original post in full, click here.

Most of the organizations we engage with have more work to do than they can possibly get done. So, developers are writing code as fast as they can to get done trying to maximize their capacity. Typically, we see developers running way ahead of testing. Often, testing is still working on the prior release while development is running off on the next release – and testing just can’t ever catch up. This inventory of untested code shows up as long lists of defects, lots of code branches, untestable features, and products that can’t be integrated or regression tested until just before the next release. This vicious cycle of long bug lists, painful regression testing, and production defects colliding with the next release continues to grow.

The goal is not to write code faster. The goal is to produce valuable, working, testing, remediated code faster. The most expensive thing developers can do is write code that doesn’t produce something needed by anyone (product, learning, etc). The second most expensive thing developers can do is write code that can’t be tested right away. Recently, LeadingAgile’s Derek Huether wrote about Getting Teams to Deliver Predictably ( He shows how having more work in the queue than can be performed slows down throughput. Pretty quickly, everything gets congested and things back up, building up latency and uncertainty in flow.

So, we understand that it is not a good economic investment for developers to write code that can’t be tested. It isn’t getting done faster – and it’s increasing the cost of all the work in process. Even people that understand this push back, however. We hear developers have to be busy – that not writing code is not a good economic option.

There are at least six things that developers can work on that are better economic investments than writing untested code.

  1. Get ready for upcoming work – In complex products, not being able to make and keep commitments creates delays that are very costly. Rather, than writing code that can’t be tested in the sprint developers should be figuring what they need to understand for the next (or future) sprint(s). They are going to have to figure it out at some point, anyway. Figuring it out ahead of the sprint improves the ability to make commitments, so it is a better choice than figuring it out in the sprint.
  2. Help finish work in progress – Developers can (and should) pair with testers to find and fix bugs, or pair with developers to finish other work that the team committed in the sprint.
  3. Expand capability and future capacity – There are often scarce skills or knowledge sets that only a few people on a team can do. Rather than writing code that can’t be tested, developers can pair with someone to develop team capability and capacity. Even if the new person isn’t as productive as the old person at this scarce skill or knowledge set it is still, a better economic investment than writing code that can’t be tested.
  4. Increase testing capacity – Leveraging their unique skills, developers can dramatically increase testing capacity by improving test automation, establishing test data management tools, working on build automation or cleaning up environments. When testing is the constraint – this is a great investment for the team. It can create permanent capacity increases by raising throughput at the constraint.
  5. Refactoring difficult code – If there are sections of code that are tricky to work on or are frequently the source of unintended errors, developers can work to refactor this untested code. It might make sense to combine this effort with increasing the ability to test the code being refactored. Refactoring is particularly compelling when focused on a section of code related to work the team is getting ready to do.
  6. Practice - Increase the capacity and capability of the team by practicing new skills using code katas. There is a craft to being a productive developer. The body of knowledge is large, including patterns, new features of programming languages, new testing and development techniques, and the API’s or interfaces that developers work with. Finding the time to practice new skills on code that will never go into production is valuable when it results in improved capability of the developers.

We need to focus on improving the economic return of developers. Writing code that isn’t needed is not a good economic investment. Writing code that can’t be tested is not a good economic investment. Not writing any code is actually a better economic investment than writing unneeded code or code that can’t be tested. Remember, the goal is not for developers to write code faster. The goal is for the organization to produce valuable, working, tested, remediated product faster. These two items often collide. Make the best economic decisions – and writing code that can’t be tested is typically not the best economic decision.

The post Stop Writing Code You Can’t Yet Test appeared first on LeadingAgile.

Leave a Reply

Your email address will not be published. Required fields are marked *

17 − 6 =

There are 101 ways to do anything.
To find the best way, sometimes you need expert help

What People Say

“Kelly was engaged as a Program Director on a complex business and technology transformation program for Suncorp Commercial Insurance. Kelly drew on his key capabilities and depth of experience to bring together disparate parties in a harmonised way, ensuring the initiate and concept phases of the program were understood and well formulated. Excellent outcome in a very short time frame. ”


“Kelly was a great colleague to work with - highly competent, trustworthy and generally a nice bloke.”


“I worked with Kelly whilst at Thoughtworks and found him to be a most inspiring individual, his common-sense approach coupled with a deep understanding of Agile and business makes him an invaluable asset to any organisation. I can't recommend Kelly enough.”


“Kelly’s a leading program director with the ability to take charge from day one and keep strong momentum at both a program and project level driving prioritisation, resourcing and budgeting agendas. Kelly operates with an easy-going style and possesses a strong facilitation skill set. From my 5 months experience working with Kelly, I would recommend Kelly to program manage large scale, complex, cross company change programs both from a business and IT perspective.”


“Kelly was a brilliant CTO and a great support to me in the time we worked together. I owe Kelly a great deal in terms of direction and how to get things done under sometimes difficult circumstances. Thanks Kelly.”


“Kelly is an extremely talented and visionary leader. As such he manages to inspire all around him to achieve their best. He is passionate about agile and has a wealth of experience to bring to bear in this area. If you're 'lucky' he might even tell you all about his agile blog. Above all this, Kelly is great fun to work with. He is always relaxed and never gets stressed - and trust me, he had plenty of opportunity here! If you get the chance to work with Kelly, don't pass it up.”


“Kelly is an Agile heavy-weight. He came in to assess my multi-million $ Agile development program which wasn’t delivering the right throughput. He interviewed most of the team and made some key recommendations that, when implemented, showed immediate results. I couldn’t ask for more than that except he’s a really nice guy as well.”


“Kelly and I worked together on a very large project trying to secure a new Insurer client. Kelly had fantastic commercial awareness as well as his technical expertise. Without him I would never had secured this client so I owe a lot to him. He is also a really great guy!”


“Kelly revolutionised the way our digital department operated. A true advocate of agile principles, he quickly improved internal communication within our teams and our internal clients by aligning our business and creating a much enhanced sense of transparency in the decisions the business was making. Kelly also introduced a higher sense of empowerment to the development teams...”


“Kelly came to the department and has really made a huge impact on how the department communicates, collaborates and generally gets things done. We were already developing in an agile way, but Kelly has brought us even more into alignment with agile and scrum best practices, being eager to share information and willing to work with us to change our processes rather than dictate how things must be done. He is highly knowledgable about agile development (as his active blog proves) but his blog won't show what a friendly and knowledgeable guy he is. I highly recommend Kelly to anyone looking for a CTO or a seminar on agile/scrum practices - you won't be disappointed!”


“I worked with Kelly on many projects at IPC and I was always impressed with his approach to all of them, always ensuring the most commercially viable route was taken. He is great at managing relationships and it was always a pleasure working with him.”



To explore how we can help you, please get in touch