Monthly Archives: July 2012

Physics of Being Agile

Recently, with all those vibes about SCRUM going around in our organization, a couple of colleagues went for “Certified SCRUM Master” training, incidentally same person trained myself and one other colleague 6 months ago. I got a chance to talk to him over phone and was glad to accept his offer to be a guest speaker in his session. It was difficult to find what to talk, what was expected from me was to share how we are implementing it and our journey with SCRUM. However, understanding the nature of the training environment it was pretty clear for me to send a message to the audience, I just wanted to talk about what can be the real world implementation issues one can have with SCRUM or any other AGILE practise implementation in a place where such concepts are not known.

Jim Collins in his book “Good To Great” started off to explain what is the Physics of going from Good to Great. While trying to understand what he means I started to think Agile as Physics albeit Modern Physics. Why??. Because Classical Physics is governed by Laws, the very nature of Laws is their rigidity. And rigidity is something which is quite alien to Agile. In fact Agile Manifesto itself talks about Principles, which are not that rigid in nature. Try comparing this with Principles in Modern Physics, like the Heisenberg Principle of Uncertainty. Just like how we cannot determine the position and momentum of a particle simultaneously, I see some very similar striking similarities in software.

So what is uncertainty in software, we cannot easily and simultaneously predict the direction of the software and the time when that can be achieved. This very nature of software makes it more an Empirical Approach, rather than a Predictive Approach.

Next came, a statement which is quite close to my heart, this helps me measure the direction in which I am heading. Remember the book “The Goal” I talked about in my previous post. How about little Physics against your Goals? Smile

“Any action which is taking you towards your Goal is productive.“

“Any action which is taking you away from your Goal is counter-productive.“

What is our goal here? Our goal here is to be “Agile” so we measure our actions with the Agile manifesto’s principles, this helps us in understanding the Philosophy of Being Agile.

The last point(s) I talked about was the real challenges we face in our day to day implementation of SCRUM. Initially when I heard that it is not easy I was not believing it. But when we saw that it is hurting us back then I realised the challenges.

As an advocator of Agile practises you might face several of challenges, but I can make out only two :

  • People: It is hard to explain people the philosophy of Being Agile until they see it practically happening.  To make it happen you need like-minded people who should be willing to
    • Experiment, learn and experiment without fear of failing.
    • Fight for the cause, be in regular confrontation mode for the common goal.
    • Sacrifice their mediocrity for a greater good.
  • Organizational: Sometimes it is difficult to implement Agile because the scale in which the organizations want to implement it. That’s if they like it they want to implement it as a big-bang. But that’s not how you can implement Agile practises. These principles needs to be infused, SLOWLY….take small steps and show visible improvements.
      • Sometimes there are financial implications
      • Sometimes there are people waiting for decisions from top management
      • Sometimes there are timing issues, example you are already in between of a release, obviously you wont try your hands on new stuff which can jeopardise your current schedule.
      • Sometimes there are simply lack of proper engineering practises to deal with the shorter iteration philosophy of being agile.
      • and many many more..

I believe somewhere there are solutions, being with thinkers and innovators can definitely help in this case.

Which Branching Strategy fits best in a Microsoft Dynamics NAV environment?

Implementing Team Foundation Server in your Microsoft Dynamics NAV environment often starts with version control. Since NAV does not have a native integration with TFS it gives some challenges. The most important one is: what is the best structure for my source code in Team Foundation Server? The Branching Guide of the ALM Rangers is a starting point for the proper strategy.

In Team Foundation Server, your source files are stored in a folder structure. This folder structure is created at the server. While working with the source files, however, a local version is used. The structure is important since this will be used throughout the development process. What is a good practice for such a structure?

I would like to share the branch strategy we implemented in our NAV development teams. In our development team we only develop standard solutions comprising both NAV and .Net technology. There are two formal release moments per year which we have to support. We are following the scrum methodology with an iteration interval of two weeks.  New features are often developed in parallel. This is our branching strategy:

In Team Foundation Server this results in the following source control structure:

  1. The name of the Microsoft Dynamics NAV Product / Solution (which incorporate both NAV and .Net).
  2. Microsoft Dynamics NAV Release; we base our solutions on a particular Microsoft Dynamics NAV release.
  3. The localization of the Microsoft Dynamics NAV code.
  4. All Microsoft Dynamics NAV Objects are stored in the Objects and Unit Tests folder.
  5. Each release (1201 in this example) is branched from the main branch. This allows us to merge bug fixes into the different release branches and keep track of them.

In the past two years I’ve seen different branching strategies applied on NAV development.  One thing became clear: keep it simple! There are costs related to each branch level since each level has to  be maintained. Costs in the sense of complexity and time. Check out the Branching and Merging Primer for a number of branching Anti-Patterns that should be avoided at all costs.

Some best practices:

  • Only include necessarily objects in your source control folder. It is, for example, not a good practice to include all NAV objects in your source control folder. Large projects have a negative impact on the performance.
  • Be conscious in checking in completed changes only. This gives you traceability throughout your branches. Never check in code which is not completed or which does not compile.
  • Pay special attention to the localization aspects of your solution since this is increasing the complexity significantly.
  • Define clear responsibilities and ownership for the different branches.

Can you start with Agile in your NAV development process today?

In the past weeks I got several questions about how to implement Agile in your NAV development team. This is not an easy question since the answer depends on your organization and on your team.

Define The goals: The most difficult aspect of implementing Agile is the organizational change. Following the agile practices requires a mind shift in the first place. Why do you consider to implement agile? Is it because everybody is doing it or is it because of the value it adds for you? It makes good sense to start with a definition of the goal you try to achieve. I recommend this  article to get started. Once the goals are clear you can proceed but keep in mind:

Think Big, Act Small

Version Control: So, what would be a logical next step? This blog is all about Team Foundation Server for Microsoft Dynamics NAV. It will become difficult to use Team Foundation Server for you scrum process without proper version control and build automation. I suggest to start with version control first. This will make you familiar with the Team Foundation Server environment. In future posts I would like to share information about how to enable version control for Microsoft Dynamics NAV.  You need the  To-Increase Source Control plugin for Microsoft Dynamics NAV to get started.

Build Automation: Once your version control is complete you can start thinking about Build Automation. Build Automation requires a one-time installation and configuration at Team Foundation Server and you’re good to go. The process itself is more difficult. Building software is one thing, embedding it in your process is something different.

Adopt Scrum: If your version control and build automation are up and running you can start with optimizing your process. I recommend the excellent presentation of Aaron Bjork, which really helped me understanding how scrum is provided by Team Foundation Server.

One of the good aspects of agile is that it identifies these issues and allows you to improve your process after each sprint. And one of the good things of Team Foundation Server is that it allows you to change the configuration and optimize it continuously.

How to setup and use Build Automation for Microsoft Dynamics NAV?

With Team Foundation Build, you can create build definitions to automate compiling applications, running associated tests, performing code analysis, releasing continuous builds, and publishing build reports.

To build an application, you create a build definition to specify what projects to build, what triggers a build to run, what automated tests to run, and where to deploy the output. This information is stored in the data warehouse, from which it is retrieved when a build runs. After the build runs, data about the build results is stored back in the warehouse, where it is available to view through build reports.

The following illustration shows the three main phases of building an application:

Three phases of building an application

Since Microsoft Dynamics NAV is not provided with out-of-the-box Build Automation it might be a good idea to demonstrate how to set up a Build Configuration for Microsoft Dynamics NAV and how you use it in the process.

The Microsoft Dynamics NAV compiler requires specific settings. After selecting the appropriate template these settings become available. A Microsoft Dynamics NAV build requires the following parameters to be set:

  1. Database; One of the concepts of Continuous Integration (CI) is that you isolate your development from your build environment. That’s exactly what we do here. Each Dynamics NAV build requires a clean environment which means a clean database has to be restored. In our case we use the demo database from Microsoft as the reference.
  2. Dynamics NAV Version; which Microsoft Dynamics NAV binaries have to be used for this build.
  3. Reference Objects; in many cases you might need one or more other NAV solutions which have to be imported in your reference database before you run the build.
  4. Microsoft Dynamics NAV Object Filter; the deliverables of a build are one or more Microsoft Dynamics NAV object files in text and fob format. The name of each filtered set can be specified.
  5. Build Details; the Build Number is written to a specified codeunit (just like you have in Codeunit 1) which makes it possible to track the build details at runtime.

Your Dynamics NAV development team is now ready to use Build Automation. One thing left: how do you unleash the beast? Well there are various ways how you can do that. One of the good things of Team Foundation Server is that it has various interfaces; the most important options are:

With the Team Explorer:

And with Team Web Access:

After queuing the Build it becomes pending:

Once a build is ready it appears under the Completed builds. Team Foundation Server keeps track of the complete history of each Build Configuration:

And the result of each build can be viewed at any moment:

Build Result

A successfully completed build gets associated with Change Sets and Work Items which gives you complete traceability from a shipped solution to the  code. There is much more to say about this, like reports, dashboards and sprint planning.

Build Notifications are provided out of the box. You can get all sorts of alerts if someone breaks a build or if a build completed without any error.

Conclusion: is it easy to implement Build Automation in a Microsoft Dynamics NAV team (assuming you have the To-Increase Build Template for Microsoft Dynamics NAV installed). Once configured, it is easy to set up build configurations and show builds. The process part, however, is more difficult. It requires you to work in a different manner than you are doing today. Instead of focusing on the Microsoft Dynamics NAV Object Designer with its whims you have to think from the agile process. That means no messing around with individual fobs but complete builds of your solution. Build Automation will significantly improve your flexibility and quality and will make your NAV development more fun.

Build Automation for Microsoft Dynamics NAV – a soap or reality?

In my previous post the concept of Continuous Integration has been introduced. In this post I’d like to zoom in on the Microsoft Dynamics NAV specific enhancements of Build Automation.

I recommend this video if you want to get an overview of Team Foundation Server Builds.

Team Foundation Server provides scalable solution for Build Automation. It is quite easy to scale up if you need more build power. In our case parallel processing was an important requirement. Luckily this is provided out of the box. So what server park do you need to facilitate NAV builds? I don’t have much reference material at the moment so I’ll take our scenario as an example: for Microsoft Dynamics NAV solutions with object collections varying from 1000 to 2000.

We have the following configuration for our Microsoft Dynamics NAV builds:

  • 1 Team Foundation Application Server; this server hosts our Microsoft Dynamics NAV Team Project Collection.
  • 1 Build Controller; each Project Collection has one Build Controller.
  • 2 Build Machines; one Build Machine for all versions older than Microsoft Dynamics NAV 2103 and one for Microsoft Dynamics NAV 2013 (and higher…:))
  • 6 Build Agents; a build agent runs the build workflow. We have four of these guys but we can easily increase the number of Agents. We can run two builds in parallel on each Build Service.

So how do you actually use the system in your development process? The first thing is that you have to create a New Build Definition from the Team Explorer.

This opens the Build Definition window in which you can specify the properties of the build. The Microsoft Dynamics NAV enhancement can be activated by selecting the appropriate Build Process Template.

Selecting the Microsoft Dynamics NAV Build Process Template enables the Microsoft Dynamics NAV parameters. After specifying these parameters you are ready to rock.

Conclusion: Build Automation for Microsoft Dynamics NAV is reality and can be enabled without tampering with you Team Foundation Server installation. Just follow the standard installation instructions and you are almost there. If you install the Microsoft Dynamics NAV build template (which can be obtained for a fair price at To-Increase) you are good to go.

Imagine how much power this will add to your development team and how much easier it will be to create shipable units of your Microsoft Dynamics NAV solutions or customizations. Build Automation will definitely change the way you ship your Microsoft Dynamics NAV solutions and will increase your productivity drastically. No, I am not a sales guy and Microsoft does not pay me for telling enthusiastic stories about Team Foundation Server…. 🙂