September 23, 2009

The Art of Software Maintenance

Software Maintenance Blog
William A Clements

The Art of Software Maintenance
            Not to be confused with the Art of the Motorcycle Maintenance, this entry is about an article I recently read. I have found that when you have come up with a good way of explaining something, someone always has a better way. “The Art of Maintenance Programming” by Nemanja Trifunovic explain nine practices every software maintenance engineer should strive to master. In summary:
  • Get to Like It
    • Disadvantage: “Developers dream of being chief architects in their teams, and when they end up maintaining existing software, it feels almost like punishment.”
    • Advantage: “…Employers actually value people who solve problems; and maintenance programming can be a good chance to demonstrate your problem-solving skills”
  • Get Familiar with the Functionality of the Software You Maintain 
    • Read the existing documentation 
    • Dig out the test plan, and go through it 
    • Find out how the software is being used 
    • If you are a power user of the software you maintain, chances are you will spend less time in the debugger 
  • Get Familiar with the Architecture of the Software You Maintain 
    • You would expect to inherit detailed and up-to date design documentation, including requirements, functional specifications, high-level and low-level design, as well as well-commented code, right? – Ah Nope 
    • Look at the code 
      • Try to understand the roles of classes, modules and components
    • Use the debugger 
      • Step through different scenarios of use
    • Be sure to write down your findings and organize them in some form
      • It can be some formal method like UML diagrams, or something informal but easy to understand
  • Communicate with the Users
    • When they report a problem, get back to them immediately, even if you don’t have a solution at that moment – just let them know you are looking into it and not ignoring them. Keep them updated about the status of their problem. Finally, be honest; if you can’t meet their request for any reason, tell them.
    • If Possible, Communicate with Original Developers
    • Don’t expect them to do the actual coding for you, but they can throw you an idea how to accomplish something, explain you why something works the way it works, and provide you with lots of helpful hints.
  • Keep the History of Changes
    • An accurate history of changes is invaluable for successful maintenance, even if nobody else before you took care of it, and you get only a partial list of changes.
  • Be Conservative
    • Many times during the maintenance work, you are going to get frustrated with the existing code in some module, and just want to toss it away and rewrite it from scratch. Before you actually do that, ask yourself some questions:
      •  How would it benefit your organization and its customers? The fact that some code is ugly, or looks ugly to you is not per se a reason to rewrite it. If a customer wants a feature that can’t be added to existing code, that could be a reason to consider rewriting it. 
      • Are you sure you understand what this code does and how it works? 
      • Are you sure you understand how it interacts with other parts of the system, and which modules and functionality depend on the code you want to rewrite? 
      • Are you sure you can make it better? Maybe you run into the same problems the original developers did, and make it same or even worse.
    • Refrain from refactoring
    • Try to do it the right way immediately, later will never come. 
  • Test after Every Change You Make
    • First coding task you need to do after taking some software to maintain is to write a comprehensive regression-test suite.
    • A good practice is that for each defect report you get, write a test-case to reproduce it.
  • Adopt Existing Code Conventions Even If You Don’t Like Them
    • Try to stick to whatever conventions exist in the code you maintain, … don’t introduce yet another one
In my own experience, I have learned each of these principles, sometimes I learn them the easy way, others the hard, and they are extremely helpful in keeping the software from turning into spaghetti code.

September 16, 2009

I’m a developer; there is no money in maintenance.

Software Maintenance Blog
William A Clements
“I’m a developer; there is no money in maintenance.”
Beside self made programmers, most schools, universities are producing program developer who develops code more and more efficiently.
  • Where does all that code end up?
  • What happen to the program when it needs to be fixed?
It ends up in the world of software maintenance.
The following chart represents the cost of software maintenance compared to the entire cost of life of a program. The relative cost for maintaining software and managing its evolution now represents more than 90% of its total cost. Various studies on this subject are described in Table 1.
Table 1. Proportional software maintenance costs for its supplier. [[1]]
Year
Proportion of software maintenance costs
Definition
Reference
2000
>90%
Software cost devoted to system maintenance & evolution / total software costs
Erlikh (2000)
1993
75%
Software maintenance / information system budget
(in Fortune 1000 companies)
Eastwood (1993)
1990
>90%
Software cost devoted to system maintenance & evolution / total software costs
Moad (1990)
1990
60-70%
Software maintenance / total management information systems (MIS) operating budgets
Huff (1990)
1988
60-70%
Software maintenance / total management information systems (MIS) operating budgets
Port (1988)
1984
65-75%
Effort spent on software maintenance / total available software engineering effort.
McKee (1984)
1981
>50%
Staff time spent on maintenance / total time (in 487 organizations)
Lientz & Swanson (1981)
1979
67%
Maintenance costs / total software costs
Zelkowitz et al. (1979)
Table 2: Evolution of maintenance costs. [[2]]
Reference
Year
% Maintenance
Lientz and Swanson (1980)
1976
60%
Pigoski, (1996)
1980-1984
55%
Schach (1990)
1987
67%
Pigoski (1996)
1985-1989
75%
Frazer (1992)
1990
80%
Pigoski (1996)
90’s (prev.)
90%


[2] Polo, Piattini, and Ruiz; “Advances in Software Maintenance Management – Technologies and Solutions”, Idea Group Publishing, London 2003 http://skillport.books24x7.com

September 9, 2009

What is the name of the song?

Software Maintenance Blog
William A Clements

What is the name of the song?
      In my undergraduate Programming Language class, we, the class, were able to get the professor off on a side tangent. On one of these occasions, the professor referenced a scene in “Through the Looking Glass” by Lewis Carroll. As some of you might know Lewis Carroll mostly wrote mathematic books, except for Alice in Wonderland series, which has several mathematic under tones, one of which I am about to point out.
      In the scene, Alice is walking with the White Knight, and they have just finished coming to end of woods. Alice’s expression are mis-interrupted by the Knight:

“Alice could only look puzzled: she was thinking of the pudding.
`You are sad,' the Knight said in an anxious tone: `let me sing you a song to comfort you.'
`Is it very long?' Alice asked, for she had heard a good deal of poetry that day.
`It's long,' said the Knight, `but it's very, very beautiful. Everybody that hears me sing it -- either it brings the tears into their eyes, orelse --'
`Or else what?' said Alice, for the Knight had made a sudden pause.
`Or else it doesn't, you know. The name of the song is called "Haddocks' Eyes".'
`Oh, that's the name of the song, is it?' Alice said, trying to feel interested.
`No, you don't understand,' the Knight said, looking a little vexed. `That's what the name is called. The name really is "The Aged Aged Man".'
`Then I ought to have said "That's what the song is called"?' Alice corrected herself.
`No, you oughtn't: that's quite another thing! The song is called "Ways and Means": but that's only what it's called, you know!'
`Well, what is the song, then?' said Alice, who was by this time completely bewildered.
`I was coming to that,' the Knight said. `The song really is "A-sitting On a Gate": and the tune's my own invention.'
So saying, he stopped his horse and let the reins fall on its neck: then, slowly beating time with one hand, and with a faint…”[ ]

       The knight pointed out four ways of identifying something. The following example pointed out the differences in these four measures of identification. The first example identifies our national anthem. The second example is what one would see in typical programming language of an assignment of an variable. The third example represents the different definitions/scope of an object in Object Oriented Programming.

Four Definitions Example 1 Example 2(int A = 2;) Example 3 (OO)
The name of the song is called National Anthem Integer    Declaration
The name is called Song    A Instance
The song is called “Oh say can you see” Value/Variable Definition
The song is America the Beautiful 2 or Number Symbolizes
Table 1: Illustration of Lewis Caroll's four different definitions