Agile Business Analysis at Agile2010

August 10th, 2010

The slides for this session are now available for download Agile Business Analysis - Agile 2010

 

On Thursday Gary Jones will be talking about Agile Business Analysis techniques in E-3 at 13:30.

This post brings together some of the resources he will be referring to and other related references. If you have a favourite resource for other BA techniques please feel free to comment below.
Jeff Patton on Pragmatic Personas
This presentation from last years conference is a great place to start to find out more about identifying those differences in customer need that really make a difference to your product.

Rob Thomset – Radical Project Management
This book is where we discovered the sliders technique which provides a framework for considering relative priorities of non-functional aspects of the system.

Software by Numbers by Mark Denne and Jane Cleland-Huang
This was the book that introduced the notion of Minimal Marketable Features. This technique provides a means to realise the promise of incremental delivery of customer valued software.

Geoffrey Moore’s book Crossing the Chasm
This book describes the simple visioning exercise we use that, it turns out, provides the rails for the project helping us identify where we are going off track or experiencing a change in strategy.

Others we like include:

9 Box interview technique
Dave Nicolette describes this technique from Keith Eades’s book, Solution Selling.

Technorati Tags: ,

Enterprise EPiServer: Form vs Structure

August 2nd, 2010

This post was originally posted here by Martin Ottosen.

A common motivation for doing enterprise CMS solutions is the always elusive goal of building a platform (structure) which allows the organization to quickly and cheaply create new websites by leveraging the initial investment of the platform. The vision however gets tainted quickly as reality sets in. The various  business units / brand owners / product managers usually have very different ideas about how they need to communicate to the outside world, they have different ideas about the form that suits their needs. So quickly you end up in a sticky situation where you have to choose between doing a lot of new development work everytime a new site is added to the platform, or restrict the flexibility of the platform to keep it financially feasible.

Form over structure

In other words, one important goal in enterprise CMS is to create a structure which is shared and cost-effective while allowing for a high degree of flexibility in the form of the different sites based on that structure. Lets consider an example problem: We are implementing a generic brand website which is to be the first (of many) sites based on a shared enterprise platform financed by the centralized IT department. Upon inspection of the detailed requirements (wire frames, use cases, information architecture, etc.) the developers are able to determine:

  1. What page types we need to support the requirements (in other words what data is required to render e.g. the front page)
  2. What templates are required to adhere to the specified layout (by transforming the data from e.g. the front page page type to html)
  3. How the different page types are structured (e.g. what type of page can be created as a child of front page)

There… a nice tight data model with a layout on top. Requirements have been met, jobs done… and along comes the next brand site. And it turns out they have different ideas about how they need to communicate, to the outside world. They need a different form, but we have created a very rigid structure, so we need more page types and templates to satisfy their requirements. Slowly we add more and more templates to support the requirements of new sites, driving up costs, increasing complexity (for both editors and developers) and lowering time-to-market. What to do?

Reducing structural granularity

EPiServer Composer Page StructureHere is one strategy we employ using Composer: In case you are not familiar with it, Composer is an add-on to EPiServer CMS which is essentially yet another implementation of drag and drop interface components (similar to webparts, portlets, etc.). Despite it’s apparent simplicity however, I think it has profound consequences for what you can do with EPiServer, particularly in an enterprise setup. Our approach is simple:

  1. Every page on the website (and by page I mean something that the end-user can find on google) is just… a page. So just one template!
  2. Every page has just one content place holder in the full width of the master layout
  3. Into that place holder layout rows can be added
  4. Into the layout rows, content blocks can be added

We have dispensed with the notion of typed pages altogether. A page is just a structural unit which has only the necessary information for a page to work (a location in the site tree, a URL, access control settings, etc.). The form of the individual pages can be composed and changed with a very high degree of freedom by the editor with no development effort required. The templates that were previously managed by developers are replaced by composer templates, which the editors can manage themselves.

Using this strategy, we get a lot more opportunities for reuse across otherwise very diverse websites, time-to-market and TCO is greatly reduced, while quality is improved from having less code to manage. This is of course just one piece of the puzzle, but to me an important initial design decision which has a lot of impact.

Unit tests, code coverage and the hidden trap…

July 30th, 2010

Quality has always been a “hot” subject in software engineering, and several good development practices used in Agile development, unit testing for example, have been created to improve the quality of the softwares developed.

Programme Managers, Project Managers and Assurance Quality Managers haven’t just been looking for techniques to improve quality, they’ve also been looking for ways to monitor the quality of the projects and the application of these techniques.

This has lead to the development of numerous tools to check the unit testing coverage, the style of the code and its compliance to well accepted rules. Plus, of course, dashboards that gather all that information and present it in a user friendly way.

One of the most commonly used metrics is the code coverage of the unit tests. We often see in Agile teams rules like, “the line coverage should at least 80%”, or “the branch coverage should be at least 70%”. But…herein lies the hidden trap. Read the rest of this entry »

Project Estimates

June 24th, 2010

This post was originally published here by Valtech UK consultant Mashooq Badar.

In my previous post on High Level Project Estimates, I talked about 3 points estimates to help provide an up-front estime of effort for a project. Aside from the effort estimate you also need to consider other aspects that the team will spend time on. The following are some aspects I consider with the kind of percentages (above the effort estimate) I have experienced. Note: these percentages are by no means standard or the norm they are essentially a rough guess based on the projects I have worked .

  • Planning Meetings @ 10%
  • Demos @ 2%
  • Code Reviews @ 5%
  • Retrospectives @ 5%
  • Dark Mater @15%
  • Bugs @15%
  • New Technical Stories and Spikes @ 25%
  • Change Requests (shouldn’t average more than 15%)
  • Holidays and Sick Leave @ 5%

You will also need to consider Management Overheads as well as Business Analysts (if included in the team), QA/Functional Testing, Support and Maintenance (if required).

One team, one language

June 23rd, 2010

This post was originally published here by Valtech UK consultant Sandro Mancuso.

On a previous post I was discussing, among other things, how code often doesn't represent the business properly. The code "satisfies" the business requirements but doesn't express them very well. The main reason for that is because we, developers, like to abstract business terms and rules into technical implementations and patterns.

Very often, we discuss the user stories (requirement documents, use cases, whatever the methodology used is) with the "domain experts" and as soon as we understand what needs to be done, we map the requirements to a technical design (actions, services, entities, helpers, DAOs, etc) that is completely meaningless to the domain experts. Sometimes, even among developers themselves, different names and expressions are used to refer to the same thing. The main reason is that different developers talk to different domain experts and come up with different abstractions. As a result,  the usage of different terms to describe requirements leads to confusion, duplication of code and unpredictable behaviour in the system.

The first step towards an expressive and domain-focused design is to have a common language among ALL members of the team. ALL means ALL: developers, domain experts (business analysts, users, product owner, etc), testers, project manager and anyone else involved in the project. Read the rest of this entry »

The Wolf in Sheep’s Clothing

June 12th, 2010

This post was originally published here by Valtech UK consultant Sandro Mancuso.

In the last few years, I've noticed that the majority of the projects that I've participated roughly followed the same design. Speaking to colleagues and friends, the great majority said that they were also following the same design. It's what I call "ASD" design (Action-Service-DAO).

by Action we mean a Struts Action, Spring Controller, JSF backing bean, etc. Any class that handles an action triggered by the user interface.

We can argue that there is nothing really wrong about this approach since if we map that to a three-tier architecture, that is followed by the majority of the applications, the ASD classes would be in the right places, keeping a good isolation between the tiers.

One of the problems of this approach is when services are created randomly, with different granularities, low cohesion and with a weak representation of the business domains. Services end up being function libraries, almost like an utility class where all "functions" related to a specified "module" are grouped. When it comes to DAOs, the situation is not very different. DAOs are developed in a way that they become utility classes where sometimes we find a single DAO with all queries, inserts, delete, updates for an entire module or sometimes you find one DAO per entity. Either way, regardless what the query returns (or what it is its intention), or any rules related to updates or deletes, the methods will go to the same class. As the application grows, the code becomes something like this:

 

Read the rest of this entry »

Object-Oriented Design Principles – Part 2

June 6th, 2010

This post was originally published here by Valtech UK consultant Sandro Mancuso.

In the first part of this Object-Oriented Design principles series, I covered the Single Responsibility Principle (SRP). I had also covered the Liskov Substitution Principle (LSP) on a previous post. So let's move on to another Object-Oriented Design Principle.

The Open Closed Principle (OCP)

Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification

We know that requirements will change, new requirements will come and we will need to change some existing code during the life of a project. However, when a change in one place results in a cascade of changes in other classes, that's a sign that the design is not quite right. Changes causing side effects are undesirable since it makes the program unstable, rigid and fragile where parts can not be re-used.

The Open Closed Principle target all problems described above. Being open for extension means that modules can be extended in order to make them behave in a new or different way. Closed for modification means that we should not change existing code unless that we are fixing a bug.

There were two proposed ways to achieve the OCP and both use inheritance:
  1. Dr. Bertrand Meyer, that coined the Open Closed Principle in 1988, proposes the use of inheritance. When a new feature or a changing on an existing feature is needed, a new class must be created, inheriting from the old one. The new class does not necessarily keep the same interface.
  2. A few other authors redefined the OCP in the 90ies. Basically they suggested the use of abstract base classes and concrete implementations. The abstract class would define the interface that would be closed to modifications. The concrete classes would implement the abstract class interface (open for extension) and multiple implementations could be created and polymorphically substituted for each other.
Nowadays, with the evolution of frameworks with dependency injection capabilities, a better approach would be having a client class pointing to an plain Java interface and inject the implementations.

OCP is an old OOP design principle and is one of the most important ones, due to the problems it solves. It can be an interesting approach in cases where the bureaucracy of changing old code and deployment to the production environment is very high. Some companies may ask for code reviews, a long test cycle (non-automated), documentation, etc. With OCP, no existing code is changed and just new code is added.

However, in a more agile environment, good test coverage, IDEs that have good re-factoring tools (like Eclipse, Idea, etc) I wouldn't be too worried about changing classes and interfaces but this would not invalidate all the advantages of the OCP.

Source
http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29
http://en.wikipedia.org/wiki/Open/closed_principle
http://www.objectmentor.com/resources/articles/ocp.pdf
http://en.wikipedia.org/wiki/Design_by_Contract
http://en.wikipedia.org/wiki/Information_hiding

Defining and Prioritising a Backlog

June 3rd, 2010

This post was originally published here by Valtech UK consultant Mashooq Badar.

What is the best way to review a backlog? How do you ensure that it is "complete"? How do you ensure that the prioritisation reflects the business vision and goals?

When first faced with a backlog, you are often overwhelmed by the long list of userstories. The most important step is to set a context for these userstories. Are these userstories organised in a hierarchy of “epics”? This hierarchy will help set a context. But first we need to understand what these epics mean at the highest level. Do they represent a user’s high-level goals or are they merely there as a container for some loosely related stories?

When reviewing a backlog for completion it is vitally important that the stories are defined in a context. The context can take different forms depending on the nature of the application. For example if an application has a clear high-level flow that the user journeys along then the epics may be defined as activities in this flow and the userstories can be grouped under each epic representing the functionality required for this activity. This article by Jeff Patton presents such an approach. However, your application my exhibit a more random usage scenario. In this case epics representing high-level user goals may represent the best context for the stories. You can also provide references to other artefacts such as user journeys/wireframes to further enrich the context. This article by Scott Sehlhorst is an interesting discussion of setting a context for user stories.

This grouping of userstories by a context also helps to manage their prioritisation. You can individually prioritise stories within each epic and then also prioritise the epics. Note that just because one epic has a higher priority does not mean that all its child userstories are of a higher priority. You may discover that only the first few userstories can provide enough functionality that further work on that epic is of a lower priority then working on another epic.


The Liskov Substitution Principle (LSP)

June 2nd, 2010

This post was originally published here by Valtech UK consultant Sandro Mancuso.

The Liskov Substitution Principle was initially introduced by Barbara Liskov in a 1987 conference keynote address entitled Data abstraction and hierarchy. LSP is also part of SOLID, a group of five Object-Oriented Design Principles put together by Robert C. Martin in the early 2000s.

Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.

The LSP's summary above looks quite obvious. If the calling code was written to use a base class, replacing it with a sub-class (inheritance) should make no difference to the calling code. That means, the calling code should not be changed and should be totally agnostic about which implementation is being used.

LSP's importance is noticed mainly when it is violated. If a subclass causes changes on the calling code, that means, the calling code needs to test which subclass it is dealing with (instanceof, casting, etc), the code is violating the Liskov Substitution Principle and also the Open Closed Principle. This violation causes high coupling, low cohesion and a cascade of changes.

Violation of Liskov Substitution Principle

public void drawShape(Shape s) {
if (s instanceof Square) {
drawSquare((Square) s);
} else if (s instanceof Circle){
drawCircle((Circle) s);
}
}

The Liskov Substitution Principle also imposes a few rules that the sub-classes must obey. It bears a certain resemblance with Bertrand Meyer's Design by Contract in that it considers the interaction of subtyping with pre- and postconditions

...when redefining a routine [in a derivative], you may only replace its precondition by a weaker one, and its postcondition by a stronger one.

This means the sub-classes must accept everything that the base class accepts (pre-condition) and must conform to all postconditions of the base class.

Example of a more subtle violation
public class Rectangle {
private int height;
private int width;

public Rectangle(int height, int width) {
this.height = height;
this.width = width;
}
public int getHeight() {
return this.height;
}
public void setHeight(int height) {
this.height = height;
}
public int getWidth() {
return this.width;
}
public void setWidth(int width) {
this.width = width;
}
}

public class Square extends Rectangle {

public Square(int size) {
super(size, size);
}
public int getHeight() {
return super.height;
}
public int getWidth() {
return super.width;
}
}

In the code above, a Square IS A Rectangle. Note that a rectangle can have different sizes for width and height, but in a square, height and width must be of the same size. What would happen in the following code is executed ?

Rectangle r = new Square();
r.setHeight(5);
r.setWidth(6);

We should not allow this to happen since that would make the Square object invalid. In a square, height and width must always be the same. A quick fix for this would be to override the setter methods:

public class Square extends Rectangle {

public Square(int size) {
super(size, size);
}
public int getHeight() {
return super.height;
}
public int getWidth() {
return super.width;
}
public void setHeight(int height) {
super.height = height;
super.width = width;
}
public void setWidth(int width) {
super.width = width;
super.height = width;
}
}

Although this approach would fix the problem, is a violation of the Liskov Substitution Principle since the methods will weaken (violate) the postconditions for the Rectangle setters, which state that dimensions can be modified independently.

One interesting thing to note is that if we analyse the Rectangle and Square classes in isolation, they are consistent and valid. However, when we look at how the classes can be used by a client program, we realise that the model is broken.

Every time you get yourself adapting a sub-class so that it does not break or its state does not become invalid if used in the context of a super-class, this is a clue that the sub-class should not be a sub-class at all.

In this example, maybe a Square is not a Rectangle. Square should not have height and width to start with. It should just have size. And since a Square is not a Rectangle, it should never be used in a Rectangle context.

public class Square {
int size;

public Square(int size) {
this.size = size;
}
public int getSize() {
return this.size;
}
public void setSize(int size) {
this.size = size;
}
}

We can not validate a model in isolation. A model should be validated just in terms of its clients.

Source
http://en.wikipedia.org/wiki/Liskov_substitution_principle
http://www.objectmentor.com/resources/articles/lsp.pdf

Naming your Unit Tests

May 27th, 2010

This post was originally published here by Valtech UK consultant Mashooq Badar.

Often I see Unit Tests with the test methods that have the same name as the method under test prefixed with the word "test" e.g. testSubmitApplication. This provides no extra information on which "flow" of the mothod is being tested. Other test method names provide a bit more information by suffixing the nature of the test e.g. testSubmitApplicationWithInvalidCriteria. It better but not much better. A number of IDEs actually allow the developer to generate test method names based on the class under test which in my opinion defeats the object.

Unit test methods should be named in such as way that they provide a clear description of the test. In my opinion the prefix "test" is redundent and should never appear in your test method names unless it is part of the domain vocabulary. For example AppicationSubmittedWithInvalidCriteriaMustRaiseException* is more informative then testSubmitApplication. Providing a more descriptive name also serves to keep a clear focus on the flow under test and leads the devloper to create a test method per flow.

*Please Note that the example method name is a simplification. I would consider the term "InvalidCriteria" a bit too high-level for a real unit test. It should be more specific such as AppicationSubmittedWithNoSurnameMustRaiseException.