29
Fri, Nov
0 New Articles

The Unglamorous Science of Software Maintenance

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Big gains can be realized by focusing on what RPG programmers actually do.

By Steve Kilner

For the past few decades, while software development has traveled through a long list of new languages and methodologies, a lesser-known journey has been underway: seeking to maintain all the software already created. In the field of software maintenance, an important discipline, often labeled "program comprehension," has developed.

 

On a daily basis, IT organizations that support RPG applications come face to face with the theories and issues that embody this field. As RPG staffs are reduced, either through attrition or budget cutbacks, this field of research holds increasingly important value for developers, programmers, and managers who must keep important business applications running.

 

Program comprehension has the sound of something whose hard value might seem a little squishy and difficult to pin down. But consider this brief list of facts, all based on multiple, serious academic studies:

  • An estimated 70-90 percent of the lifetime cost of custom software is spent on maintenance of the software.
  • Maintenance developers spend 40-60 percent of their time trying to understand the programs they maintain (i.e., program comprehension).
  • A full 50 percent of the time that maintenance developers spend trying to understand programs is spent seeking information about what they are looking at in the program.

Doing the simple math on the first two bullets leads to the possible conclusion that the single most costly task in the entire software lifecycle is for maintenance developers to figure out what programs do.

 

Before we get into detail about program comprehension, let's understand a few basic facts about software maintenance to set the overall context.

Software Maintenance Context

The ISO defines four types of software maintenance:

•·      Corrective maintenance corrects discovered problems.

•·      Adaptive maintenance keeps software usable in a changing environment.

•·      Perfective maintenance improves performance or maintainability.

•·      Preventive maintenance corrects latent faults in the software before they become effective faults.

All IT organizations deal with these four types to varying degrees.

 

Another important concept is what has been called the Laws of Software Evolution. These are typically defined as eight laws, but for practical purposes there are really only two:

•·      Software must continually change to maintain its usefulness.

•·      As the software changes, it becomes increasingly complex unless work is invested to prevent this.

The first one is important because, if it is true, it provides the reasoning why users of software must plan for continual maintenance expenditures over its lifetime. The point has an underlying, obvious truth that makes it easy to accept as true: all human organizations (businesses) change over time, and if their supporting software does not change with them, it will become less and less valuable.

The second law is important for a different reason: it explains to organizations why their software becomes more "decrepit" over time. The underlying truth here is this: when a new software application is first developed, all of its features are taken into consideration to create the optimal design for that set of features. Later, as more features are added, the overall design cannot be re-optimized; the additional features are increasingly attached like barnacles to a once-sleek hull. Eventually, they weigh down the original vessel, and there is little in the way of well-crafted design that can be perceived.

Program Comprehension: Inside Developers' Heads

Over the last two decades, a fair amount of research has been done to determine how developers approach the task of understanding an unfamiliar program. These are a few commonly used concepts and their terms:

•·      Mental model--Mental representation of the program

•·      Cognitive model--The processes and information in the developer's head as the mental model is constructed

•·      Code scenarios--Familiar, commonly used fragments of code or code patterns

•·      Beacons/landmarks--Recognizable, familiar code features or techniques that are cues to the presence of significant functionality

•·      Rules of programming--Understood programming standards and conventions

Developers use different strategies to go about understanding a program, depending on their knowledge, skill level, and the assigned task.

In the "top-down" strategy, a developer begins with a hypothesis about the nature of the program based on the developer's existing domain (application or business) knowledge and attempts to map that to the code. The hypothesis and mapping to the code is then refined iteratively by developing child hypotheses. Expert programmers heavily use code scenarios, beacons, and rules of programming in this process. Often complicating this effort are calls to external objects or entities.

In the "bottom-up" strategy, developers start by reading individual lines of code and grouping them into higher-level abstractions ("chunking"). These abstractions are then iteratively grouped into further higher-level abstractions. In this strategy, the developer typically first forms a mental model of the program's control flow (plus key events) and then develops a model of the data flow.

Depending on their knowledge, skill level, and the task at hand, developers may sometimes choose the "as-needed" strategy. In this case, the developer mostly examines only the code judged to be relevant for completing the assigned task. This often proceeds in a top-down manner as the developer attempts to navigate what is judged to be only the relevant program hierarchy. With the use of this strategy, the developer often does not form a robust mental model of the program. This is potentially faster, but it runs the risk of an increased likelihood of errors.

Whatever strategy is employed, a well-formed mental model of a program will always include understanding of...

  • The object/function/subroutine hierarchy
  • The control flow of the program
  • The data flow of the program

One of the key tasks in any of these strategies is information seeking and the management of that process. As an example, take the following statement:

      C              MOVE  FLDA           FLDB

The reader can imagine all the possible information he or she might seek about that statement: what the FLDA attributes are, what file it's from, what might be in FLDA at this point, where the file is read, whether FLDA is in a data structure, what conditions govern this statement, etc. Finding all this information involves "forward-chaining," "backward chaining," and "side-chaining" through the source code.

Investigating those questions leads of course to more questions, which means the developer must track a network of answered and unanswered questions. The quality of the maintenance process depends heavily on the developer's ability to manage that question network correctly, and this relies heavily, of course, on something we all know to be imperfect: human memory. One of the most significant sources of maintenance defects is the failure of developers to seek all the information they should, either because of insufficient domain knowledge, poor decision-making, or simple forgetfulness.

When one is thinking about what is inside developers' heads, one must also consider the fact that not all heads are on equal footing (so to speak), either in skill levels or in domain knowledge. Less-experienced developers tend to think in terms of "objects" (e.g., programs, files, screens, subroutines, etc.), whereas more-experienced developers think about these things plus the relationships between them and their relationships to the system as a whole. Mindfulness of the broader context is one of the keys to the lower defect rate of expert developers.

Program Comprehension Tools and Techniques

There are two categories of methods for program comprehension, and most tools and techniques fall into one of them:

•·      Dynamic Analysis

•·      Static Analysis

In dynamic analysis, developers use run-time information, such as execution trace data, to analyze and understand the program. For example, some tools on the market, in other languages besides RPG, attempt to convert trace data into UML sequence diagrams. This is usually more feasible in object-oriented environments. IBM provides some very basic tools for dynamic analysis on the System i, centered around the Start Trace (STRTRC) command.

In static analysis, developers use source code, object code, and other available artifacts to analyze and understand the program. Typically, different views of the program are presented in the form of different textual views of the source and visual views of program structure or flow.

A tool that supports static analysis for RPG would include features for forward and backward chaining, variable reference, program hierarchies, control flow analysis, data flow analysis, management of the information-seeking process, and so on.

RPG shops that continue to rely on SEU or other simple editors for the task of program comprehension in software maintenance have a significant opportunity to improve their productivity and quality, keeping in mind the research results showing that approximately half of maintenance developers' time is spent trying to understand code.

Any software that provides any of the features listed in the previous paragraphs will bring improvements to the RPG maintenance process. Tools that contain varying degrees of RPG static analysis include IBM's WDSC/RDi, Databorough's x-Analysis, Arcad's Observer, and vLegaci's Codelyzer.

Improving RPG Maintenance

Most RPG-oriented organizations that engage in regular maintenance work can make significant improvements in their throughput and defect count. Recognition of the well-documented facts outlined in the beginning of this article is a first step. To reiterate:

  • An estimated 70-90 percent of the lifetime cost of custom software is spent on maintenance of the software.
  • Maintenance developers spend 40-60 percent of their time trying to understand the programs they maintain (i.e., program comprehension).
  • A full 50 percent of the time that maintenance developers spend trying to understand programs is spent seeking information about what they are looking at in the program.

Assisting developers in their program comprehension effort potentially holds "big bang for the buck." Short of acquiring tools with the necessary features, there's not much else IT management can do to facilitate program comprehension. But once tools are acquired, it is paramount that 1) the tools are made available to all developers, 2) necessary training is provided to get the benefits, and 3) management follow-up occurs to make sure the tools are being fully utilized. Some developers resist changing habits developed over many years, but there is little business justification to allow less-productive, lower-quality work methods to persist.

As IT staffs face increasing challenges due to turnover or cutbacks, management must deal with the fact that more and more maintenance activity will be done by developers with less and less program familiarity. Assisting the program comprehension task directly is a straightforward way to mitigate the steep learning curve these developers face--and the extra cost and risk the organization potentially incurs.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: