Why you MUST run your Unit Tests as part of your Build Process

I was browsing StackOverflow the other day (as many geeks are known to do from time to time) and read an answer which describes writing Unit Tests as being like going to the gym. Now, I’m not sure about the final few sentences about finding another job but I do really like the analogy. It’s hard when you start out but the more you do the easier it gets and the more value it adds.

Now, like going to the gym there are couple of fundamentals which if forgotten can undermine everything. Unit Tests don’t require proper warmups or cool downs but they absolutely, definitely, must be run on the build server for their real value to be exploited.

Let me explain why.

Developers are often hackers by nature, we install different things and experiment. That’s what makes us good at our job, it’s also what makes every developer’s computer slightly different so software which runs on one machine could behave very differently on another.

What’s worse, if your developer is in a rush or having a bad day they may completely ‘forget’ to execute the tests before committing code. Now, instead of vigorously tested and proven code being added to source control you’ve got a risk.

Tools like NCrunch help reduce this but the only absolutely foolproof way to ensure that all your tests are executed and passed before deployment is to get your server to run them. Missing out this vital link means you’re opening your build and deployment process up to human error, something you should be very nervous of doing.

Almost all build servers have the capability of running tests so dig out the manual and make sure that when the tests fail, the build fails!

Restructuring your Sprint to Produce Finished Software

If your company is anything like many of the teams I’ve worked with your Sprints are a planning tool used to break down monolithic projects into smaller pieces to track progress.

In the real world big releases often pressure development teams to adopt more established project management techniques to hit deadlines. A PM will nominate a certain number of weeks for development (hopefully based on estimates your developers have provided) and then subsequent time for testing, bug fixing and UAT. The Development Manager will then allocate time into those Sprints.

But wait a minute? Doesn’t Scrum team us that we should be able to produce full working software at the end of each Sprint? If that’s the case then why are we saving all of our testing and bug fixing until the end!? It feels to me as though we’re running Sprints but ignoring the line of the Scrum book which talks about finishing a Sprint with deliverable software.

In Rolling Rocks Downhill Clarke Ching calls this GETS Software (Good Enough To Ship), it’s a term I like. In his book the team would build feature after feature however at the end of each iteration they ensured the product was GETS. That meant that if something took longer than expected or their budget was cut the team would always be able to fall back on the last version.

In a typical PM managed project I envisage features a development phase, when new bugs are carefully and painstakingly introduced. Then a testing and bug fixing phase, where they are removed.


If however you commit less work to your Sprint, let’s say half the amount then your developer can spend the second week refining their work, working alongside the QA, designing upcoming features, and removing any bugs which are found.

This will obviously reduce your Sprint Velocity, however it will mean that whatever work is completed is completed, reasonably and as Clarke puts it GETS. However without the need for long and laborious bug fixing phases this time can often be reclaimed.


This approach is game changing for a number of reasons. Firstly your quality isn’t compromised, instead of a quality decline and then improvement your software stays at production quality. Second, should your customer, Product Owner, or business priorities change you can update your plans (maybe even delivering early). Surely that’s what we mean by Agile!?

Many thanks to FooPlot for the brilliant site I used to create these graphs and Jing for the screenshotting and labeling software.

DDDNorth 2016

I was very excited when I saw the announcement of DDDNorth earlier this year. I’ve attended the conference several times before and to see it was once again in Leeds really gave me no excuse not to attend!

Despite having a rather late night the previous evening I was one of the first there, in fact I think I accidentally tailgated a speaker inside and sat quietly in the corner until the masses arrived.

For those of you who don’t know the DDD events are free, one day conferences focused at .NET developers. They’re held around the country and have a very high standard of speakers. DDDNorth is our annual event and usually circulates between the Universities of Leeds, Sunderland and Bradford.

The first session I attended was “Machine Learning for Muggles” by Martin Kearn and it was one of the best geeky talks I have ever attended.

Martin demonstrated how to use the Azure Machine Learning API to upload your own data for analysis. He then took a photo of the audience and used facial recognition and text analysis to ask questions like “show me the happiest person”. Before today I’d always assumed machine learning was only for the likes of Google, before the first coffee break I was already wondering whether I could use the APIs in our own products.

The second session I attended was “10 More Things You Need to do to Succeed as a Tech Lead” by Joel Hammond-Turner. I’d attended one of his talks before (entitled 10 Things You Need to do to Succeed as a Tech Lead) and with my recent change in role I felt it was a wise choice session.

I was right. Joel gave us a good list. It contained tips on requirements, instrumentation, and team training. I was particularly impressed by his thoughts on managing and measuring technical debt!

The last session of the morning was “You read The Phoenix Project and you loved it! Now What?” by Matteo Emili. Having recently bought and demolished TPP while on holiday this was the session I was perhaps most excited about. Matteo argued for pragmatism, he told us that in order to sell process changes the value must be determined. He quoted the common phrase “you can’t manage what you can’t measure” and discussed in depth how you should use the Build-Measure-Learn. There were even a few tips and ticks towards the end to help us get our automation deployments going!

It was lunchtime, which meant sandwiches and GROC talks (I have always been curious to know what that stands for).

I arrived in time to see a few interesting mini-talks. The first was on using the C# interactive window in Visual Studio, the second was around ARM templates for Azure, and the final one was entitled “What’s the Point of Microsoft?” and was a tongue in cheek presentation about how the big tech players compete in today’s software and hardware world.

I’d love to continue, I’d love to tell you about the Microsoft BOT API talks I had lined up for the afternoon. Alas it was not to be, it was around this time that the office called to tell me that several hundred members were having issues with their accounts. No rest for the wicked!

I’d like to take the time to thank the DDDNorth team for putting together yet another fantastic event. The speakers this year were superb and if I get the chance I fully intend to catch the sessions I missed elsewhere in the country at a later date. See you next year!

Rolling Rocks Downhill Book Review

I read Clarke Ching‘s book Rolling Rocks Downhill a while ago and I picked it up again recently while on holiday. I’d enjoyed it the first time, going back over the story a second time with a little more leadership experience I was amazed just how many valuable lessons Clarke has managed to cram in there!

The book is a Business Novel and follows Steven, the Development Manager at Wyxcomb Financials who discovers that a competing company has stolen their idea and is determined to beat them to market. Their project on the other hand is behind and likely to slip even further. With their company’s future at stake Steven must develop a new approach to development to save the day.

What follows is a story of a team discovering Agile ideas and practices for themselves.  Not because they have a guru preaching at them, but because they’re trying to solve real business problems. I couldn’t help chuckling at some of the discussions Steven has with his mother, the Product Sponsor, and even the Cafeteria Manager as he learns about Iterative Releases, Product Backlogs, Continuous Testing and the Theory of Constraints.

After all can you really understand the advantages of building a small number of features in an iterative manner if you’ve not heard about the French Fry Revolution!?

An easy read and a great book to really reinforce some of the ideas of scrum you already know with real world examples. Recommended to anyone!

Is Proper Project Management the Waterfall We’re All Afraid Of?

I recently watched a Pluralsight course on Project Management for the Software Engineer. My role has changed recently and I’m finding myself far more involved in planning the team’s big picture. I hoped with a few more ideas and skills under my belt I’d stand more chance of rising to the challenge when things get tough.

Having watched the video (very good by the way, I’d highly recommend it) I came away with an uneasy feeling that this “Project Management” stuff was simply Waterfall under another guise. As developers we’ve been so bombarded over the last few years with the message that Waterfall is antiquated and Agile is the new methodology and that all notion of long term planning and detailed requirement documents must be stamped out.

Needless to say that when I watched the video explaining the importance of a proper project plan and detailed specifications I was rather taken aback.

Surely we’re not preaching a return to the old days of strict deadlines and work planned out months and months in advance?

It is at this point that I have to raise my major frustration with Agile and Scrum in particular. Everything I’ve read and every speaker I’ve listened to advocates a prioritised backlog of work which the team will work through to deliver maximum benefit to the business.  This is great for a startup, or a team developing a solution where they are continuously refining a project to deliver more and more value.

In my experience however the business process is rarely so clear cut. For example, I have a deadline looming, several customers have paid for dozens of new features to be included in our application and the sales team have committed to a UAT delivery date of the end of June. Suddenly I’m not working to a prioritised backlog, I’m working to a project deadline and failure to meet it could have serious repercussions!

So how do we combine these two approaches? How can I maintain the ownership and agile nature of a scrum team while carrying out the long term project plan necessary to ensure a successful delivery? Is it possible or are the two mutually exclusive?

Let’s look for a moment at what the Project Management approach promises us

  • A clear set of deliverables agreed by the client
  • A clear list of delivery dates for stakeholders and other teams in the business
  • Easier control by planning work up front allowing us to track progress and spot issues arising

Is there a way we can keep these benefits without sacrificing the agile nature of scrum?

A Clear Set of Deliverable agreed by the Client

Let’s take this one one first, Agile does not mean wishy-washy requirements, it means breaking down big visions into manageable and deliverable chunks. While a client may envisage a huge monolithic project it is the job of the project team to break this down into small, simple user stories which can be delivered in manageable pieces.

Where an analyst may claim that a multi-document specification contains every use case and scenario they system may encounter I’d be willing to bet significant money that they’re wrong. Furthermore, by the time you deliver this enormous project the business value for it may have waned dramatically (I’ve seen this happen myself). It is undeniably better to break your huge requirements down into components which can be delivered for continuous feedback as you go.

A Clear List of Delivery Dates

Assuming you are working in a scrum team the agile process does not obscure delivery dates, in fact it embraces them. Rather than setting an arbitrary deadline months and months in advance and gearing the resource and financial plans towards it continuous and iterative releases increase the reliability of hitting deadlines, after all – it’s less likely you fall significantly behind over a two week period than a two month one!

Use your sprint end dates as your deadlines, deliver frequently into a sandpit environment so the client can see your progress and begin testing as early as possible. Big deadlines are a lot less stressful when you’re on the nth iteration!

Upfront Planning for Clear Progress Tracking

As a Project Manager you are going to be continuous asked whether a project is on track to meet the business deadlines, I’ve not tried it myself but I’m willing to bet turning around to your client and saying “We don’t have deadlines, we’re agile…” Probably isn’t the best approach.

When we create our backlog we break our features into User Stories, each is estimated and prioritised. At the beginning of each sprint the highest priority items are selected to be worked on. From a project management perspective is that other, “more important” stories may be moved into the sprint in place of your items.

However in a business environment we need to plan releases and deliverables several sprints in advance. as a Project Manager we need to ensure that our work is completed on schedule and not simply pushed back until the 11th hour.

My suggestion here would be create a project plan which covers which sprint each User Story should be completed in, these should be negotiated ahead of time with the Product Owner. At the beginning of the sprint the work which was planned in is moved up to a high priority. On a quiet week the team may have capacity to complete your planned work as well as some of the other tasks, on a busy week your work may not be the most pressing (there may be customer support requests which take precedence for example). However, as with all things it is the Product Owner’s prerogative to decide which tasks will give the most business value yours, or the other challengers.

What this process allows is for you to plan out your control points well ahead of time. If you’re expecting certain tasks to be delivered at the end of sprints 2, 4, 5 and 6 then you can begin monitor these and verify that these targets are being hit. If they’re not then you can explain very clearly why they fell behind whether this was because a task took longer than expected or because a more pressing task came in.

This is the same process we already work in, resources can be reassigned at any time in a normal project. The advantage here is that the Product Owner formally balances the priorities of the business and gives reasons why the project must be allowed to fall behind.

Handling Scope Creep

As developers we’re constantly aware of the pressures of scope creep. A piece of work is designed, estimated and scheduled in. Then, as soon as the client sees it they have another idea and want a further feature to be added. In an agile environment we want to encourage this feedback, ultimately it helps us build software which better suits our customers’ needs.

From a business perspective this feature creep can be deadly. Budgets are drawn up and quotes delivered based on the original feature, if these prove to be inaccurate or underscoped then you are effectively delivering your service for free.

In order to avoid this it’s vital that a formal process for Change Requests is given ahead of time. If a customer feels that this is their one and only chance to refine the product to make it valuable to them then they will push and push everything into the same delivery. If however a formal CR process exists they know they can continue to work with the team and refine as they go. There’s a theme here, the emphasis needs to move away from a single monolithic and towards small, iterative and manageable releases.

In Conclusion

I believe that the two approaches of Project Management and Scrum are not mutually exclusive. In fact I believe both aspects are vital if you want to achieve anything other than a constant aimless meandering of features.

For the two approaches to work well together I feel there are few steps which must be carried out:

  • Break your project into manageable tasks and tentatively assign them to sprints with the agreement of your Product Owner.
  • Measure the progress of your project through it’s lifetime, ensure that if a task is not completed in the given sprint you understand why and stress the urgency to the PO that the ground is made up.
  • Embrace change and allow your customers to refine as the project is developed. Formalise the process and be clear that any change will be re-scoped and budgets will be updated.

I’m going to be attempting this approach in a few weeks for a release to our biggest customer. Hopefully this balanced approach will see us through.

Learning the role of Scrum Master at the deep end

My induction into my informal position of Scrum Master was rather quick, a member of staff was leaving and the team needed someone to help run the meetings. Learning fast and jumping straight in at the deep end is my typical (if not favourite) way of learning so I rolled up my sleeves, read a few books and did my best.

So what have I learned? What dubious advise could I pass onto any developer who finds themself stepping into the same role?

Know your Ceremonies

The Scrum Master’s week is punctuated by meetings such as Daily Standups, Planning Sessions, Sprint Review and Retrospectives. You’ll encounter resistance to these because devs like writing code, they don’t enjoy spending hours each week sat in the meeting room. You’ll need to justify these sessions, if you can’t explain why you want to meet then it’s best not to!

Daily Standup

This is the most common session you’ll be expected to run. It’s also the most famous, many businesses claim to be agile simply because they have a daily standup! Getting it right is key to your team’s success.

First the obvious question, do you actually need to stand up? No! People who have never attended a standup will challenge this methodology, there are advantages for and against standing up for the meeting and you need to understand both sides if you want to discuss the reasons. On the one hand physically standing encourages participants to keep their part short and on topic, I also like to guide speakers around the circle so everyone knows when they will be expected to talk and no one is left stammering. On the other hand standing up can be very difficult for distributed teams, meeting over Skype with headsets reduces lot of background noise but brings with it the inevitable technical problems and opens the unending source of distractions which is a dev’s PC. There’s no right answer, but different teams will prefer one style or another.

Keeping on topic is a huge challenge and one I’m still struggling with. Your standup should consist of three bullet points

  • What did you do yesterday?
  • What are you aiming to do today?
  • Are you blocked in any way and are you on track to burn down?

In my experience there are two main reasons for a scrum wandering off topic, these are Story Telling (going into too much detail about what they did yesterday) and Problem Solving (using everyone’s time to try and become unstuck). Devs love to talk about challenges they overcame and solve other people’s problems. The key is to spot when this occurs and suggest that these conversations can be had later.

The sixteenth minute is an interesting idea, as I mentioned above one of the main reasons for scrums dragging on is people trying to utilise the entire team to solve their impediments. One approach is to formalise an optional follow up chat for the required parties so they can continue to discuss issues without hindering the rest of the team. Keep an eye on how many of these follow up conversations are needed, too many and they rapidly take over the team’s morning.

Sprint Planning

I’ve found the key to Sprint Planning is preparation, this can often be an issue when the meeting is scheduled for first thing on a Monday morning! Before you walk into the planning session you should have:

  • The backlog prioritised
  • Details of the capacity of your team (or team members if you plan individually)
  • Details of how much work has been carried over from the previous sprint

If you don’t have this information to hand you’ll need to acquire it in the meeting, this is all information you should have access to through your planning software. Asking for it in the meeting wastes everyone’s time and leads to boredom and the feeling of wasted time, not how you want to start your sprint!

Armed with this data your planning meeting is simply a matter of dishing out the highest priority tasks to the team members who want to pick them up. Simple!

Sprint Review

The purpose of the Sprint Review is to demonstrate what you’ve built to the stakeholders and other interested parties, this can often be your Product Owner, Support Team or other devs. These people then have the opportunity to provide feedback which can be considered, prioritised and included in the project.

The problem I often find is that there are so many ideas, so many discussion points and so many questions that your one hour slot is barely enough to get through the first demo. So how can we address this?

  • Nominate a single person to make note of the suggestions, by making sure everything is written down no idea is wasted and they can be prioritised and scheduled with your Product Owner
  • Consider recording videos instead of live demos, the live demo is a bane of any presenter. By asking your devs to record videos in advance the demos are foolproof, there are no unexpected technical problems and you know exactly how long each video will last!
  • Save questions and feedback until the end of each presenter. We are geeks, not public speakers, give your developers a chance by letting them get to the end before bombarding them with suggestions on how to improve the task they’ve been slaving over all week!

Sprint Retrospective

A fundamental part of the Agile Manifesto is that teams should look at what went well, what they’re struggling with and adapt their processes to improve. Often this is done in a retrospective meeting.

When I first started doing retrospectives we followed a well known pattern

  • What went well?
  • What didn’t go well?
  • What should we start?
  • What should we stop?

We worked our way around the table and everyone was expected to come up with a suggestion for each list. I found these meetings rather unfulfilling, I often felt they descended into a rant about process, other teams, technology or whatever else was irking the group at the time. While I’ve no doubt that it was good therapy I didn’t feel like the hour achieved much.

Instead I’d suggest planning each meeting with a specific topic

  • How can we ensure that high priority support requests are picked up mid sprint?
  • Should we use Web API or WCF for our new API?
  • How can we get clear acceptance criteria for our upcoming bespoke development?

By stating what you hope to achieve from the retrospective in advance you stand a much higher chance of success! Ask your team for items they want to discuss, email around your proposed meeting topic with plenty of notice and ask your devs to bring their own ideas to the meeting.
Hopefully I’ve given a few helpful suggestions for you to consider. I don’t claim to be an Agile expert and I’m still struggling to follow lots of my own advice but every sprint we learn a little more… Isn’t that the point after all!?