Wednesday, January 30, 2013

Strategy is Critical to IT Success

Why do we need a Strategy?
Many business and IT initiatives are a long term investments where we have changing markets and trends. These initiatives often take years to develop and require a lot of effort, resources, time and money.
We may have a very effective organisation with all the right processes in place and the right capabilities with all the skills, but all this will be in vain if we do not know where we are going or have a clear direction. 
This is why Strategy is extremely important as it provides Vision and Objectives which give direction for what the organisation is trying to achieve. This allows us to align our IT initiatives with the strategy so that we all develop in the same direction.

Effects of poorly defined strategy
 An organisation which has a poorly defined or communicated strategy may well find that projects or products are going off at tangents, which can lead to fragmentation or disjointed products. Another effect of a poorly defined strategy is that goals in the organisation or projects keep changing, this means that processes and projects need to be consistently re-aligned with the new goals and this can be an expensive. Goals which are changed frequently can also have an effect on the capability of the organisation as personnel become confused as to what the organisation is trying to achieve and ultimately motivation can begin to dip. 
The end result is that deadlines are missed and costs rise as the organisation battles to produce the deliverables which are aligned with frequently changing goals.

From an IT perspective this can also be evident if we see fragmented technologies or architectures within the organisation.

Working with the Strategy

Working with a strategy is difficult as we are often dealing with the long term and there are many unknown factors. An IT Strategy has to fit with other strategic aspects in the organisation, for example the overall strategy or mission of the company.

A good strategy will provide a guiding light and a "Vision" but it will also force us to make choices in order to provide focus.This is a delicate balance since a vague strategy may lack meaning while a rigid strategy will reduce flexibility. A good deal of work is required here to assess if the the strategy is feasible and that we can clearly describe the benefits and risks with the given strategy. While a strategy should be challenging, communicating an unrealistic strategy can result in a loss of faith  and motivation, no-one will want to follow a strategy which appears doomed to fail. So we have to ensure that the strategy is feasible for the organisation.

Assessing the risks associated with the strategy is very important. Since the strategy penetrates the whole organisation, getting it wrong can be costly so a good risk analysis is important. There are a number of risk analysis techniques which can be used such as SWOT analysis to help identify and mitigate risks.

To get a drive behind the strategy it is a good idea to back up the strategy with facts and reasons behind why we want to employ the strategy. Simply pushing out a strategic statement might not be enough to get your organisation actively behind the strategy, and if the organisation does not believe in the strategy it will be difficult to achieve the goals. In this area we might want to show trends in industry or show white papers or reports which support the strategy. We can also try to create an open discussion around the strategy to gain involvement from the organisation, this will make acceptance of the strategy much easier.

Since strategy in it's nature is long term it can be difficult for an organisation to envisage reaching a goal which is perhaps five years in the future. For this purpose it is good to have a reasonable strategic plan which shows milestones (or sub-goals) for the short term which in turn provide a pathway to the strategic goals. This plan is an effective way to communicate and measure progress towards the strategic goals.

In some cases a change of strategy may be pushed upon us due to circumstances we cannot control. This can mean large changes in the organisation such as changing business sectors or even existing technologies. This can have an adverse effect on an organisation where certain skills may no longer be a focus of the new organisation goals. This can lead to turbulence in the organisation as personnel may feel that their skills are are no longer relevant, so it is important to have a plan as to how the strategy is to be launched and communicated to reduce this effect.

Actively using the Strategy

Once the strategy is defined it can be used at all levels of the organisation to guide and provide governance. When working with product management this can help in defining requirements. We may find ourselves debating over which features or technologies to use in a product. If we reflect on the strategy it can help us to decide and prioritise, we can ask ourselves "Do these features or technologies help us reach our strategic goals?". If the answer is "no", we then have to ask ourselves why we want to employ them.

We can use the strategy in our project teams to motivate and guide. A clear idea of how the project fits into the strategy can focus the team, give a greater sense of contribution and increase motivation.

We should also be open to feedback as high levels of activity which is not aligned with the strategy can indicate a flawed strategy or a lack of capability to carry out the strategy.

Conclusion

Having a clear and well communicated strategy is essential for an IT Enterprise. It provides direction and focus for the organisation and provides an foundation for governing the Enterprise. A poorly defined strategy can result in an ad-hoc organisation where projects go off at tangents and this can affect both the motivation of personnel in the organisation and even the marketing of services and products.
The strategy can be used at all levels of the organisation to pull everyone together and strive towards the same goals, providing synergy between leading groups, departments and teams.




Wednesday, January 2, 2013

Tracking Performance in Java with Perf4J

Where are the Bottlenecks?

Performance is a critical aspect of any solution and pretty difficult to measure since we have to account for all the different load scenarios a system might meet in production. There are a good number of performance profiling tools which can help find bottlenecks in development, but what happens when the system is in the test or production environment and you need to check performance? We can't use the profiler in the production environment so we probably have to fall back on good old logging. Even in development and test environment performance logging may be quicker and simpler especially if you know what you are looking for. This is where we might use the Date class and the "getTime()" can solve this problem as shown below.



However this can become messy and difficult to track and re-use in many parts of your code. Therefore we are probably faced with creating a framework of classes to manage this function and to manage logging of the data. This is such a common test requirement in development I thought there must be a framework out there which already does this, but at the same time is simple to use. I was right, there is and it's called Perf4J.

Simple Performance Logging with Perf4J

Perf4J is a framework for performance logging  which comes packaged in a single JAR. It is simple to use and provides support for timing code sections and exporting the result to standard logging tools such as Log4J.
However it doesn't stop there. Perf4J supplies a number of features for helping you analyse the results of your performance logging. Support is provided for generating real-time performance information using an appender in Log4J. There is also support for generating graphs using the Google Chart API.
The advantage of using a standard framework like Perf4J is that we don't need to maintain the code and that it has a much larger user base than a "build your own" solution which means help is available from the community. Perf4J is licensed as open source under the "Apache License Version 2.0".

Logging Execution Times

The logging of execution times is based around using a StopWatch class which allows you to "start" and "stop" a timer for a section of code. The StopWatch can be setup to send this data to the log of of your choice. A nice feature here is that when you start the StopWatch you can give a "tag" which identifies the performance measurement and a "message" which can identify a particular section of the performance measurement. This is really useful if you are taking many measurements and want to organise these measurements so they are easily readable. This allows us to group our performance measurements together making the resulting log much easier to understand.

Below is an example of a simple JUnit test for logging two sections of code. In order for this example to work the "rta.test" logger has been configured in a log4j.xml file.


As can be seen from the code, the StopWatch is set up in the Log4JStopWatch  for compatibility with Log4J. We are then free to log times using our "tags" and "messages". The result of the above code is shown below.


Conclusion

Perf4J is a simple framework for performance logging. It allows you to easily take performance measurements and organise these measurements. If you want more advanced visualisation of the statistics there are features provided for this as well. Using this framework reduces the maintenance associated with "build your own" solution and a broader user base provides better support. In short a nice framework which makes you life a little easier when performance testing.