Archive for December, 2016

“We’re doing our own flavour of Agile/Scrum”

by Oliver on Tuesday, December 13th, 2016.

I won’t descend into hyperbole and say you should run, shrieking and naked into the dark night, when you hear these words. But, it’s worth pondering what exactly it means. I think I’ve (over)used this phrase myself plenty over the years and right now find myself examining why so many people find themselves needing to invent their own version of well accepted software workflow methodologies.

You might say “we just pick the parts that work for us” or “we continually iterate on our workflow and so it is constantly evolving rather than sticking to static definitions of Agile”, or “we haven’t found estimations useful”. Many teams that have a significant infrastructure component to their work find themselves split between Scrum and Kanban. I always imagine that traditional or strict Scrum works best when you are working on a single application and codebase, with pretty well restricted scope and limited technologies in play. I actually crave working in such an environment, since working in teams with broad missions and wide varieties of technologies can make organising the work extremely difficult. At the same time you don’t want to split a reasonably-sized team of 6-8 people into teams of 1-2 people just to make their mission/vision clear.

Some reasons I think “custom Agile/Scrum” happens:

  • Most or all of the team has never actually worked in a real Waterfall development model, and can’t appreciate the reason for all the Agile/Scrum rituals, processes and ideals. This will continue to happen more and more frequently, and is almost guaranteed if you are dealing with those dreaded Millenials.
  • Estimations are hard, and we’d rather not do them.
  • Backlog grooming is hard, and we don’t want to waste time on it. Meeting fatigue in general kills a lot of the rituals.
  • Unclear accountability on the team. Who does it fall on when we don’t meet our goals? What is the outcome?
  • Too many disparate streams of work to have one clear deliverable at the end of the sprint.
  • Various factors as mentioned in the previous paragraph leading to a hybrid Scrum-Kanban methodology being adopted.
  • The need to use electronic tools e.g. Jira/Trello/Mingle/TargetProcess (have you heard of that one?) etc, rather than old fashioned cards or sticky notes on the wall. Conforming to the constraints of your tool of choice (or lack of choice) inevitably make a lot of the rituals much harder. Aligning processes with other teams (sometimes on other continents) also adds to the friction.

So anyway, why is any of this a problem? Well, let’s consider for a moment what the purpose of these workflow tools and processes is. Or at least, in my opinion (and if you disagree, please let me know and let’s discuss it!):

  • Feedback
  • Learning
  • Improvement

I think these three elements are so important to a team, whether you implement Scrum or Kanban or something else. If you pick and choose from different agile methodologies, you’d better be sure you have all of these elements present. Let me give some examples of where the process fails.

You have a diverse team with a broad mission, and various roles like backend, frontend, QA, design etc. Not everybody is able to work on the same thing so your sprint goals look like five or 10 different topics. At the end of the sprint, maybe 70-80% of them are completed, but that’s ok right? You got the majority done – time to celebrate, demo what you did finish and move what’s left over to the next sprint.

Unfortunately what this does is create a habit of acceptable failure. You become accustomed to never completing all the sprint goals, moving tickets over to the following sprint and not reacting to it. Quarterly goals slip but that’s also acceptable. You take on additional “emergency” work into the sprint without much question as slipping from 70% to 65% isn’t a big difference. You’ve just lost one of your most important feedback mechanisms.

If you had a single concrete goal for the sprint, and held yourself to delivering that thing each sprint, you would instead build up the habit of success being normal. The first sprint where that single goal is not delivered gives you a huge red flag that something went wrong and there is a learning opportunity. What did you fail to consider in this sprint that caused the goal to be missed? Did you take on some emergency work that took longer than expected? It’s also a great opportunity for engineers to improve how they estimate their work and how they prioritise. It also facilitates better discussions around priorities – if you come to me and ask me to complete some “small” task, I will ask you to take on responsibility for the entire sprint goal being missed, and explaining that to the stakeholders. 100% to 0% is a much harder pill to swallow than 85% to 80% – and in the latter case I believe these important conversations just aren’t happening.

But let’s say Scrum really doesn’t work for you. I think that’s totally fine, as long as you own up to this and replace the feedback mechanisms of Scrum with that of something else – but not stay in some undefined grey area in the middle. Two-week (or some alternative time period) sprints may not work well, or you might deliver to production every week, or every three weeks. Something that doesn’t align with the sprint. Now you are in a situation where you are working in sprints/iterations that are just arbitrary time containers for work but aren’t set up to deliver you any valuable feedback. Don’t stay in the grey zone – own up to it and at least move to something else like Kanban.

But if you are using Kanban, do think about what feedback mechanisms you now need. Simply limiting work in progress and considering your workflow a pipeline doesn’t provide much intelligence to you about how well it is functioning. Measuring cycle time of tasks is the feedback loop here that tells you when things are going off the rails. If you get to the point where your cycle time is pretty consistent but you find your backlog is growing more and more out of control, you have scope creep or too much additional work is making its way into your team. Either way there is a potential conversation around priorities and what work is critical to the team’s success to be had. Alternatively if cycle time is all over the place then the team can learn from these poor estimates and improve their thought process around the work. Having neither cycle time nor sprint goal success adequately measured leaves you unable to judge healthy workflow or react to it when it could be improved.

I guess you could also disagree with all of this. I’d still argue that if you are in a business or venture that cares about being successful, you want to know that how you are going about your work actually matters. If it isn’t being done very efficiently, you want to know with reasonable certainty what part of your methodology is letting you down and respond to it. If you can’t put your finger on the problem and concretely say “this is wrong, let’s improve it” then you are not only avoiding potential success, but also missing out on amazing opportunities for learning and the challenge of solving interesting problems!

Tags: , , ,

Tuesday, December 13th, 2016 Tech No Comments

What’s Missing From Online Javascript Courses

by Oliver on Tuesday, December 6th, 2016.

Perhaps the title is somewhat excessive, but it expresses how I feel about this particular topic. I’m not a “front-end person” (whatever that is) and feel much more comfortable behind an API where you don’t have to worry about design, markup, logic, styling as well as how to put them all together. That being said, I feel it’s an area where I should face my fears head-on, and so I’m doing some small side-projects on the web.

One thing that I realised I had no idea about, is how you actually get a web app running. I don’t mean starting a server, or retrieving a web page, or even which line of javascript is executed first. I’m talking about how you put all the scripts and bits of code in the right place that the browser knows when to run them, and you don’t make an awful mess in the process.

This can only be shown by example, so here’s what I inevitably start with:

<html>
  <head>
    <script src="//code.jquery.com/jquery-3.1.1.min.js" />
  </head>
  <body>
    <div id="data" />
    <script type="text/javascript">
      $.ajax("/get_data",
        success: function(data) {
          $("data").text = data
        }
      );
    </script>
  </body>
</html>

Yes, I’m using jQuery and no that code example is probably not entirely correct. I still find there is a reasonable period of experimentation involved before even the simple things like an AJAX call to get some data from an API are working. In any case, here we are with some in-line Javascript and things are generally working as expected. But of course we know that in-lining Javascript is not the way to a working, maintainable application, so as soon as we have something working, we should pull it into its own external script.

<html>
  <head>
    <script src="//code.jquery.com/jquery-3.1.1.min.js" />
    <script src="/javascripts/main.js" />
  </head>
  <body>
    <div id="data" />
  </body>
</html>

Uh-oh, it stopped working. The code in main.js is the exact same as what we had in the document before but it is no longer functioning. Already, we are beyond what I’ve seen in most beginner Javascript online courses, yet this seems like a pretty fundamental issue. Of course, the reason is that the script has been loaded and executed in the same order as the script tags and before the HTML elements (including the div we are adding the data to) were present in the DOM.

So naturally we exercise jQuery and fix the problem, by only executing the code once the document is ready and the relevant event handler is fired:

$(
  $.ajax("/get_data",
    success: function(data) {
      $("data").text = data
    }
  );
);

But now we have another problem. We’ve heard from more experienced developers that using jQuery is frowned upon, and although figuring out when the document is loaded seems simple enough to do without using a library, we’re not sure that there is a single cross-browser way of doing it reliably. So jQuery it is.

Actually there is another way, well explained here and seems to be well supported without relying on Javascript functions. You simply drop the “defer” keyword into the script tag you want to execute after parsing of the page, and it will now only run at the right time for our purposes:

<html>
  <head>
    <script src="/javascripts/main.js" defer/>
  </head>
...

I had never seen that before, but it was so simple. Many thanks to my coworkers Maria and Thomas for shedding a bit of light on this corner of the browser world for me. Of course, they also mentioned correctly that using jQuery is not an unforgivable sin, nor are some cases of in-line Javascript snippets (look at some of your favourite websites, even those from respected tech giants, and you will undoubtedly see some). But for a novice to web development it is sometimes hard to look beyond Hackernews and figure out what you are meant to be doing.

On to the next web challenge – mastering D3!

Tags: ,

Tuesday, December 6th, 2016 Tech No Comments