Thursday, 2 June 2011

Main concepts of Agile development

There are many books, online resources and discussions on all matters related to Agile development but this post is simply my attempt at trying to succinctly describe the key aspects of this methodology.

There are 3 main aspects in Agile development and each of these are like a leg of a 3-legged stool; each one must be of the same length and strength, and if anyone of them is weak or missing, the stool becomes useless. Likewise, when thinking about using Agile in your organisation it is important to take into account of all these 3 facets of Agility:
  • adoption of the Agile process, such as Scrum
  • use of Agile tools 
  • adherence to Agile manifest.
Adoption of Scrum or similar process
Almost all organisations that have adopted or switched to using Scrum process or similar have, in my knowledge, followed the prescribed process quite closely, along with getting to grip with the terminology and its idiosyncrasies.

Use of Agile tools
From Development point of view, the most important tool to being truly Agile is the use of a continuous integration (CI) server, such as Hudson/Jenkins or CruiseControl along with the discipline that comes with using such as tool. In other words:-
  • All codes are checked into a single Trunk, i.e. no branching or forking unless absolutely necessary
  • All Developers will check-in their code at the end of day. No Dev is permitted to check-out a piece of code and work independently for long periods of time.
  • Pair-programming where possible.
  • TDD (Test Driven Development), i.e. write unit tests and test harnesses before the code is written and the code that gets written is just enough to pass the test and no more. To enhance the code, first enhance the test, then re-factor the code to pass the new conditions in the tests. This is to counteract that fact that are will be many code check-ins during the day and the code base needs to be stable. Running these unit tests every time when a code is check-in ensures the stability of the code, by highlighting immediately when the code is broken due to a certain commit. TDD also adds confidence to the developers in re-factoring the existing code in that the changes they are making are sound, so long as the tests continue to pass. 
  • Automated testing, with the help of automation tools, such as QTP, Selenium, TestNG, JUnit, etc. In Agile, user stories are usually written with a set of Acceptance Criteria and these form the basis for the tests which then need to be automated as much as possible during Sprint. These tests will also be triggered automatically by the CI server whenever the code-base is changed due to a new commit.
Adherence to Agile Manifesto
In a separate post, I summarised the main points of the Agile Manifesto and it is simply that:-

"Early and continuous delivery of working software frequently is the primary measure of progress."

The previous two steps of going Agile are relatively easy to adopt:-
a) get yourself and your team familiar with the process through in-house training or by some other form of training.
b) acquiring new pieces of software tools, most of which are open-sourced.

But this final concept of adherence to Agile manifesto is the most important and it is therefore crucial to understand this clearly so the REAL benefits of adopting Agile methods can be realised. When planning the project in an Agile manner this need to '...deliver working software continuously...' must always be in the forefront of the minds of the Agile team members: "How can we develop the system in such a way that from the very first sprint we can deliver something useful to the users or our customers?"

The logical answer is to build a system in such as way that a single complete feature which is of the highest priority is implemented in the first sprint and deliver to the users. Then, incrementally add in more fully-formed and tested features in the subsequent sprints, until such times that the user deem all the major features have been implemented.

For example, if we are to build an online e-commerce site, then the first sprint will consist of building a web front-end that allows a user to order just 1 product (i.e. add to basket and checkout), having a value of £0.00, so there's no need for payment to be made. The product is then processed internally and an invoice and delivery note is generated, as well as messages being sent to a warehouse system and/or accounting system. In other words, you are always implementing an end-to-end features so that each feature can be tested fully and independently of each other, and most importantly each feature is potentially deliverable to the production environment.

But, what are the implications of building the system this way? Firstly, from hardware point of view, there needs to be in place the infrastructure required to support the flow of data from the web front-end all the way to the back-end warehouse and accounting systems. Secondly, the correct resources are needed in the Agile team which is made up of people from cross-functional teams or disciplines, e.g.:-
  • web developers with knowledge of Java/HTML/CSS, 
  • order processing developers with knowledge of C#, .Net, SOAP, etc., 
  • DBAs with knowledge of database design, modelling and database management, 
  • network engineers to connect the systems together and installing necessary servers and software on the servers,
  • testers with the domain knowledge of the business and knowledge of web testing, system testing and integration testing and performance testing
  • along with the Scrum Master and Product Owner.
Secondly, there is the need to have necessary hardware and infrastructure in place right at the start of the project, so that end-to-end functionality can be implemented and tested.

The benefit of having a production-like hardware early in the project phase is that it affords the testers to carry out non-functional testing, such as stress, performance, load, etc. even before the rest of the system in put in place and to discover potential bottlenecks very early.

No comments: