Friday, November 02, 2012

Test Clean-Up

I've recently had a massive clean up of dependencies between our Core solution, tests & everything else that comes to mind.

During this time I noticed a number of tests which fell in to the following categories:

WTF?  Are they testing!
They've been in our test suite & build server for a long time in there current guise.  The first set are similar to:
[Test]
public void BuildMeAPanda()
{
     var panda = new Panda("Chi Chi");
     Assert.That("Chi Chi", panda.Name);
}

As you can see we are simply testing the logic of a constructor.  Not too much value in this.  Although it looks good on our code coverage stats!!!  

[Ignored]
The second are ignored tests which seem to have been written with a future intend - i.e:

[Test, Ignore("Really need to work out how to test this!")]
public void InteractWithDb()
{
    var panda = new Panda();
    var repo = new PandaRepository();
    repo.Save(panda);
    // work out what to do here!
}

Broken & [Ignored]
The third are the they broke the build, I must get the build in, quickly ignore the test ones:
[Test, Ignore("This breaks the build I'll re-instate it later")]
public void Bug52358()
{
    // Arrange 
    ... Lots of code
   // Act
   ... Some more code
   // Assert
   ... Some assertion
}

My view on these tests is to eradicate them.  If they've not been in your build cycle for some time then they are not adding any value.  They are simply adding overhead to your build time, your thoughts and general clunk within your solution.

I would also try to re-instate the Broken but ignored tests, however, if they fail and you can't understand them within a time boxed amount of time delete them...

The only occurrence that I've not done this - is on those integration tests where you use them occasionally - a prime example of this is testing email & sms sends.  However, these should appear in a different project called:
  • .IntegrationTests
They should be clearly labelled with:
  • [Ignore("Integration tests!")]

And over time you probably want to delete these too!?!

Tuesday, February 07, 2012

Why is Agile/Lean so tough?

I watched an excellent video by Ken Schwaber the other day regarding SCRUM.  Like all these things certain stuff just resonated with me…

One of the key points was how tough SCRUM was to implement and the relative poor success rate in implementing SCRUM.  The reason behind this is due to the tough questions that SCRUM highlights, my firm belief is that “Agile methodologies” like SCRUM, Kanban, etc do exactly this on the tin.  Highlight your problems – I recall a quote, “It’s like developing software in a room with all the lights full blast, compared to the dark room you’ve been sat in for last 5 years!”

People often see “Agile methodologies” as silver bullets – follow some simple rules and this will change your software development process for the better.  I mean what else could be simpler?  It will make you able to accept changing requirements late in the build process, build better quality and deliver faster.  The honest truth is that just following these simple rules won’t help your process.  The reason you’re looking for a change is usually because of the three reasons highlighted.  
  • You’ve got to accept that there are going to be some really tough questions that are highlighted.  
  • You’ve got to accept that you have to answer these questions to be successful.  
  • Only you can answer these questions, not anybody else.  
  • If you’re scared of answering tough questions and having tough conversations then do not engage with these “methodologies”.  Or if you do then be prepared to fail.  
  • So who is “you” – it’s everyone from the top to the bottom.
The answers to these questions will inevitably lead to change, and once again this change has to be done in the correct manner.  Embracing change, and ensuring that everyone is happy with the change is extremely hard to do – it needs time and effort from people.  It needs people to address people’s concerns, discuss why the change is better than the status quo.   

There are better articles about managing change at the following locations:

Friday, October 14, 2011

Am I a Code Monkey?

Last night’s XPMan was really good.  We did some TDD but with no code – essentially we created tests and then created a sequence diagram to pass the tests.  We then applied the RGR (Red, Green, and Refactor) to the sequence diagram as we built up the tests; I found it a really good exercise in returning to the basics of TDD.  One key thing for me was that it’s really important to do the simplest thing first and get this to go red before you do anything overly complex.  During the second kata and my second pair of the evening this became quite pertinent.

However, there is one discussion which provoked some thought and quite a heated exchange.  This came in the form of, “I’m a code monkey and I should just fulfil the requirements given to me by the BA’s/customers.”  This provoked quite a debate about if a BA asked you to jump of a build would you do it?  Another comment was about reading the Agile Manifesto.

So here’s my 50p worth.  Yes I am a code monkey, but professionally I need to question what I’m doing.  However, this has to be done in the correct manner – asking what the business value is of a specific requirement/user story is?  Rather than just saying no.  By asking this question – you are just ensuring that the person asking for the work to be done has considered whether it is valuable.  If the answer is yes, then you have to fulfil this obligation to the customer and complete the requirement/user story even if you deem it as spurious.  This is the professional thing to do.  

It’s really important not to blindly accept what people are telling you what to do, but to ask questions and occasionally say no in the right manner – but the manner in saying no has nothing to do with the Agile Manifesto, more the way you say it.

Maybe an unrelated thing – the Agile Manifesto say’s that we value the things on the left more than the right – but remember the things on the right we still value.  Something I sometimes forget about is that we still need a plan, we still need a contract negotiation – it’s just we value the following changing requirements & customer collaboration over the other two.

So yes I am a code monkey, but it’s important to question what you’re doing before committing to it.

Thursday, September 08, 2011

XPMan Introduction to Kanban

Tonight I facilitated an intro to Kanban at XPMan.  This was to run through what Kanban is, and introduce the 5 core properties of Kanban.

The slides for the presentation/discussion points contained the following:

  1. Visualising workflow
  2. Limit WIP
  3. Measure & Manage Flow
  4. Make Process Policies Explicit
  5. Use Models to Evaluate Improvement Opportunities

We didn't cover everything in Kanban, but hopefully people got an idea of what it is and how they can start using it.

I'd like to re-emphasis that you should apply it to your current process - it doesn't replace what you do currently it just overlays it.  Look at the stats that you get out of it, and let them drive your incremental change

Links:
Kanban Dev mailing group
Limited WIP Society, Manchester
Kanban 101
Limited WIP society

Books:
Kanban - written by David Anderson the "creator" of Kanban for software development.
Personal Kanban - how to apply Kanban to yourself!
Scrumban - applying Kanban with SCRUM
The Goal - need I say anything?

XPManchester:
XPManchester blog
XPManchester group

Thanks to everyone who turned up and joined in.  Hopefully provoked some interesting conversations and more importantly gave you some ideas to take away.

Monday, September 05, 2011

Collective Code Ownership

I recently asked the following question - What does good team code ownership look like?
  • Everyone adding (good) test coverage
  • Discussing the code
  • Design strategy
  • Adhere to code standards
  • Tool box of patterns
Everyone adding (good) test coverage

This is especially important, tests make everyone feel secure when making changes to the code base.  Everyone in the team must know the benefits of tests, so must maintain them and add other good tests.

Discussing the Code

The code is essentially a living entity, i.e. we add functionality, we have to look after it, it is often sick!  So it's important that the team talks about the code base.  This is powerful because it gives people are deeper understanding of the code base.

Design strategy

A way to improve the design - most code bases have areas that don't give us the necessary ways to change the code, or they are hard to test.  So they need to be refactored & improved upon.  We are currently doing this with our UI - using MVP.

Adhere to code standards

Currently we don't have any standards, however, I do think we have a good code style.  This is mainly garnered from Uncle Bob's clean code videos - which are excellent by the way - you should watch them if you've not (or read his book Clean Code)!

Toolbox of Patterns

You've got to be able to change the code, this becomes linked to discussing the code.  Patterns can help with discussing the code...  Having a design strategy - links to this!

This is not a comprehensive list but it's a good start...

Remember:
“It's important not to own code you've written in a code base; however it’s important that people respect the way the code was written”

Thursday, August 18, 2011

Limited WIP Society - Open Space


I attended the second Limited WIP Society group @ LateRooms.com - this was in the format of an Open Space - essentially this is a conference style half hour time slots on things about Kanban and other systems thinking stuff...  The tracks that I attended are below - I've tried to remember as much as possible!!

MMF’s (Minimum Marketable Feature)

This was interesting discussion - the main point was the importance of understanding what value.  The definition of value must be shared between the business and development...

Other interesting points:

  • Capability in order to be able to deliver a MMF – so in essence there has to be the technical ability to deliver something within a day.  I.e. can you write code, test it and deploy it easily enough in a day.  If you can’t then your transaction cost is too much and you are not going to get the benefit from a MMF.  The other interesting discussion was about business capability – the business needs to be in a position where it can receive MMF’s and understand the impact on them.  
  • MMF’s are all about reducing risk, delivering value, and having a constant feedback cycle. 
  • Someone mentioned a graph in order to decide on whether an item is an MMF – I can’t find it at the moment. 
  • Alkthough it’s important to say “No” – some times its better to give people options to the business users. 
  •  I’ve also heard of people using the following to decide on an MMF or to clear a backlog:
Somewhat unrelated but still important:


  • Kanban doesn’t work with multiple delivery teams.  If the team does not deliver the same thing then Kanban can’t work.

Daily Stand-Ups & Retrospectives

  • The focus of the meeting should be unblocking the blocked issues – everything else is unimportant.
  • Important that at the stand-up the team is protected.  You need to reduce the external pressure.
  • Managers have a changed role within Kanban – they have to prioritise and help to unblock issues – rather than manage people.
  • The granularity of tasks is important – if the tasks are too big and nothing moves then something is probably wrong.  
  • The issues within the stand-up are important but the detail of the issue is not important.
  • Some retrospectives should focus on analysing data others should be in the normal retrospective style – i.e. what went well, what went not too well, and what can we do better next time.  It’s important that during a retrospective that everyone has done the best that they can do.

Coaching

This was an interesting talk but unfortunately I didn’t take many notes.  It mainly surrounded the fact that the change to Kanban is a cultural one which can be hard to invoke.  Somehow we managed to start talking about The Choice by Goldratt!  @wisemonkeyash talked about the glaze of resistance/layers of resistance and has posted this awesome link about why change is difficult.  We started to talk about mermaids, and crocodiles!  However, the overaching thing for me was that everyone is open to change it is just the way in which you invoke the change that is important.  It has certainly highlighted that I need to read “The Choice” and other books – i.e. Driving Technical Change.

Identify Bottlenecks

This was mostly inspired by the Theory of Constraints – why and how it is important to find a bottleneck.  What to do with a bottleneck and other random thoughts about inventory in software development.  I found this talk to be one of the most interesting because it’s a topic that I'm very interested in at the moment - for this reason I'm not going to excessively talk about it!  This blog contains enough thoughts about this!  It’s highlighted some interesting things about trying to elevate the bottleneck – something we are not doing at the moment.

An excellent night.  I know I've probably missed some information!

Wednesday, July 27, 2011

Efficient Vs. Effective

I've been thinking about "The Goal" of Kanban in our organisation for some time.

I believe that there are numerous (side/non) goals - however, the one true goal is to deliver high quality, business value to the customer.  However, to enable this to happen a Kaizen (continous improvement) environment is likely to aid & probably help you on this "path" to the goal (you might never get to the goal - it is after all a goal).  You also have to accept that life/business/software dev/nothing is never static so you have to be able to adapt your process to ensure that you keep delivering value to your customer.  This Kaizen environment helps people to eliminate waste, but also empower people to make changes to a process or system which isn't helping to deliver value to the customer.  Anything that doesn't add value is essentially waste.

I think there is a lot of "Non-Value Added" time during software development.  In fact maybe the only "Value Added" time is the point in which you push/pull it to live.  Everything else might just be "Non-Value Added" time!
 
So what exactly is efficiency within Software Development - well to me now it's clear - thanks to wikipedia & the above mind burb!  Efficiency in software development is anything that is not "Value Adding" in your current value stream.

Now you might think - well if you've got Kaizen time (i.e. slack time to improve your process) how is this adding value to your current value stream.  Well it might be something to help improve the flow within the value stream.  This is as important because you are trying to optimise the current value stream - so essentially you are aiming to add value or remove waste from your value stream (agh confusing!).  It's important to accept that these might fail sometimes - but hey people make mistakes and learn from them.


I think Effectiveness & Efficiency get confused.  I'm certainly confused this late at night!  Let me give some arbitrary examples of measuring these two things...

Measuring Effectiveness might be measuring the number of LOC (Lines Of Code) a developer writes.  However, this is irrelevant in line with the "Goal".

Measuring Efficiency might be measuring the amount of Business Value a developer delivers to the business.  This is more relevant to the "Goal", and to some degree is measurable against the goal.

However, this will promote local optima - promoting selfishness, and definitely promoting a non-kaizen environment.  This would lead to a process which is not optimised - you essentially get silos of optimised process, with other areas unoptimised.  That's why it is important to look at your full value stream when measuring Efficiency.

Before measuring Effectiveness think about the impact this might have on your overall "Goal".

Thanks to the following for making me think about this stuff way too much: