Thursday, February 25, 2010

Software Developer KPIs

Software developer KPIs need to be aligned with business objectives else they can be counter-productive. It is a challenge to develop KPIs for development teams and even harder to come up with KPIs for individual developers.

The purpose of governance in general, policy, objectives and KPIs, is to encourage desirable behaviour. KPIs, together with opportunities for formal and informal reward and recognition, will tend to reinforce the behaviours being measured, whether directly or indirectly.

KPIs should be used to guide professional development opportunities for individuals, not to punish them. For example, gaps in competency can be used to identify training opportunities.

We can come up with a number of metrics which gives us several candidates for KPIs:
  1. count lines of code written (kloc) – blunt measure of productivity
  2. reduction in kloc due to refactoring – fewer lines of code reduces support costs
  3. responsive to customers – meeting or exceeding SLAs
  4. the team meeting deadlines – improves predictability; opportunity to earn "early achievement bonuses"
  5. individual meets commitments – measure of professionalism; positive attitude
  6. count number of open, in-progress, resolved and closed issues
  7. leadership and initiative – difficult to measure but extremely valuable traits
  8. unit testing code – reduces number of defects
  9. integrating components, i.e. units of code – continuous integration identifies defects early
  10. conducting code inspections – reduces number of defects
  11. count number of defects found in code inspections – trend analysis
  12. stability of code base – fewer changes in libraries means fewer changes elsewhere and reflects increasing code maturity
  13. participating in design reviews – improves quality of code; measure of professionalism
  14. documenting software design and rationale, eg. notes in file or UML – improves knowledge capture; measure of professionalism
  15. applying design principles and patterns – improves quality of design and code
  16. capturing SMART requirements – reduces number of defects due to missing and misunderstood requirements
  17. writing test cases – verifies functionality, improves quality of code and reduces number of defects

References

Michael Bragen and Paul Michaels, Benchmarking software development projects: Three key KPIs, http://www.computerworlduk.com/toolbox/software–quality–testing/quality-assurance/opinion/index.cfm?articleid=1830 (Sept 2009).

Roger N. Dunn, KPIs for Agile Teams, http://www.agilejournal.com/content/view/786/33/ (Sept 2009).

Mike Mannion and Barry Keepence, SMART requirements, ACM SIGSOFT Software Engineering Notes, http://portal.acm.org/citation.cfm?id=224157 (Sept 2009).

Brett Miller, Key Performance Indicators of Application Developers, http://cspreston.wordpress.com/2009/06/16/application-development-performance-indicators/ (Sept 2009).

Karl E. Wiegers, Software Requirements, Second Edition, Microsoft Press; 2 Sub edition (March 2003).

Stephen Withers, Are key performance indicators a true measure?, http://www.builderau.com.au/strategy/businessmanagement/soa/Are-key-performance-indicators-a-true-measure-/0,339028271,339282324,00.htm (Sept 2009).

Wednesday, October 28, 2009

SOA Manifesto

The SOA Manifesto is a fanfare to architects everywhere, its Signatories like a triumphant procession heralding the pragmatic delivery of business value to enterprises via the provision of IT services.
Service orientation is a paradigm that frames what you do. Service-oriented architecture (SOA) is a type of architecture that results from applying service orientation. We have been applying service orientation to help organizations consistently deliver sustainable business value, with increased agility and cost effectiveness, in line with changing business needs. Through our work we have come to prioritize:
Business value over technical strategy
Strategic goals over project-specific benefits
Intrinsic interoperability over custom integration
Shared services over specific-purpose implementations
Flexibility over optimization
Evolutionary refinement over pursuit of initial perfection
That is, while we value the items on the right, we value the items on the left more.
It was a bit of a toss-up whether to write this blog here or under Innovation and Business since the impact of enterprise architecture is across both the business and IT segments of the enterprise - the very issue addressed by myself and several colleagues in Is EA a general business term, or an IT term and Is Enterprise Architecture a philosophy or an artefact?

However I want to reprise just my own comments from the latter discussion:
I reckon enterprise architecture is the outcome of practising enterprise architecture; like design is the outcome of, well, 'doing the design and constructing the pieces.' Enterprise architecture means either or both of 'enterprise business architecture' or 'enterprise IT architecture.' We usually leave off 'business' or 'IT' as implied but there is a non-subtle difference.

The business architecture is a constraint on the IT architecture whether or not it reflects as-is or to-be business strategy. The IT architecture, on the other hand, we can shape and mold, just as creative an exercise as it is methodical. Either way, our IT terminology and outcomes should/must match the expectations of business stakeholders, corporate and IT governance, strategy and objectives.

As an exercise, using TOGAF or Zachman, for example, adds structure ('constraints give us freedom') however the creation and evolution of enterprise architecture is necessarily ontological, that is, associated with the existence of entities and the relationships between them. The philosophy, architecture practice and implementation are inseparable facets of enterprise architecture reflecting the underlying nature of complex, emergent systems.
We must think carefully about what we are trying to achieve, about alignment of IT strategy with organisational strategy, culture, values and objectives. As architects, we must ensure the technical solutions we provide are cohesive in themselves as well as delivering business value.

The SOA Manifesto and associated Guiding Principles, when followed, should help us to deliver on this promise.

Saturday, September 26, 2009

Code generation and Godel's genie

Many of the advantages gained by generating executable code from models are matched by various problems. At any particular level of abstraction, analysis and requirements languages like UML, Z and OCL are wonderful for specifying, with varying levels of precision, the constraints for the next, more-detailed model.

Model-driven architecture and code generation involve executing a series of transformations which use as input the higher level of abstraction to produce the more detailed architecture layer as output. The usual practice is to elaborate additional details of implementation in the more-detailed layer: The logical layer is used to generate the physical layer; the platform-independent model is used to generate the platform-specific model.

The problem with generating executable code is that the model language has been morphed into an implementation meta-language. When there is no room for elaboration because the model contains all the necessary details then the model is itself the implementation. The problem of verification has to be generalised from using the model to verify the implementation to one of verifying the model itself.

Godel's incompleteness theorem essentially says, in this context, that in-principle we cannot verify the model or its elaborated implementation. Hofstadter might say the meta-genie has been let out of the bottle. We verify models by inspection, consistency checking and theorem proving, when possible; likewise we verify implementations by inspection and the closest thing we have to theorem proving, i.e. testing.

The key assumption of testing is that we can verify the implementation against a subset of test vectors representing equivalence sets across the input domain. The key for code generation is that the set of valid assumptions embodied in the model is retained by an isomorphic transformation from the model into the implementation. Model consistency checking does not help if the model is inconsistent or any of its assumptions have been invalidated by the process of elaboration.

Wednesday, July 01, 2009

Agile Adoption: How to stuff it up

ThoughtWorks ran a thoroughly enjoyable and rather informative pair of sessions cheekily titled Agile Adoption: How to stuff it up in Perth on Tuesday 30 June 2009. My hearty thanks go out to Karin Verloop for the invitation to attend the Quarterly Technology Briefing over a light breakfast at The Parmelia Hilton, and the Executive Round table Luncheon at The Globe.

Martin Fowler, Chief Scientist at ThoughtWorks and one of the original signatories of the Agile Manifesto, was unable to attend but Andy Marks, who specialises in enterprise-level adoption of Lean and Agile concepts, ably led the earlier discussion and along with Keith Dodds, Director of Sales & Marketing, facilitated discussion over the round table luncheon.

The Quarterly Technology Briefing was introduced by Karin Verloop and handed off to Andy Marks, who said he has been looking after the largest agile adoption in Suncorp. The Agile Manifesto states the common ground of lightweight approaches, eg. Scrum and XP. The notable software craftsmen who drafted the manifesto in 2001 at the Utah meeting decided to call it 'Agile' instead of the other possibilities mooted because they felt the word closely reflected their approach.
"It is not necessary to change. Survival is optional." said W. Edward Deming, the original thought leader in continuous quality improvement.
There are about six root cause issues to cover in this session. ASWEC 2009 on the Gold Coast recognised that "Agile is the new mainstream."

Andy credited Mike Cohen with the common adoption patterns for Agile:
  1. Scale - from start small to all-in.
  2. Interest focus - from teaching practices to iterations.
  3. Visibility - from stealth mode to public display.
Not addressed was the trivial pilot anti-pattern. It's best to start with a high risk, high value of success to engage the business.

Here's a basic recipe for stuffing it up:
  • Underestimate the change.
  • Assume minimal cultural impact.
  • Undervalue experience.
  • Learning finishes at school.
  • Let others fail first.
  • De-emphasise technical design.
The people will break first. Small group comes to realisation that agile works or is worth looking into; by executive decree - why are we doing this? User story is statement of customer requirement, ideally can be implemented in 1-2 days; binary status reporting 0/100% completed.

As opposed to projects reporting green, green, green,... then red one month before delivery - 6 months late; instead early indication, eg. green, green, amber, red... needs a cultural change.
"He who rejects change is the architect of decay," Harold Wilson.
On organisational culture: "It is very evident that all culture has developed as an initial reaction against adaptation, " Beatrice Winkle. [Can someone help me with this literary allusion?]
IT is tailor made to embrace change, especially software developers who can be [ahem] obsessive compulsive (OCD) and show signs of attention deficit disorder (ADD). Making new connections, changing existing connections, 'lusting after change' - you want these people in you team with Agile adoption.

Standup meeting - what I did yesterday, what I am doing today, any blockers. Co-located team, customer embedded, tolerance for failure.
"Failure is the opportunity to begin again more intelligently," Moshe Arens.
Often rewarded publicly for 'success' - Herculean efforts, 'by hell or high water'; other projects ('failures?') which have taken risks, lessons are not advertised.

The inspirational ravine of effectiveness-versus-time has a dip as a team moves through learning, change, transition. It is guaranteed to kill adoption if you stomp on people in the ravine.

Outliers by Malcolm Gladwell speaks of the conditions to achieve high level performance - his studies show 10,000h to achieve high-level aptitude, or about 5y at 8h/day. (Note that a journey man plumber, not master, is achieved after 5y.)
"Experience is the name every one gives to their mistakes, " Oscar Wilde.
It is a mistake to de-emphasise technical design. The Manifesto implies paying continuous attention to technical excellence and good design enhances agility. [I myself speak of a culture of quality and merciless refactoring.]

The best architectures emerge from Agile design. Don't over-invest in design ('big upfront design'); however the pendulum may swing too far the other way.

Customer focus is important because the impact of technical debt is that the entire organisation, says Kent Beck, can be brought to a standstill under the debt load of unconsolidated implementation. Debt load is lack of technical quality, i.e. refactoring, patterns.

The next step:
  • Conduct readiness review.
  • Get experience.
  • Plan in Agile way.
  • Identify a quick win.
  • Budget to include learning.
  • Publicly reward effort to improve and acknowledge lessons learned.
The discussion at the Executive Roundtable Luncheon was interesting and stimulating. As a marketing tools, Agile is clearly finding its way into the hearts and minds of practitioners and IT leaders alike however there seems to a concomitant forgetfulness of supporting principles and practices.

In particular, the role of project managers and the governance structures provided by approaches like Prince2, PMBOK and CMMI go largely unremarked, except for a lingering negativity towards such approaches.

[Chatham House Rule applies to the following recollections.]

Surprisingly to me, the organisation with the highest statutory compliance obligation and hence a satisfactory management system was the least inclined towards a traditional project management approach.

To some extent I think their position is a misunderstanding about the purpose of documentation and the intent of the expression in the Agile Manifesto to value, "Working software over comprehensive documentation." The purpose of documentation is knowledge capture and sharing, and they should be so lucky to have it!

The issue of testing in an Agile environment was raised. Like most things Agile, even formal testing using the traditional techniques fits the description. Test specifications can almost entirely replace user and functional requirements because that is precisely what is evaluated during user acceptance, functional and system testing.

Inadequate testing will deliver a fragile product into production every time. Worse still, it will be very difficult to run regression tests, both manual and automated, in order to identify new defects.

Requirements management was the crux of another question: Are changes to requirements assessed and approved by the business first? This is a tricky one because in an Agile approach, a customer representative is supposed to be available and one of the problems is that often they are not empowered to make decisions, or lack the specialist knowledge of a subject matter expert.

Of course, this is the reason for functional requirements but I agree that a user story, written from scratch or enveloping one or few cohesive requirements, can be given to a developer in an Agile team to take 1-2 days.

The Agile business analyst has a similar role to the traditional business analyst and that is to interpret the customer requirements and to act as the customer proxy to the development team. It is not so Agile to interpose someone between the customer and the developer but for complex requirements this is fairly necessary. It was also noted that user stories could be expanded into proper use cases.

Business rules came up for discussion as well and how they can be captured: in user stories? For simple or few rules this may be fine but otherwise it is begging for disaster to scatter business rules across informal user stories and throughout the code base. A little bit of abstraction may be called for using design patterns, eg. policy or delegate, or use a full-blown business rules engine - an architectural decision. The cost of rework can be high unless this decision is made upfront.

Agile in the context of enterprise software development was discussed, involving the integration of legacy and commercial-off-the-shelf (COTS) software and systems. Interface contracts between systems, common messaging formats, architecture of enterprise service bus (ESB) are design elements usually associated with big upfront design (BUFD) but are the only things that matter when developing distributed systems.

It was noted that stubs and mock objects enable the creation of unit tests before launching into full-on integration testing.

Does Agile apply to COTS only development? Yes was the answer, mainly to do with requirements gathering - well, maybe but I'm not sure. The business requirements and scope should be the same regardless of software approach because a project can only be initiated once a problem or gap has been identified by the business.

(The detailed functional requirements, use cases or user stories, in general, are allowed to be a moving target - part of the reason is that many 'discovered requirements' are unknown at the outset.)

It makes a lot of sense to write the evaluation criteria as a test specification so that each function can be ticked-off and compared during the evaluation phase. Then, in place of a traditional software construction there will be several iterations of 'construction by configuration' where the user stories are met at each closure.

Hire these guys if you want to learn to do software development well. The people at ThoughtWorks really know what they are doing and if the marketing hype about Agile gets you down just ignore it.

The values behind the Agile Manifesto are the key to their approach which I would happily classify as Agile-Lean because unnecessary processes and requirements are discarded by applying common sense to software development.

Tuesday, March 03, 2009

Future trends in software engineering

About a year after the panel convened at ASWEC 2008, my words on future trends in software engineering are still pertinent to ongoing work I am undertaking in software engineering and service-oriented architecture.

Model-driven architecture (MDA)
  • not old-style computer-aided software engineering (CASE), i.e. discredited round-trip engineering
  • capture different levels of abstraction; elaborating lower-levels, constrained by higher-levels
Software factories
  • component-based libraries and frameworks
  • meta-object facility (MOF) for store and registry of component meta-data
  • dependency-injection, eg. Spring factory
  • mocks objects to complement, not replace, unit and integration testing using fixtures
Service-oriented architecture (SOA)
  • continuing growth and refinement of ontology-based software engineering
  • return to not-quite components, i.e. facade for service interfaces that are explicit
  • growth of resource description framework (RDF), web ontology language (OWL) - semantic-description languages and extensions (hard problem!)
  • realisation that C++, Java, C#, perl, python, yacc/bison (of course) incorporate support for domain-specific languages (DSLs) by extension, genericity and composition
  • convergence of object-oriented analysis and design with design and enterprise patterns
  • combine patterns and domain ontology to give DSL independent of technology and platforms - "form follows function"
Non-trivial systems
  • software and systems engineering merge into concrete discipline
  • integration architecture, distributed and real-time computing are increasingly seen as facets of same problem
  • enterprise security, single sign on, unified data views, portals - service and system mashups at user and data levels
  • two-level development: 1) service and business levels based on business/logical processes and composite services; 2) implementations that conform to service and interface contracts can be in any technology, i.e. custom software, commercial-off-the-shelf (COTS) or free and open source software (FOSS)
  • well-defined registry interface - "think global over enterprise, act local" every system and application adheres to enterprise guidelines
  • configurable and adaptable - constrained flexibility due to absolute need to confidently test known configurations
Cross discipline
  • computer science and software engineering, psychology, management
  • unified analysis, richer toolkit of analytics and heuristics
  • mature processes, peer review and accreditation

Saturday, October 11, 2008

Messaging Completes a Full Circle

"riverrun, past Eve and Adam's, from swerve of shore to bend of bay, brings us by a commodius vicus of recirculation back to Howth Castle and Environs." James Joyce, Finnegans Wake
In the beginning there was RPC or Remote Procedure Call, later mostly standardised as Distributed Computing Environment or DCE-RPC and reappearing as Microsoft's MSRPC. XDR is a protocol for the description and encoding of data and is useful for transferring data between different computer architectures - roughly analogous in purpose to Abstract Syntax Notation (ASN). Often used for C programming but with bindings to numerous languages on many platforms.

Time passed and Corba or Common Object Request Broker Architecture appeared, less well known in modern incarnations as the most-widely deployed interoperability standard, IIOP (Internet Inter Orb Protocol), also underlying RMI-IIOP and EJB-IIOP in the Java stable, and deployed with every web browser, most mobile phones and other devices. Corba and IDL (Interface Definition Language) allows many languages and platforms to interoperate transparently using objects often written in C++, Java or C# but possibly in almost any language. Regular claims that Corba is dead are premature and show ignorance or denial of reality.

Various message queuing technologies soon appeared on the computing horizon to start the trend towards loosely-coupled systems. IBM MQ Series, more recently called WebSphere MQ, Microsoft Message Queue (MSMQ) and Java Messaging Service (JMS) offer interoperability options that may cross platforms depending upon vendor support. WebSphere MQ is offered by IBM at a fee on virtually every platform imaginable; MSMQ is a Microsoft-centric technology; and JMS is a community-defined standard with many cross-platform implementations.

Bringing us to recent times where the buzz word for loosely-coupled systems is SOA or Service Oriented Architecture, often built upon web services. Over the past few years, the WS-standard stack or web service protocols, including WSDL (web service definition), SOAP (message protocol) and UDDI (discovery) that leverage XML, have appeared. Unsurprisingly they closely mirror the Corba stack, using XSD (XML schema definitions) as the new IDL.

Web services define function interfaces like RPC XDR, not object interfaces like Corba IDL, so have we just completed a full circle and returned back to where we started?

XML compared to IDL, XML first:
<message name="SayHelloRequest">
<part name="firstName" type="xsd:string"/>
</message>

<message name="SayHelloResponse">
<part name="greeting" type="xsd:string"/>
</message>

<porttype name="Hello_PortType">
<operation name="sayHello"/>
<input message="SayHelloRequest"/>
<output message="SayHelloResponse"/>
</porttype>
Now IDL:
struct SayHelloRequest {
string firstName;
};

struct SayHelloResponse {
string greeting;
};

program Hello_Server {
version Hello_Version {
SayHelloResponse sayHello(SayHelloRequest) = 1;
} = 1;
} = 0x20000001;
Part of the answer is that SOA or Service-Oriented Architecture is one characterised by:
  • Loosely coupled services.
  • Platform-agnostic interfaces.
  • Dynamic discovery and invocation.
SOA is an approach to system integration centred around business processes.

Another part of the puzzle is found in BPM or Business Process Management, which embodies:
  • The concept of choreographing work items through a multi-step process or orchestration.
  • The work items are identified and tracked as they move through each step, with either specified people or applications processing the information.
  • The process flow is determined by choreography with the applications themselves playing no role in determining where the messages are sent.
MDA or Model Driven Architecture, as defined by the OMG or Object Management Group, fills in the technological process of managing the transition between the artifacts generated by the business and those used by IT:


Zachman's framework for enterprise architecture is the final piece of the puzzle for slotting it all together:


So there you have it, we have finally gained the hard-won knowledge accumulated through experience that the business should drive IT systems development (fancy that) and that models have greater and longer-lasting value than technology implementations (who would have guessed).
Now quieten down and listen to me, messaging was actually a dead end and the next big thing in enterprise integration and software development is...

Sunday, June 01, 2008

Recipe for Getting and Staying Ahead in CSSE

I am a bit embarrassed about not posting here for so long however the reason is that I have been busy with ASWEC 2008. A while ago, I was honoured to be invited to present a seminar in CSSE at UWA, as follows: