Tuesday, 28 May 2013

Managing Build Jobs for Continuous Delivery

This is an article that I found in InfoQ by Martin Preston. He talks in detail about continuous delivery and I think it is worth republishing.

Continuous Delivery (CD) facilitates the path of an evolving product from development through to production. Continuous Integration (CI) plays an important part of this process and defines the software development process, residing at the beginning of the CD process. There is a wealth of information in books and on the Internet describing CI processes, however with a large amount different CI tools available there is little information on the build jobs which compile and test the code that are central to the CI process. A typical CI process is as follows: The developer manually builds and tests source code on their own machine. They will then commit their modifications to a source control management system. A build tool will subsequently run jobs which compile and test the code. The built artefact is then uploaded to a central repository ready for further deployment and testing.
 
Hence, it is the role of jobs in the CI tool to manage the continuous modifications of the source code, run tests and manage the logistics of artifact transportation through the deployment pipeline. The number of jobs in a build tool can range from just a few to perhaps several thousand, all performing various functions. Fortunately, there is a way to manage all of these jobs in a more efficient manner.

Automatic Creation of Build Jobs

So why should we set up a facility to automate the creation of other jobs? Build tool user guides describe how to create build jobs but they do not often explain how to manage them in any great detail, despite the functionality being available in the tool to do so. Normally the developer will know how their application is built and so take sole responsibility for the creation and configuration of the build job. However, this process has some disadvantages:
  1. Software architectural constraints: Applications are likely to be built differently from one another, depending upon architecture. The developer may interpret how an application is built differently from another developer and so the build configuration will slightly differ from one job to another. Hence, a large number of jobs become unmaintainable if they are all configured differently.
  2. Human factor: Manually creating a job introduces the  risk of making mistakes especially if a new job is created by copying an existing job and then modifying that job.
  3. Job timeline control: There is generally no record kept of job configuration for every build, i.e. If a job configuration is changed it could break previous builds.
So considering the points above, if developers are 'left to their own devices' to create build jobs without a consistent method for creating jobs, then we are going end up with a poorly maintained CI build system and a headache to manage. This defeats the purpose of how a CI system should be set up; lean and maintainable. Most build tools in fact have the facility to create, maintain and backup build jobs automatically usually via API scripts. However, these features, despite mentioned in the build tool user's manual, are often overlooked and not implemented.

Advantages for automating the creation of build jobs

There are several advantages of using a master build job to automatically create multiple jobs in order to facilitate the CI build process.
  1. All build job configurations are created from a set of job templates or scripts. These can be placed under configuration control. Creation of a new job is then a simple matter of using the template or running the scripts. This can cut job creation times significantly (many minutes to a few seconds). Hence, Job configuration changes are made easier; configuration changes to the build job template ensures that all subsequent new jobs created will inherit the new changes.
  2. Consistency with all existing build job configurations implies that globally updating all configurations via tools or scripts is more straightforward than with a cluttered inconsistent system.
  3. The developer does not necessary need detailed knowledge of the build tool to create a build job.
  4. The ability to automatically create and teardown build jobs as part of an Agile CI build lifecycle.
Let's discuss the points listed:

Point 1: Configuration Control of Job Configuration

It is good practice that every component of a CI system should be placed under configuration control. That includes the underlying build systems and the build jobs, not just the source code. Most build tools store build job configuration as a file on the master system. These files are set to a common XML format and are normally accessible via the front end interface directly through a REST API of some kind. Some build tools have a built-in feature that can save job configuration as a file to any location. Since the job configuration can be saved as a file it can be stored in a configuration management (CM) system. Any job configuration change can be recorded through either modifying the file directly, then upload the file to the build tool or modifying the job configuration from the build tool, save the file and upload it manually to the CM system. The method carried out depends upon how easy it is to access the job configuration file directly from the build tool. Another important reason for storing job configuration in a CM system is that in the event of a catastrophic failure and all job configurations are lost, the build system can be recovered relatively quickly and all jobs, build logs and job history restored back to their last known good state.

Point 2: Job Maintenance

Of course it goes without saying that maintaining a thousand jobs of different configurations would be a major headache, which is why it is so important to standardise job configurations. If a change is required that impacts on a large number of similar jobs, then writing scripts or creating special tasks to modify these jobs would be straightforward. However, having a thousand jobs in a build system is not the best strategy for CI.  We will discuss this further under Point 4.

Point 3: Developer Control

Although developers are encouraged to work autonomously, building their applications using a centralised build system, they need to work within guidelines outlined by the build process. A developer will expect fast feedback of their code changes and so not want to waste a lot of time messing around with build tools and job configuration. Providing developers with a one button 'self service' style solution to set up build jobs automatically, will help them achieve their development task objectives more quickly.

Point 4: A Lean CI System

Although software developments teams adopt Agile methods in developing their products, the build tools they work with are not necessarily used in the same way, i.e. a properly configured build tool should not contain thousands of long lived build jobs. Ideally, jobs should be created on demand as part of a build CI lifecycle. As long there is the means to recreate any build job from any historical job configuration and that build relics are retained, i.e. logs, artifacts, test reports etc., then only a handful of jobs should exist in the build tool. Of course an on-demand job creation-teardown solution may not be an achievable goal, but the point is that the number of jobs in a build tool should be kept to a manageable level.

Day-to-day Development

Build management governs the tools and processes necessary to assist developers in day-to-day activities with regards to build and continuous integration. Utilities can be set up which empowers development teams to create build jobs and provide flexibility in job configuration but still be governed by best software development practices.

The CI Job Suite

Consider typical tasks that developers carry out during the course of day to day development:
  • Build a baseline
  • Release the baseline
  • Build a Release branch (often combined with releasing the baseline)
  • Create a development branch, build the branch
  • Run Integration Tests
Best development practices aside, i.e. develop on baseline as much as possible, hence few or no development branches, software development teams generally follow the tasks outlined above by running a suite of build jobs in the build tool. Now this is where automatic creation of jobs adds huge value to the software development process; if a developer wanted to created four to five jobs to cover all of the development tasks to manage their day to day operations, it would take them a significant amount of time and effort to create the jobs manually. This is in comparison with automatically creating jobs in a fraction of the time at a push of a button.

When to implement a self-service job creation solution

Implementing a self-service solution for creating build jobs is applicable for the following cases:
  1. Initialisation of new 'green-field' projects (those that have never been built before).
  2. Projects that already exist but never had any build jobs set up for them. i.e. building manually from a developer's own machine.
There are also cases where implementing a self-service job creation solution may not applicable:
  1. If a product only has a few jobs, i.e. large monolithic applications, then it may be considered not of value to the business to spend a considerable amount of time and effort designing, testing and rolling out an automated create job process for just those few projects. However, as the business expands, the product architecture will become more complex as more development streams are set up to manage the extra workload, hence the number of jobs in the build tool will inevitably increase.
  2. Projects with existing jobs: Two scenarios can be considered when dealing with existing jobs in the build tool.
    • Delete the existing jobs and recreate them with the job suite creation utility, thereby losing all historical build information and logs.
    • Keep the existing jobs and attempt to modify their configuration to match the job configuration created by the job suite creation utility.
In any case, there is always going to be some overhead with maintaining legacy build jobs.

Setting Up a Self-Service Job Suite Creation Facility in a Build Tool

We have talked about the advantages of automatically creating build jobs, so now let's discuss how we can implement such a feature in a build tool. The principle should be the same for building applications for any language I.e. Java, .NET etc...

Introducing the Job Creation Build Form

The build form is a means to pass information from the build tool directly to another feature or backend scripts that perform the job creation tasks. Ideally, as much project information should be provided upfront. This will reduce the amount of any additional effort required later to add extra configuration to the newly created build jobs. Information such as project title, location of source code and specific build switches are normally required.  Hence, at a push of the 'Build' button the jobs are created just a few moments later.

Build Tool Implementation:

We shall now discuss how such a job creation facility can be implemented in a build tool. Two tools for which I have had personal experience of setting up job suite creation facilities are Hudson and Anthill Pro 3.

Hudson / Jenkins

For clarity we will just talk about Hudson, but the information is equally relevant for Jenkins. The Hudson CI tool has become very popular for Build Managers looking to minimise their development resource budget and do not want to be tied down with expensive licences. Hudson defines its build job configuration in XML format. A typical job config XML file is accessible from the top level page of the job url, i.e. http://hostname/job-name/config.xml Most of the sections in the config file are self-explanatory. Sections are added by plugins in the config file only when they are used in the Hudson GUI. These config files can be 'templated' by replacing specific project information in them with tokens. Several templates can be used to carry out different tasks, i.e. Checkout of source code from different SCMs e.g, Subversion or GIT. So now we need to link the create job build form to the scripts. The diagram below shows the workflow:
Hudson Job Creation Workflow The build form passes the information to the scripts which substitutes the tokens in the templates with the relevant information. The config files are then uploaded to the Hudson tool via an API. More details about the API can be found in Hudson by adding the string ‘api’ to the url in the browser, i.e. http://hostname/job-name/api. An example of a Hudson API create job upload command is shown below: curl –H Content-Type:application/xml –s –data @config.xml ${HUDSONURL}/createItem?name=hudsonjobname
Hudson Create Job Form The jobs can be manually added to a new view.
Hudson Job View A few points to note:
  1. If the Hudson security section is configured, ensure that the 'anonymous' user has 'create job' privileges otherwise the upload will fail authentication.
  2. If Hudson tabs are used to view specific groups of jobs, it will not be possible to automatically place any of the newly created jobs under those tabs, except for the generic 'all' tab (or any tab that uses a regex expression).  The Hudson master configuration file will require updating as well as a manual restart of the Hudson interface. Once the jobs are created they can then be manually added to the relevant tab if so desired.
Scripts can be written in any language, such as ANT, Perl, Groovy etc., so it is a relatively straightforward set of tasks to create scripts in order to carry out the steps outlined above. A typical ANT script is shown below:
<project name="createjob" default="createHudsonjobsConfigs">

<!-- Ant script to update hudson job config.xml templates to create new jobs in hudson -->

<!-- Get external properties from Hudson build form -->
  <property name="hudsonjobname" value="${HUDSON.JOB.NAME}" />
  <property name="scmpath" value="${SCM.PATH}" />
  <property name="mvngoals" value="${MVN.GOALS}" />

<!-- ...do same for rest of properties from the hudson form -->
...
...
  <property name="hudson.createItemUrl" 
value="http://hudson.server.location/createItem?name=" />

<!-- Include ant task extensions-->
  <taskdef resource="net/sf/antcontrib/antlib.xml"/>

<target name = "createHudsonjobsConfigs" description="creates new config.xml file from input parameters">

<mkdir dir="${hudsonjobname}"/>

<!-- loop through each job template file replacing tokens in the job-templates with properties from Hudson -->
  <for list="CI-build-trunk,RC-build-branch" param="jobName">
      <sequential>
      <delete file="${hudsonjobname}/${configFile}" failonerror="false"></delete>
      <copy file="../job-templates/@{jobName}-config.xml" tofile="${hudsonjobname}/${configFile}"/>
      <replace file="${hudsonjobname}/${configFile}" token="$HUDSON.JOB.NAME" value="${hudsonjobname}"/>
      <replace file="${hudsonjobname}/${configFile}" token="$SCM.PATH" value="${scmpath}"/>
      <!-- ...do same for rest of tokens in the job template -->
      ...
      ...
      <antcall target="configXMLUpload">
        <param name="job" value="@{jobName}"></param>
      </antcall>
      </sequential>
  </for>
</target>

<!-- contruct the job config upload command -->
<target name="configXMLUpload">
  <echo>curl -H Content-Type:application/xml -s --data @config.xml ${hudson.createItemUrl}${hudsonjobname}-${job}</echo>
  <exec executable="curl" dir="${hudsonjobname}">
    <arg value="-H" />
    <arg value="Content-Type:application/xml"/>
    <arg value="-s" />
    <arg value="--data" />
    <arg value="@config.xml" />
    <arg value="${hudson.createItemUrl}${hudsonjobname}-${job}"/>
  </exec>
</target>
</project>

Below is a typical tokenised Hudson job template:
<?xml version='1.0' encoding='UTF-8'?>
     <project>
       <actions/>
       <description>Builds $POM.ARTIFACTID</description>
     ...
     ...
       <scm class="hudson.scm.SubversionSCM">
         <locations>
           <hudson.scm.SubversionSCM_-ModuleLocation>
           <remote>$SCM.PATH/trunk</remote>
           <local>.</local>
           <depthOption>infinity</depthOption>
           <ignoreExternalsOption>false</ignoreExternalsOption>
         </hudson.scm.SubversionSCM_-ModuleLocation>
       </locations>
     </scm>
     <assignedNode>$BUILD.FARM</assignedNode>
   ...
   ...
     <builders>
       <hudson.tasks.Maven>
         <targets>$MVN.GOALS</targets>
         <mavenName>$MVN.VERSION</mavenName>
         <usePrivateRepository>false</usePrivateRepository>
       </hudson.tasks.Maven>
     </builders>
   ...
   ...
   </project>
CI-build-trunk-config.xml Hudson Job Template

Anthill Pro

Anthill Pro is a licensed build and continuous integration tool from Urban Code Inc. which provides the user almost complete custom control of build jobs via a GUI and an extensive API library. The latest incarnation from UrbanCode is uBuild, which is essentially a cut down version of Anthill and is geared primarily towards the continuous integration building of products rather than its parent product which was originally designed to manage to entire continuous delivery pipeline. uBuild does not have the API capability that Anthill has but it is possible to create a plugin that can do a similar thing. Build jobs in Anthill are called 'Workflows' which essentially are a pipeline of individual job tasks executed in a specific order (serial or parallel). Anthill's API scripting language is Beanshell which is based on standard Java methods. Beanshell scripts are stored within the Anthill graphic user interface and called from within a job task. The latest version of Anthill allows custom-built plugins which can be developed with any programming language. An Anthill job task is created using API calls which essentially 'constructs' all the necessary functions of that workflow. The script can be particularly long as every aspect of the workflow configuration has to be populated with data. Just like Hudson, build job information is collected via a build form which executes a master workflow, calling on the Beanshell scripts to create the relevant workflow.
Anthill Job View
Anthill Create Workflow Form A typical Java Beanshell script is below.
private static Project createProject(User user) throws Exception {
         // get the values from the buildlife properties
        String groupId = getAnthillProperty("GROUPID");
        String artifactId = getAnthillProperty("ARTIFACTID");
        String build_farm_env_name = "linux-build-farm";

        String branchName = "branchName";

        Workflow[] workflows = new Workflow[3];
        // Set up Project
        Project project = new Project(artifactId + "_" + branchName);

        // determine whether the project already exists and is active
        boolean isProjectActive;
        try {
            Project projectTest = 
getProjectFactoryInstance(artifactId + "_" + branchName);
        isProjectActive = projectTest.isActive();
      } catch (Exception err) {
          isProjectActive = false;
      }

      if (!isProjectActive) {
          project.setFolder(getFolder(groupId, artifactId));
          setLifeCycleModel(project);
          setEnvironmentGroup(project);
          setQuietConfiguration(project);

          String applications = getAnthillProperty("APPS");
          // create project properties
          createProjectProperty(project, "artifactId", artifactId, false, false);
          // set the server group for the workflow and add environment properties
          addPropertyToServerGroup(project, build_farm_env_name, applications);

          project.store();

...
...

    // Create the CI Build workflow
            String workflowName = "CI-build";
            workflows[0] = createWorkflow(
                    project,
                    workflowName,
                    perforceClientFor(branchName, groupId, artifactId, workflowName) + buildLifeId,
                    perforceTemplateFor(branchName, groupId, artifactId, workflowName),
                    "${stampContext:maven_version}",
                    build_farm_env_name,
                    "CI-build Workflow Definition"
                    );

            // add trigger url to commit-build branch
            addRepositoryTrigger(workflows[0]);

    // Create the Branch workflow
            workflowName = "Branch";
            workflows[1] = createWorkflow(
                    project,
                    workflowName,
                    perforceClientFor(branchName, groupId, artifactId, workflowName) + buildLifeId,
                    perforceTemplateFor(branchName, groupId, artifactId, workflowName),
                    "From ${stampContext:maven_version}",
                    build_farm_env_name,
                    "Branch Workflow Definition"
                    );

   // Create the Release workflow
           workflowName = "Release";
           workflows[2] = createWorkflow(
                   project,
                   workflowName,
                   perforceClientFor(branchName, groupId, artifactId, workflowName) + buildLifeId,
                   perforceTemplateFor(branchName, groupId, artifactId, workflowName),
                   "${stampContext:maven_release_version}",
                   build_farm_env_name,
                   "Release Workflow Definition"
                   );

...
...

        } else {
            // project already exixts
            String msg = "Project " + artifactId + "_" + branchName + " already exists - check project name and pom";
            throw new RuntimeException (msg);
        }
        return project;
    }
Example CreateProject Java Beanshell script Note: It is also possible to create a self contained package of Java Beanshell scripts such as a jar file which is placed in a folder on the Anthill Pro application server. Direct calls to classes within the jar file can then be made from a shell task within the application. This works well especially because the scripts can be unit tested before being applied in a live development environment.

Other Tools

So, as long there exists the ability to create jobs via an API or a template feature, the implementation described here can be similarly applied to other build tools such as Thoughtworks Go, Jetbrains Teamcity and Atlassian Bamboo to name but a few.

Ultimate Build Tool Agility: Implementing the Lean Build Tool philosophy

An advantage mentioned earlier in this article discussed the concept of automatically creating on –demand CI projects and then tearing them down after completion. This would significantly reduce the amount of build jobs in the build tool. I have yet to implement an agile lean method for automatically creating and tearing down jobs on a build tool, so the technical challenges to implement such a task have yet to be realised. However, everything that has been discussed here can lead to implementing such a solution. In fact the Atlassian build tool Bamboo has the feature to detect branch creation from a main baseline and then automatically create an appropriate job to build it.

Summary

We have discussed how to set up facilities to create other jobs that form part of the continuous delivery strategy for a business.
  • An automated approach to creating jobs in a build tool should be adopted as part of everyday software development operations.
  • Automatic creation of jobs saves time and allows the developer to get on with more important tasks.
  • Consistent build job configuration leads to easier job maintenance and drives consistent development practices across a company.
  • Automatic job creation can ultimately lead to a true Agile adoption of software development right down to the build tool level.

Courtesy

Martin Peston is a Build and Continuous Integration Manager for Gamesys, the UK’s leading online and mobile gaming company owners of the popular bingo brand Jackpotjoy and social gaming success Friendzys on Facebook. Martin has 15 years of cross-sector IT experience, including Space, Defence, Health and Gambling. He has dedicated around half his career to build management and is passionate about bringing Continuous Delivery best practices to software development companies.

Monday, 24 September 2012

Common “Product Owner” pitfalls



Last week I was reading the book “Agile Product Management with Scrum” by Roman Pichler. This book is a short one but clearly and crisply explains what a PO means and how someone can become an efficient and effective PO. During my Scrum days, I have not yet given much attention to the PO (Product Owner) role. Even though we all understood the importance of having such a person, I was more focussed on getting the team set on Scrum as the management framework. Also, we had the luxury of having a program manager, an exceptional individual who was hands-on on technology, domain, and customer management. So, developing or coaching was simple and hassle free.
However, later when I was trying to impart some knowledge to a different team and get a person who could be the PO, I found it very tough to get anyone who could think of requirements as stories. Everyone was thinking from the system perspective and requirements where initially written keeping the system as the user. System shall have the capability… kind of stories were written. It took some time and pains to get used to the user story perspectives right.
What really surprised me was not the system based requirements but the kind of thought process the team undertook. It was so typical of any organisation who does not understand how to really find out what the user wants. While I was reading Roman Pichler, some of the common pitfalls he explained w.r.t POs are similar one that I had faced. To name the most troubled topics,
1. Analysis paralysis
2. We know what the user really wants OR We know what is best for the User
Let us briefly talk the above mentioned topics.
Analysis Paralysis
This is the most common thing that happened and could happen to any project team before the commencement of the project. Developers, architects, product management, project manager, business leadership will all be tense and clueless. Leadership thinks the best way to bring any sense to this state or bring some order to the chaos is to do analyse in-depth all the requirements/features and come up with proper design and thus mitigate any technical risks upfront. No doubt, this part will take more time and some cases most of the initial “guesstimates” will be used up entirely for this activity alone. Also leadership thinks that this activity will be or should be over in a span of 2 weeks to 2 months depending upon the size of the project. In projects that I have seen, if the analysis and risks are not mitigated within 2 weeks, then the tech lead will be scrutinised for the “lapse”. The entire project team will be notified of the “lag” or “slippage” that had been caused, etc. etc. This puts pressure on leads and team to complete the analysis activities and start coding. Unless the coding starts the leadership will be behind the leads and the team. The end result of such approach is predictable enough; bugs, incomplete features, frustrated team and leadership, missed deadlines, and, of course, unhappy customers.
Lately, leadership have started to understand that for a better and sustainable way to mitigate risks and analyse requirements to its fullest is to try it in smaller sprints of not more than 2 – 4 weeks long.

We Know What the User Wants
This kind of approach is mostly familiar with teams who have been working with a particular customer for a long period of time. Over a period of time, team gets a feeling that they are now good at anticipating or understanding customer needs. I have experienced this personally with one mof my team. The tech lead was so sure that he went ahead and gave his suggestions on risks and risk mitigation options too. However, it turned out that his assumptions/presumptions were wrong for more than 50% of the requirements. What ensued was a difficult discussion with the leadership on why we would need to re-visit the original plan and assumptions.
What I really find is that whether the teams are agile or not, the problems are similar and also its root causes. We have tried to iteratively increment the software development and tackle risks as and when it occurs. This approach had worked well for the teams that I had worked with. The reason is simple because it is very difficult to realise to a greater extend what the customer had in his/her mind when these requirements were spoken about. Reiterating the vision and behaviour of the features at short durations will help not only the customer but also the development team to find and mitigate risks as early as possible.



Monday, 17 September 2012

Architects and Agile

Some of the most talked about topics in the agile world is how does an architect effectively do his/her job? This is essentially a concern raised by most people in the architecture realm who are set to transform or already in the mid-transformation state of agile. Architects will clearly understand the roles and responsibilities prescribed by Scrum and since no new definitions or guidelines are not put up for architects, they are mostly left to find their path by themselves. This often results in some chaotic situations for scrum teams. The PO might have clearly explained the expected outcome of a story in no ambiguous terms, but architects may not be ready with a robust explanation from a technical front. Reason? architect thinks they are moving along with the teams and not ahead of them.

Multiple reasons could be attributed to the confusion and the resultant complexity that might arise in an scrum team w.r.t architecture. Mostly because, architects find it very difficult to understand incremental architecture while keeping a holistic "big picture" in mind. They have always been architecting the whole software before the development teams get a feel of it. The typical scenario will look like this, architects will spend months together creating and defining all of the software and its internal and external communication interfaces. Then, this will explained to development teams who may have questions and feedback based on which some changes will be made. This will go back and forth a couple of times before getting sealed. Once sealed, then developers will go and just implement the architecture. Expectations are scope changes will be negligible or near zero and any changes needed will be covered as change requests and the cycle repeats to get that changes onto the product. 

Now, when asked to keep that big picture flexible enough to adopt early feedback or change requests and instead focus on clearly defining and retiring risks of currently planned stories is not that easy to adopt and follow until a few trials and errors. After a while, architects will find that they are required to stay at least one sprint ahead of the scrum team in order to address any concerns team may have on stories and/or defining and mitigating risks of upcoming sprint stories. This is when they will have to constantly monitor and update the big picture as and when changes are coming in as a result of feedback from customer or from scrum teams. 

So, bottom-line is, architects could do the following things in an agile world to help the development teams.
1. Create the big picture of the software
2. Define and mitigate risks of design for the stories that will be picked up initially.
3. Stay ahead of the team w.r.t sprint deliverable by focusing on next set of stories.
4. Gain feedback on the design and see the technical debt that might be cleared.
5. Keep on updating the big picture as more and more stories are burnt.

Tuesday, 11 September 2012

Kanban– Another way to Lean - Part 2 – When to adopt

How can we succeed using Kanban? When will be the right time to introduce Kanban to the teams? Which all teams could adopt Kanban? At least these questions would have been asked a lot times.
The most common places were we could see Kanban getting applied will be the service or support teams that are placed to support the main line of an organisations business (hoping s/w is the mainline for now).  Any department, like HR, Admin, IT Support, Production Support, etc. are placed in order to have the mainline business run smoothly with minimal interference.
The idea of adopting iterative model may not suite these teams as it might make things only worse as the priorities for these units will change even under a day's notice. We cannot predict when a server will go down or a network outage will happen. However, these teams will also have their own backlogs like improving the n/w infrastructure, scheduled maintenance, etc. The book, Kanban and Scrum-Making Most of Both (co-authored by Henrik Kniberg and Mattias Skarin, published by InfoQ), gives a decent account of their experiences on how well they fitted Kanban and Scrum side-by-side to achieve agility in their operations.
The next best thought would be, can Kanban be adopted at the beginning of an organization's agile transformation or should wait till they mature? I feel that Kanban might work best when picked by mature agile teams who have thoroughly understood the agile manifesto and its philosophy. Teams or organisations that are starting their transformation may find the Kanban bit difficult.
At the onset, the very basic idea of of having less prescribed ways will make it tough for teams as the concept of WIP is still unheard and challenges like not mandating a backlog or even planning and estimation will be quite difficult to digest to some. People may not even understand the agile manifesto and the real reasons why these are in place. Sceptics or people who unwillingly accepted to follow the agile transformation may find this as an excellent opportunity to continue what they were doing earlier. After still seeing that projects are failing, the blame will be squarely out on the transformation and not on the ways in which it was adopted.
I have seen that release managers or project managers not being able to suppress their urge to “tell” agile teams what to and when to do, and some time, how to do as well. All these are done in the name of release priorities or business priorities. They may not be blamed as they think it is mentoring that’s been done. They will be son entrenched in their new found world that they fail to notice that their actions are in stark contrast with the basic principles of agile. Now, think about the situation where Kanban gets introduced. I don’t think the agile manifesto will be honoured and neither the teams will become self-managed, etc. Of course, I may be wrong as here might be teams who in spite of lacking agile experience, will adopt successfully Kanban by their sheer enthusiasm and determination, both by employees and management.
I would like to see some examples where they have started Kanban at the onset of transformation. I am stopping now and will try to come back with more insight to Kanban and how well we could adopt it. Till I learn that it will be systems thinking that intrigues me.

Technorati Tags: ,

Friday, 10 August 2012

Kanban - Another way to Lean - Part 1

Kanban, the lean process that helps to keep the work-in-progress to a manageable maximum, is now making great inroads into agile territory that were predominantly using Scrum framework for project management. I am a big proponent of using Scrum for managing agile projects mainly due to its simplicity. Simple and powerful, are the two terms that comes to my mind when I think of Scrum.

Over a period of time when the organisation have matured enough that every micro-managers are tamed and everybody are aware of and have seen the benefits of being agile, teams and POs might feel that some of the Scrum's prescribed processes need to be changed or overhauled. I will take a sample of the 2 of the most common things.
1. Locking of the sprint content:- A sprint's contents are added to reflect its theme.  The intent of this constraint or prescription is make sure that team(s) will get a dedicated time to complete items that they committed without anyone interfering with their priorities.  Kanban stresses more on limiting the Work-in-Progress items/stories and not on time bound deliverable. So, a team can start picking stories as soon as they have the capacity to do so. Or in a different case, when a story looses its prominence due to either change in requirement or due to different priority, POs can pull those out and push in either a new item from the backlog or introduce an entirely new item for team to consume.

2. Sprint duration:- POs and deployment teams sees the sprint duration as an inhibitor that stops the completed stories from getting deployed into the production environment so that customers could start feeling the change.  So, here stories could be moved to production as soon as they are complete. The limitation waiting till the sprint gets over is gone. This leads to faster deployments and offer a faster feedback from end users.

Note:- I have used the Scrum terms like PO, stories here only to have some resonance with the roles. Role names may be different in different organisations.

Thursday, 2 August 2012

Project Managers and Agile Transformation - How they could help

The question will be a perennial one as long as IT companies in the world are still yet to adopt agile, "Can a Project Manager be a an efficient Scrum Master? Can he/she help teams to achieve self-governance?" 
However, I feel, we should be more focussing on the more prevailing question, "What is the role of a PM when company has started their agile transformation?"

Well, I think, it is possible and should be made possible unless we want to see the PMs getting "archived". The typical project manager (referred as PM or PMs henceforth) is one person who has the end-to-end view of the entire project spanning from customer to the delivery team. Not just the case of execution, but also the impact w.r.t revenues and the how these aligns to the overall roadmap the organisation wants to take or already taken. The PM's ability to influence people (read operations, resource manager, leadership, engineers, etc. list is too long!) to make things happen could be utilised in a more effective way. PM would always be the better person to get the product owner to prioritise and re-prioritise even before the team, unfortunately sometimes, realizes it. This thought may be difficult to digest whet the core idea of Scrum is to have self-managed teams. However, in the longer run, leaders, not leads, do emerge who could think through the entire project/program without even affecting the iterative, incremental building of the software.

PMs are not expected to be technical, however, a little bit of technical skill blended with domain expertise will definitely help when explaining the need for re-scoping the release trains and could ably support the product owners to get a real feel of how the stories really map to the actual usability. Since the PM had been doing prioritisation of deliverables/features earlier by taking into consideration of different parameters like resource availability, schedule impact, and marketability, they could help a budding PO in great way. As and when the agile transformation progresses, the these inputs from PM will help in creating better product owners who will now blend their domain expertise with customer focus meanwhile improving their ability to influence and prioritise.

PMs come handy when teams want to escalate things that are beyond their control as PMs might still be perceived as part of leadership. This could help teams as well as leadership as they could still leverage the PM's interpersonal skills to get the productivity moving even during the agile transformation phase. Larger the company and subtlety and incremental adoption are the preferred ways, and leadership would still like to see if teams can somehow mitigate the productivity loss and teams could communicate back the realistic expectations w.r.t productivity (or throughput) as agile transformation might call for some amount of re-planning.

It is not a secret that unless trust is established and a conducive work environment is created, productivity will not prosper. This is true not because companies adopted agile or scrum, but is a global phenomenon. Projects only succeeded because above mentioned things were exercised by both employees and leadership. Who else, other than a PM who could create and sustain such an environment.

So, a PM always ends up doing things that are typically defined or perceived as belonging to Scrum Master along with a little of PO role. By doing this extra step during the agile transformation phase will help the company in the longer run because if we cannot sustain the changes we envisioned with current crop of people, then it will be tough to sustain the transformed state with new set of people who come in after the transformation is achieved.

Disclaimer:
These thoughts are good as long as we are talking about good PMs who understand that for a successful delivery, an empowered team is a must and striving to strike the perfect balance with the team will be the core job after the transformation. Some could always confuse this with the term compromising the authority of a PM so as to achieve the goals which the project team agreed to. To this, we should point out to the benefits of utilizing the existing people to manage the transformation. The biggest asset of any company are its PMs who could deliver the promises but by supporting, empowering, and guiding/coaching teams to deliver. The same PM who could be the SM is always a better pill for both "sides" of the company, employees and leadership.

Assumptions:
1. PMs would want to continue and contribute to company's success story
2. PMs are willing to do away with command and control
3. PMs are good and believes in giving credit for the due
4. PMs believe in agile

Friday, 27 July 2012

My Agile Journey - How it all started



I have not been active in the blogging space for a long time. I'm not even updating my Facebook or LinkedIn pages for that matter. It was a chance discussion with my neighbour in office that prompted me back to blogging. I hope to sustain this.

I used to be project manager and was an active pursuant of PMP certification. It was the decision by my business group to move to agile delivery model and getting the leadership to train people in agile using Scrum got me interested in agile and the methodologies and the underlying philosophy. From then I was instrumental in helping the software product teams that I worked with into agile teams.

It was really a good experience that I had when I set out to transform the teams. I was overwhelmed by the responses I got when I asked could we move to be agile from here. We started off by getting the teams introduced to agile manifesto and principles that guided its creation. Concept of user stories, self-managing, story point estimation, product backlog were all new. However, the team made sure that they had this understood and thereby leading to a successful kick off the first major release using agile and Scrum.

I am not going to bog people down with the details of the challenges and other stuffs that we faced during our journey here (I will need stuff for my upcoming blogs!!). I would like to mention that the team had sustained the move and had delivered two more service releases in the last two years.

Note: - Now agile is the defacto project management framework throughout the entire organisation :-)