Showing posts with label Wikipedia. Show all posts
Showing posts with label Wikipedia. Show all posts

Monday, July 21, 2008

Laws of Software Development

I ran across an new eponymous law while reading "Understanding Enterprise SOA" by Eric Pulier and Hugh Taylor.
Pulier's rule of reuse:

A programmer will look at another programmer's output, no matter how brilliant and declare it garbage

The best law's and rules are named by others who admire the author's work, but this one seemed pretty worthy to me. This got me reminiscing about some laws of software development that perhaps had the same rigour as Newton's Laws, Boyle's Law or Hooke's Law.

The rules I have admired during my career are:

Brooks's Law:

adding manpower to a late software project makes it later

Hofstadter's Law:

It always takes longer than you expect, even when you take Hofstadter's Law into account.

Codd's Rules of relational database management systems which I won't quote here because there are 13 of them.

Moore's Law:

The number of transistors that can be inexpensively placed on an integrated circuit is increasing exponentially, doubling approximately every two years.

This has a number of applications outside of transistors such as processing speed, memory and disk capacity.

Clarke's 3rd Law:

Any sufficiently advanced technology is indistinguishable from magic.

The reason I class this as a software development Law is that it points out the futility of trying to explain the technical details of software to Business users. If a technical decision does not have any business impact then it may as well be magic.

I thought I would check what other software development Laws there are on the net. Here is a good sample from some useful sources listed in the Bibliography below:

Amdahl’s Law

The speedup gained from running a program on a parallel computer is greatly limited by the fraction of that program that can’t be parallelized.

Asimov's laws (Yes its SF but one day a software developer might have to follow them):

  1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
  2. A robot must obey orders given to it by human beings, except where such orders would conflict with the First Law.
  3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.

Atwood’s Law:

Any application that can be written in JavaScript, will eventually be written in JavaScript

Bye's First Law of Model Railroading

Anytime you wish to demonstrate something, the number of faults is proportional to the number of viewers.

Clarke's 1st Law:

When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.

Clarke's 2nd Law:

The only way of discovering the limits of the possible is to venture a little way past them into the impossible.

Clarke's 4th Law (He's not often credited with this one):

For every expert there is an equal and opposite expert.

Conway's Law:

Any piece of software reflects the organizational structure that produced it.

Edwards' law

You cannot apply a technological solution to a sociological problem.

Greenspun's Tenth Rule of Programming (There actually are no rules 1 to 9)

Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp

This can also be worded “Those who do not understand Lisp are doomed to reinvent it.”

Gustafson's Law (also known as Gustafson-Barsis' law)

Any sufficiently large problem can be efficiently parallelized

Kerckhoffs' law on secure cryptography

A cryptosystem should be secure even if everything about the system, except the key, is public knowledge

Lehmann's Laws

  1. Systems that are used must change or automatically become less useful
  2. Through changes the structure of a system becomes ever more complex and more resources are needed to simplify it

Linus's law — named for Linus Torvalds,

given enough eyeballs, all bugs are shallow

Lubarsky's law of Cybernetic Entomology:

There is always one more bug.

McLuhan's Law:

If it works it's obsolete.

Metcalfe's law

In communications and network theory, states that the value of a system grows as approximately the square of the number of users of the system.

Murphy's Law

If anything can go wrong, it will.

Occam's Razor:
There are many wordings for Occam's razor and debate about how it is interpreted but from software development I think the best wording is "The simplest solution is usually the best". This is very nearly the same as the KISS principal "Keep it simple stupid".

Putt’s Law:

Technology is dominated by two types of people: those who understand what they do not manage, and those who manage what they do not understand.

Sturgeon's Revelation (sometimes referred to as his second law):

Ninety percent of everything is crap

Weinberg’s Law:

If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.

Wirth's law

Software gets slower faster than hardware gets faster.

Zawinski's law

Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.

Here are still more great laws from Joey DeVilla's Blog posting.

The LawWho Said ItWhat it Says
Ellison’s Law of Cryptography and Usability
Carl Ellison
The user base for strong cryptography declines by half with every additional keystroke or mouse click required to make it work.
Ellison’s Law of Data
Larry Ellison

Once the business data have been centralized and integrated, the value of the database is greater than the sum of the preexisting parts.
Flon’s Axiom
Lawrence Flon
There does not now, nor will there ever, exist a programming language in which it is the least bit hard to write bad programs.
Gilder’s Law
George Gilder
Bandwidth grows at least three times faster than computer power.
Grosch’s Law
Herb Grosch
The cost of computing systems increases as the square root of the computational power of the systems.
Hartree’s Law
Douglas Hartree

Whatever the state of a project, the time a project-leader will estimate for completion is constant.
Heisenbug Uncertainty Principle (restated)
Jim Gray
Most production software bugs are soft: they go away when you look at them.
Hoare’s Law of Large Programs
C. A. R. Hoare

Inside every large problem is a small problem struggling to get out.
Jakob’s Law of the Internet User Experience
Jakob Nielsen

Users spend most of their time on other sites. This means that users prefer your site to work the same way as all the other sites they already know.
Joy’s Law
Bill Joy

smart(employees) = log(employees), or “No matter who you are, most of the smartest people work for someone else.”
Lister’s Law
Timothy Lister

People under time pressure don’t think faster.
Nathan’s First LawNathan MyhrvoldSoftware is a gas; it expands to fill its container.
Ninety-ninety Law
Tom Cargill
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
Pesticide Paradox
Bruce Beizer
Every method you use to prevent or find bugs leaves a residue of subtler bugs against which those methods are ineffectual.
Reed’s LawDavid P. ReedThe utility of large networks, particularly social networks, scales exponentially with the size of the network.
Sixty-sixty Rule
Robert Glass

Sixty percent of software’s dollar is spent on maintenance, and sixty percent of that maintenance is enhancement.
Spector’s Law
Lincoln Spector

The time it takes your favorite application to complete a given task doubles with each new revision.
Spafford’s Adoption RuleGeorge Spafford
For just about any technology, be it an operating system, application or network, when a sufficient level of adoption is reached, that technology then becomes a threat vector.

Some unattributed "laws" that are worth mentioning:

  • Build a system that even a fool can use, and only a fool would want to use it.
  • Any program over 100 instructions can be simplified by 3 instructions (without losing any functionality).
  • Any idiot can learn to use computers, and many do
  • There’s never time to do it right in the first place, but there’s always time to do it over when it doesn’t work.

This posting started with Pulier's Law: "A programmer will look at another programmer's output, no matter how brilliant and declare it garbage". At the risk of repeating Pulier's conceit of naming law about himself I propose:
Kimber's Corollary:

No amount of documentation is ever sufficient to completely understand a system

Bibliography
http://en.wikipedia.org/wiki/Adages_named_after_people

"Moore's Law is Dead", http://www.techworld.com/opsys/news/index.cfm?newsid=3477

http://en.wikipedia.org/wiki/Change_management_(engineering), This includes the reference to Lehmann's Laws siting Hinley, D.S. (1996). Software evolution management: a process-oriented perspective. Information and Software Technology, 38, 723-730

http://en.wikipedia.org/wiki/Moore

http://en.wikipedia.org/wiki/Occam

http://www.webopedia.com/TERM/C/Codds_Rules.html

Joey de Villa, http://globalnerdy.com/2007/07/18/laws-of-software-development/

Phil Haack, 19 Eponymous Laws Of Software Development, http://haacked.com/archive/2007/07/17/the-eponymous-laws-of-software-development.aspx

Eric Pulier and Hugh Taylor, "Understanding Enterprise SOA", Manning Publications, 2006

Monday, March 10, 2008

SOA in a Virtual World

Wikipedia defines a virtual world as a computer-based simulated environment intended for its users to inhabit it. Often a computer application is a business process made virtual by the use of computer technology. We therefore have to be careful when discussing the virtualization of computer environments as this may imply a virtual virtual reality.

The only example of virtual virtual reality I have seen is in a Futurama episode. It displayed an arcade booth with the label 'Virtual Reality' complete with a player using stereoscopic goggles and wired gloves. It then displayed another arcade booth with man sitting in a simple chair imaging he was wearing stereoscopic goggles and wired gloves. The caption to this booth was "Virtual Virtual Reality".

If we talk about "Virtual SOA" we must be talking about something that is not an SOA at all. Judith Hurwitz comes close to this when she discusses a "Virtualized SOA" in her article "Is virtualization the foundation of SOA?"

Andrew Doble writes about building a virtual SOA without investing in in-house software like an ESB. I would argue that this is in fact legitimate SOA. The only thing "virtual" about Andrew's suggestion is the ownership of the software tools.

Virtualization and SOA however do go together. Judith Hurwitz defines Virtualization as


"a technique for abstracting the physical characteristics of computing resources
in order to more easily leverage hardware systems, applications, operating
systems, networks, graphics, data or storage so they can be repurposed based on
customer need."


I believe that loose-coupling is the foundation of SOA but virtualization in many cases allows the benefits from this loose-coupling to be realised. The basic examples of virtualization are virtual servers, storage area networks and thin client platforms such as Citrix. These provide infrastructure flexibility for the deployment of SOA software. The design of the software for an application written using SOA is not affected. The SOA discipline should make sure that flexible deployment options can be used.

Manufacturers such as IBM are building business around SOA infrastructure. One thing to remember is that you do not need virtualization to build SOA. An SOA application can be built on a single server if you required, although it should also give you the flexibility to distribute this application and take advantage of virtualization options.

I agree with Lorraine Lawson in her posting "SOA and Virtualization: Complex, Fuzzy Ideas That Go Great Together? ". These two concepts mix well. However SOA is from the software development world and virtualisation is from the infrastructure world. We should beware of talking in terms of virtualizing our SOA. Our CIOs may consider we are sitting in a corner thinking we have an SOA when this is just a virtual reality.


Fry from "Futurama" with a virtual Lucy Liu.
© 2001 Twentieth Century Fox. All Rights Reserved

Thursday, November 22, 2007

Subroutine Call Coupling

It has been more than a month since I did my last posting on coupling. Amazon has delivered my book on loose coupling by Doug Kaye and I am finding it valuable. Once I have finished that I hope to revise my original list of types of coupling.

In this posting I would like to say something about subroutine call semantics versus message passing and the coupling associated with this. I have discussed before that the synchronous approach which is a requirement of the subroutine call semantics is more tightly coupled than an asynchronous approach. There are two other differences between subroutine calling and message passing. These are

  • the management of state of the calling module and the called module; and
  • the management of the called instance itself.
When you invoke a subroutine it starts executing from its beginning. The invoked routine will usually have no state and complete before the invoking routine resumes again. Another form of routine call is the coroutine where the state in the called module is maintained from one call to another. The issue of state coupling was covered in my earlier posting and labelled as 'Process State Coupling'. This type coupling is intended to cover coroutine behaviour. A coroutine is even more tightly coupled than a normal subroutine call because of the dependency on state.

In a normal subroutine call state is not preserved in the called module from one call to the next however state is preserved in the calling module. It preserves its state by the simple expedient of suspending execution until the called module returns control.

Asynchronous message can still involve process state coupling. More loosely coupled messaging has enough information in the message to process without retaining state. This is, in general, better practice but is not always practical.

There is one other aspect of subroutine call behaviour that is different from message passing behaviour. When a subroutine is invoked it is in effect brought to life at that point. If you have to create an instance of a service in order to use it then this is another form of dependency. A service should be an entity that always "exists" that is ready to serve. In effect messages can wake up receiving services but it should not be the concern of the sending service to create or dispose of an instance of the service. I therefore intend to add 'Creation Coupling' to the coupling list when I next publish one. Creation coupling occurs in Java classes when a new object is created using the 'New' statement. Methods of that object are then called but the creation of new object (and sometimes its destruction) is often the role of the calling object.

It is the system's responsibility to effect and manage the invocation of the service, not that of the calling application. This allows two critical characteristics to be realized: 1) The services are truly independent, and 2) they can be managed. (Anagol-Subbarao)
In the paper "Web Servces Are Not Distributed Objects" by Werner Vogels he draws this distinction clearly. Loosely coupled web services do not have the same behaviour as objects.

An important notion at the core of distributed object technology is the object life cycle:
· Upon request, a factory instantiates the objects.
· The consumer who requested the instantiation performs various operations on the object instance.
· Sometime later, either the consumer releases the instance or the runtime system garbage-collects it.
It is this point that Werner distinguishes between services and objects and is also this point that makes distributed objects more tightly coupled than web services that are coupled using messages.

In this posting we have discussed subroutine semantics and discovered that subroutine a tightly coupled to their calling modules because of:
  • Synchronous Coupling
  • Process State Couping, and
  • Creation Coupling

The use of asynchronous messages is much more loosely coupled as a result.

References:
Anagol-Subbarao, Anjali, J2EE Web Services on BEA WebLogic, Prentice Hall, October, 2004

Vogels, Werner, "Web Services are not Distributed Objects: Common Misconceptions about Service Oriented Architectures" , IEEE Internet Computing, vol. 7, no. 6, pp. 59–66, 2003

This is also available from Werner's blog site at
http://www.allthingsdistributed.com/historical/archives/000343.html

Marlin, Christopher D. Coroutines, Lecture notes in computer science, vol. 95, Springer-Verlag, Berlin, Heidelberg, 1980. ISBN 3 540 10256 6 and ISBN 0 387 10256 6.

Kaye, Doug, Loosely Coupled: The Missing Pieces of Web Services; RDS Press 2003, ISBN 1881378241

Friday, September 21, 2007

AOP: The worst form of Coupling

I have just had the need to look at Aspect-Oriented Programming. The Wikipedia entry on this is very good and covers the benefits and risk well. The following provides a good summary of what AOP is all about:


…an aspect can alter the behavior of the base code (the non-aspect part of a program) by applying advice (additional behavior) at various join points (points in a program) specified in a quantification or query called a pointcut (that detects whether a given join point matches).
This offends my sense of what is good modularized code. AOP is done under the banner of "Separation of Concerns" but instead of separating parts of programming code in simple and visible ways, AOP is coupling it tightly. AOP is coupling code modules in ways a programmer would not expect from viewing the affected code. This is tight coupling of the worst kind. In my earlier posting on coupling I rated types of coupling from 0 to 14 from loosest to tightest. I will call this type coupling "code coupling" and give it 15, the tightest coupling index of all. The coupling is through the code rather than through data passed to the module. Code coupling is not new but I did not expect it to come up as modern programming paradigm.

Another form of code coupling is "inclusion coupling" which is explained well by Milind Shingade

Inclusion coupling is a form of coupling in which one component includes source code of another component. If the included component changes something on which includer depends or adds something that raises the conflict with something in the includer then the includer must change.
I see inclusion coupling as more benign than using AOP but I will still roll it into my "code coupling" category.

Control Coupling (coupling index 12) is pretty tight. This is where you pass a Boolean or control parameter to a procedure and have code in that procedure which checks the value and executes different logic based on that control parameter. This is one way of affecting the executed logic in the procedure but at least you can read the code and have some expectation of what the behaviour is going to be. With AOP an unsuspecting maintenance programmer may not have any idea that the program code is being affected by an "aspect".

Unfortunately I have to grant there may be a place for AOP. Code for auditing, logging, exception handling, security and range of routine work that needs to happen along with the business logic can make it difficult to discern the main thrust of what program code is trying to achieve. There is a big need for control and proper governance of AOP. If it has to be used then only senior developers should implement the Aspects. It only should be used in very limited circumstances. Ideally there should be clear documentation in program modules affected by an Aspect.

This should not be a pervasive programming paradigm. The programming should not be Aspect Oriented at all. Code should normal, good Object Oriented code but if AOP is supported a developer may introduce one or two Aspects to influence this code.

In summary I think AOP may be a horrible necessity in some programs and should be used with extreme caution. AOP has given me another type of coupling to add to my list. I had expected the next entry to my coupling list to be in the looser coupling range. I recently listened to a Podcast from Jim Webber of ThoughtWorks. Jim claims that MEST uses looser coupling than WSDL. I would like to see that. I am hoping to blog on this soon.

Friday, September 7, 2007

A Review of the SOA Practitioners Guide

The SOA Practitioners Guide is a thorough 3 part document covering all aspects of SOA. Much of what is discussed in this guide is not specific to SOA but a more general advocacy of best practices in IT development. Thus the Guide looks a development methodologies, portal technologies, support infrastructure, project planning and a number of aspect that are not pre-requisites to having SOA in place but support the establishment of successful SOA.

The three parts of the Guide are:
· "Why Services Oriented Architecture?"
· "SOA Reference Architecture"
· "Introduction to Service Lifecycle"

The first part was more a summary of what was to covered in the second two parts than a justification of SOA. I have read better and clearer justifications of SOA.

The Reference Architecture part is well presented and goes methodically through the layers explaining the various architecture options available. I am interested how different authors divide up an SOA. In the Guide the layers are:
· Web Application Tier
· Service Tier
· SOS Frameworks
· Application Tier
· Enterprise Security
· Business Service Management
· Services Oriented Infrastructure

Often when I read marketing literature or documents on IT tools I get the impression that these documents are written for global multinational organisation with huge IT budgets and hordes of technical people. This is one of those times. The array of tools a good SOA shop needs and the array of technologies an IT organisation is expected to master is mind-boggling. It is amazing that a medium sized enterprise gets any software development done at all. Occasionally I would like to see advice for small and medium organisations.

The third part of the Guide covers a number of design and development issues. It goes through the Software Development Lifecycle and looks at how SOA impacts on each stage. There is still a strong emphasis on tooling and technologies in this part. In this section there is an emphasis on Service Component Architecture (SCA). This is a fairly recent standard for bundling up services into components. According to Wikipedia version 1 of this standard was released in March 2007. I found a good summary of SCA was "Introducing SCA" by David Chappell.

The Guide is presented with a number of good examples, many dot-point lists and a huge number of references to other technologies and tools. A glossary of acronyms would have helped.

Writers on SOA seem to divided between those that focus on Web Services and those that embrace the diversity of different ways of doing SOA. The Guide authors (ten of them) are from the latter category. A number of alternate technologies and supporting technologies are discussed.

In conclusion I can recommend the SOA Practitioners Guide to anyone wanting to get a wide-ranging survey of current practice in SOA and software development.

Reference:

Durvasula et al., SOA Practitioners Guide, Sept 2006, http://colab.cim3.net/file/work/SOACoP/2007_05_0102/SOAPGuide/

Chappell, David, Introducing SCA, July 2007
http://www.davidchappell.com/articles/white_papers.html

Saturday, September 1, 2007

SOA is not About Integration

I am reading "SOA Practitioners Guide" which is authored by a group of ten SOA Practitioners including Surekha Durvasula. This is available on the internet from
http://colab.cim3.net/file/work/SOACoP/2007_05_0102/SOAPGuide/.

I was interested in quote in the executive summary

"Traditionally, IT works with the business owners, who are influenced by application vendors. This results in IT strategies that are application or integration-focused." (Durvasula et al Pt1, p.6)
What this implies is that SOA is not integration-focused. This is an important point. In early days of a company's SOA maturity the impetus behind using Web Services or some other service technology may be to integrate applications. This is not an architectural approach. SOA is not a glue to stick applications together in an ad hoc fashion. It is an architecture in which a portfolio of applications can be built. To focus on the integration is tantamount to focusing on the siloed applications.

A quote from Erl (Ch 3.2)

Contemporary SOA supports, fosters, or promotes:
· vendor diversity
· intrinsic interoperability
· discoverability
· federation
· inherent reusability
· extensibility
· service-oriented business modeling
· layers of abstraction
· enterprise-wide loose coupling
· organizational agility
Integration does not get a Guernsey here. This is consistent with most benefits reported for SOA. Agility and Reuse are the big catch-cries.

What about 'interoperability' though? Is that just 'integration' in another guise? According to Wikepedia

The IEEE defines interoperability as …the ability of two or more systems or components to exchange information and to use the information that has been exchanged.
This sounds awfully like integration to me, but fortunately the issue is clarified a little later in the Wikepedia entry.
According to ISO/IEC 2382-01, Information Technology Vocabulary, Fundamental Terms, interoperability is defined as follows: "The capability to communicate, execute programs, or transfer data among various functional units in a manner that requires the user to have little or no knowledge of the unique characteristics of those units".
James Snell (2001) puts this in web services terms

The fundamental goal of interoperability in Web services is to blur the lines between the various development environments used to implement services so that developers using those services don't have to think about which programming language or operating system the services are hosted on.

While integration is about passing information from one system to another, interoperability is getting services operating together despite being built in different ways. We do not integrate services, they interoperate as parts of a system. In what Erl calls contemporary SOA (which is based on Web Services) the services are intrinsically interoperable. This means services interoperate because they are part of the SOA not because we have built these services specifically to be interoperable.

I have purposely drifted from talking about integration to interoperability. I am presenting at a conference shortly and I wanted to explore a nagging feeling I had that the title of the conference "Achieving Interoperability in Systems Architecture" might somehow be antithetical to SOA. The original name of the conference was going to be "Capitalisng on Service Oriented Architecture".

I conclude that achieving interoperability is a valid aim for an enterprise architecture to have. This should be intrinsic interoperability and not ad hoc interoperability. Similarly ad hoc integration is not the aim of an SOA. The only objection I might have to the conference title is that it narrows the focus somewhat. This will not affect my presentation significantly.


References

Ark Group, Conference, Achieving Interoperability in Systems Architecture, http://www.ark-group.com/home/xq/asp/eventid.0CD5BD30-31D1-4E2E-AD40-50D4178087F5/qx/events/event.htm

Durvasula et al., SOA Practitioners Guide, http://colab.cim3.net/file/work/SOACoP/2007_05_0102/SOAPGuide/

Erl, Thomas, Service-Oriented Architecture: Concepts, Technology, and Design, 2005 Prentice Hall

Snell, James, Web Services Interoperability
http://www.xml.com/pub/a/2002/01/30/soap.html, January 30, 2002

Wikepdia on Interoperability, http://en.wikipedia.org/wiki/Interoperability

Thursday, July 5, 2007

Code Monkeys


In preparing for this blog I looked the the infinite monkey theorem on wikepedia (http://en.wikipedia.org/wiki/Infinite_monkey_theorem). It’s the theorem that goes "a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will type one of Shakespeare's great works. Apparently this was subject to a real experiment. The result was they discovered the monkey's continually typed the letter "S", defecated on the typewriters and did not produce any text of which the bard would have approved.

The relevance of the infinite monkey theorem to blogging is of course that if you keep on writing long enough at some point you might come up with something that is worth reading. This is my hope. Of course like the monkeys (and some other writers I know) I could end up getting very repetitive and using the keyboard for purposes for which it was not designed.

The term "Code Monkeys" is pretty objectionable. Writing code is difficult and exacting. If Shakespeare had to conform his works to the requirements of a compiler I suspect he would have had difficulties. Writing code no longer seems to be about sticking to the one language and submitting it to one big box that follows the instrutions. Now an application may spread over several layers using different languages and running on different boxes. This actually could be progress if it done properly. It should allow more agile, more integrated systems with more flexibility. Sometimes it is hard to convinced.
(The image of the monkey above is borrowed from a Zapthink presentation by Jason Bloomberg)