You are on page 1of 7

Reengineering Autonomic Components in Legacy

Software Systems: A Case Study


James. J. Mulcahy Shihong Huang
Florida Atlantic University Florida Atlantic University
Computer Science & Engineering Computer Science & Engineering
Boca Raton, Florida, 33431, USA Boca Raton, Florida, 33431, USA
jmulcah1@fau.edu shihong@fau.edu

Abstract—Modern enterprise-scale software systems in the I. MOTIVATION


retail industry are often implemented as systems of systems that
are composed of one or more legacy software components
The motivation for this work comes from the typical
making up parts of a supply chain that deliver products to both challenges faced by stakeholders of legacy enterprise resource
in-person and online customers. The systems are often one-off planning systems, known as “ERPs.” An ERP system is often a
complex implementations tailored to the needs of that particular significant investment for its stakeholder. It is typically tailored
stakeholder. System components may communicate with other to the specific needs for the business it supports, and may be
internal legacy components like accounting and warehousing unique enough to make replacement or extensive reengineering
systems or external third-party components that handle order economically unfeasible. ERPs are systems composed of a
processing, security screening, or shipping-related tasks. From complex combination of software applications that cover many
time to time, stakeholders may need to adapt their systems by of the major business processes of the business they support
replacing or modifying one or more of the sub-system [1]. These days, ERPs are more likely to be legacy systems
components to operate on new hardware, communicate with than not, and maintaining their business value requires
other components using different data communication evolving them to adapt to changes in technology or the
techniques, or to interact with new external third-party solutions. exposure of third-party solutions that can replace or enhance
some of their internal operation (i.e. order entry, shipping,
It is therefore useful for solutions for the individual components auditing) [2].
to be designed with an architecture that lend themselves to be
easily reengineered or replaced without disturbing the other Maintaining systems to preserve or enhance business value
system components, and without adding significant complexity to is one of the most expensive aspects of software engineering
the overall system of systems. In prior works, the authors of this with respect to legacy systems [3][5]. Modifying an existing
paper introduced in a series of case studies a repeatable system tends to add complexity and fault-proneness to that
architectural design pattern that implemented self-adaptive
system unless its components are explicitly designed to
autonomic interaction managers (AIMs) that not only reduced or
eliminated the need for human operators to monitor, tune, or
mitigate these challenges [6]. One approach used by
troubleshoot the implemented components, but could be easily practitioners is the development of systems or parts of systems
modified or reengineered in the future to adapt to new operating that are self-adaptive and mitigate the need for humans to
environments. operate or to maintain them [4]. Removing humans from the
loop using autonomic design was described by IBM in 2001
The contribution of this paper is the testing of the efficacy of the when they identified four major self-adaptive attributes or
AIM design introduced in prior works by the authors, by behaviors that make a system or system component
simulating the reengineering of a set of AIMs tasked with “autonomic” [7]:
handling web-based order traffic between the stakeholder system
and Amazon.com. In this effort, the AIMs were re-implemented Self-configuring – The software recognizes changes to its
on a different operating system, coded in a different environment and reacts to address those changes.
programming language than the original implementation, using a
different data communication protocol to communicate with Self-optimizing – The software automatically adjusts its
other systems. The authors simulated web-based order traffic to behavior to more efficiently complete its tasks.
test the resulting implementation. The effort demonstrated that
using the original autonomic design patter, AIMs could be Self-healing – The software recognizes system faults or errant
rapidly adapted to a new environment, while maintaining conditions that jeopardizes normal operation and
original behavior and without adding complexity to the automatically takes steps to repair or mitigate those
stakeholder’s system. conditions.

Keywords—software engineering, software reengineering, Self-protecting – The software recognizes conditions that can
legacy systems, autonomic computing produce system faults and takes steps to avoid them.

978-1-5090-4623-2/17/$31.00 ©2017 IEEE


In prior works, the authors produced case studies describing architecture (SOA) approach to exchange data with third-party
real-world development projects during which autonomic stakeholders. Simplified Object Access Protocol (SOAP) was
components designed to exhibit the four aforementioned used to communicate with Amazon for the exchange of
behaviors were implemented to handle order entry by consumer order information. The new implementation would
customers using external marketplace systems [10], security use a simpler File Transfer Protocol (FTP) approach.
screening of customers and orders for sensitive products [11],
The following section contains some preliminary results of
and for handling the shipping process for returned order items
a proof-of-concept effort that implemented the afore-
[12]. Autonomic interaction managers (AIMs) were used as
mentioned changes. The effort took less than fifty (50) man-
data brokers between the legacy stakeholder system and third-
hours to accomplish and the resulting implementation retained
party systems. The resulting solutions were designed to
the autonomic behavior of the original solution.
minimize human error and reduce human effort needed to
monitor and tune the interaction between stakeholder and
external systems. II. THE SOLUTION
The legacy ERP retail system adapted by this work includes
It is not enough, however, to produce solutions that reduce
an order fulfillment process that uses a legacy order
the complexity and human involvement in a system of
systems. Because technology is ever-changing, the solutions processing API to import new customer orders. The orders are
should be fairly easily adaptable to new technical then checked for validity and product availability, and then
prepared for processing by the stakeholder’s warehouse
requirements and stakeholder needs. For example, a
system (Fig. 1). In the warehouse, the orders are “picked”
stakeholder may need or desire to alter the environment in
from inventory and “packed” into containers (e.g., boxes) for
which parts or all of their legacy ERP systems and subsystems
shipment, steps that are collectively referred to as “pick &
operate. Hardware components may become obsolete, as may
software hat the legacy systems interact with. Apart from pack.”
necessity, the stakeholder’s motivation may be to address non- A second external system owned by the stakeholder hosts a
functional requirements like cost, efficiency, reliability, or Simple Object Access Protocol (SOAP) server that
even security. communicates with Amazon’s Marketplace Web Service
application programming interface (API) known as MWS. The
Any number of changing or new requirements can motivate
stakeholders of legacy systems to evolve their systems. It is basic order flow from Amazon to the stakeholder’s system is
therefore advantageous that system components be designed shown in Fig. 2.
with an architecture that is easily adaptable to change without An AIM component is used to collect customer order files
expensive and complex reengineering efforts. In prior works, from Amazon using Amazon’s MWS API, and are staged to
the authors used an approach the lent itself to future the SOAP server. The order files are periodically transferred
adaptation. In the project described by this paper, we by one of the asynchronous AIM components to the
simulated the reengineering of autonomic middleware stakeholder’s minicomputer, an HP 3000 running the MPE/iX
components developed for a company that offered a subset of operating system. The stakeholder is hereafter referred to as
its product line for sale on Amazon.com, a popular e- the “host” machine and the SOAP server as the “target”
commerce platform. machine. The communication between the SOAP server and
Amazon is beyond the scope of this paper.
In our case study scenario, existing AIM components that
were part of the stakeholder’s existing order processing
workflow were to be retired from an HP3000-based
minicomputer and re-implemented to operate on a personal
computer using the Microsoft Windows operating system.
This was not a simple matter of copying source code to a new
machine and rebuilding the solution from it.
The original AIMs had been constructed using a
combination of scripts and applications. The scripts were
written in a job control language (JCL) that was native to the
HP3000 and would have to be reengineered as “batch” scripts
native to the Microsoft Windows command prompt
environment. The applications for the original AIMs were
written in the COBOL programming language. The new
implementation would require reengineering these
applications using the C++ programming language. The Fig. 1. Stakeholder Order Processing Flow
original implementation included a service-oriented
The platform on which the original components were
implemented was being sunsetted by the hardware vendor and
it was expected that the stakeholder would seek to implement
the components in a different environment in the future. In
this section we describe the proof of concept that was
undertaken to re-implement the AIM components to test the
efficacy of the repeatable architectural approach by which the
original solution was implemented.
This section describes the solution that was implemented on
a Windows-based machine with no SOAP server. The order
and acknowledgement files are stored in specific inbound and
outbound folders managed by a File Transfer Protocol (FTP)
server implemented on the same machine. To simulate orders
Fig. 2. Order Flow between Amazon & Stakeholder
arriving from Amazon, a web-based order simulator program
was written in C++ to periodically drop order files into the
A second AIM component is tasked with checking the host
inbound folder. Order acknowledgment files destined for
machine for un-processed orders. Un-processed orders are
Amazon are placed in the outbound folder. For this proof of
injected into the ERP system’s order database using a legacy
concept, the acknowledgment files are not actually transferred
order processing API. The API generates as output an order
to Amazon.
acknowledgement file for each of the processed orders, and
stages them on the host machine until they can be transferred Each AIM contains four (4) major steps, each implementing
to the target machine. one of the four self-* attributes described in the previous
section (Fig. 4).
A third AIM component periodically gathers the
previously-generated order acknowledgement files and The “schedule successor” step implements the self-healing
transfers them to the target machine. The target machine’s behavior of the AIM by using the native task scheduler to
SOAP implementation periodically transfers the files in schedule a future instance of itself. If the AIM fails at any
batches to Amazon. Amazon generates customer emails using point after this step (e.g., from a disk write failure,
the acknowledgement files, informing each customer that the communication failure, etc), an instance of itself will execute
order they placed has been accepted and processed by the and pick up where the prior instantiation left off, thereby
stakeholder. “healing” itself from a system fault without the need for
human intervention.
Each of the three AIM components are written in job
control language (JCL) in scripts referred to as job streams. The “check concurrency” step implements the self-
The job streams are composed of both system-level commands protecting behavior of the AIM by checking that no other
and the execution of application programs written in the instance of the same AIM is already executing. If another
COBOL programming language. The architecture describing instance is executing, the new AIM aborts itself, thereby
the flow of customer orders from Amazon to the host machine “protecting” itself from causing a race condition where
and the flow of order acknowledgements from the host multiple AIMs attempt to process the same file.
machine to Amazon using the autonomic interaction managers
The “configuration” step implements the self-configuring
is shown in Fig. 3.
behavior of the AIM by checking for any changes in the
environment upon which it should act – namely, the
appearance of a file that needs to be processed.

Fig. 3. Amazon/Stakeholder Architecture


Fig. 4. AIM Self-* Steps
The “optimization” step implements the self-optimizing test machine. To produce a realistic testing scenario, the
behavior of the AIM by comparing the number of files it Populator application generated order files at a volume and
detects are waiting to be processed and adjusting the frequency that mimicked a typical e-commerce order traffic
frequency for that AIM’s execution up or down based on the pattern. For example, order volumes tend to peak around mid-
expected volume of files versus the detected volume of files day and again, but less significantly, during mid-evening.
(Table 4). Because each AIM has its own set of environment These patterns were presumably from customers that shopped
variables, the expected volume may be set to a different value online during lunch breaks at work and after dinnertime at
by human users of the system, and thus the frequency at which home. Online orders may also peak on certain days of the
of that AIM executes may be different than the other AIMs at week (e.g., Wednesday and Thursday) in advance of a typical
any given time. payday (Friday), or at certain times of year (e.g., two weeks
before Christmas). The order-populating application was
A. Three AIMs, Three Tasks designed to simulate these typical e-commerce web traffic
As in the original system, three AIM components are tasked patterns.
with processing the simulated order files and their Fig. 5 shows the order volume that was generated by the
acknowledgments. The first AIM (AIM_GET) monitors an order-populator over a simulated period of twenty-one (21)
inbound folder and periodically transfers orders to another hours. An increase in orders is generated at typically peak
processing folder using FTP. This process is analogous to the ordering times in the afternoon and evening.
transfer of files from the SOAP server to the stakeholder
minicomputer in the original solution. Fig. 6 shows data logged from the simulation of the
AIM_GET process. It was used to test the self-optimizing step
The second AIM (AIM_PROC) periodically collects the with the orders generated by the Populator application. The
orders and simulates the injection to an ERP system database.
expected volume for this AIM was set to 10 orders, and the
A built-in delay of one (1) minute is used to simulate the
initial execution interval was set to 3.5 minutes, with a floor
processing time of this process in the original solution. An
order acknowledgment file is generated. Once the order is constrain of 1 minute and a ceiling constraint of 6 minutes.
“processed,’ the AIM moves the order file to an archive folder The values correspond to one tenth of real time operation
both as a backup process and to prevent the order from being values of 10 and 60 minutes, respectively. The adjustment
picked up and reprocessed by the next iteration of the second factor for this AIM was set to 0.25. That is, the AIM execution
AIM. interval would be increased or decreased by 25%, depending
upon the volume of orders processed compared to the volume
The third AIM (AMC_PUT) periodically collects the
acknowledgement files and transfers them to the outbound that was expected.
folder via FTP. All three AIM components self-adjust their Each table entry that includes an asterisk next to the interval
behavior according to the detected volume compared to the value corresponds to a cycle in which the AIM adjusted its
expected volume, just as they did in the original interval in the self-optimizing step. For example, the first table
implementation. Each AIM operates asynchronously and entry shows that three (3) orders were collected, which was
independently of one other. less than the expected volume of ten (10) orders. The self-
Each AIM exhibits self-healing and self-protecting optimizing step reacted by increasing the interval from 3.5
behavior. To achieve these behaviors, the AIM communicates minutes to 4.375 minutes (+25%) to reduce the frequency.
with the native system task scheduler. For the Windows-based
system, the solution uses the Windows “Task Scheduler 1.0”
API to query the operating system for duplicate instances of
the same AIM that are either scheduled or executing.
The development effort for this simulation case study took
less than fifty (50) hours to complete. Each AIM component
and its external C++ helper programs were written in C++.
Each AIM and each helper program was implemented as an
individual project using Microsoft Visual Studio. The program
used to simulate incoming customer order traffic was also
written in C++ and implemented as a separate project in the
MSVS solution. The environment variable files were created
using Microsoft Notepad and populated with initial values to
control the AIM behavior. Each AIM had its own set of
environment files.
To test the implementation, the simulator (named
“Populator”) for the incoming order traffic was executed. It
generated order files that appeared an inbound folder on the Fig. 5. Simulated Order Traffic
• Configuration – Check for files in the inbound folder
of the host machine. Each file is “processed” and an
order acknowledgement file is generated and stored
in the host machine’s outbound folder. The total
number of files is counted and passed to the next
step. Each order file is archived to a separate folder
so it is not processed again.
• Optimization – Using the number of files processed
by the configuration step as a guide, adjust the
interval value for the next execution of GET_PROC
by comparing expected value versus detected
volume.
In our simulation, GET_PROC successfully launched itself
at frequencies varying between the ceiling and floor intervals
Fig. 6. Retrieving Orders constrained by its environment variable values. No duplicate
instances were observed, and successor instances were
The volume remained low for the next two cycles, so the successfully scheduled. Connectivity failures were simulated
AIM continued to increase the interval value until it hit the by temporarily shutting down the FTP server, preventing order
ceiling value of 6 minutes, where it remained for 5 more files from arriving from the target inbound folder.
cycles. AIM_PROC continued to poll for orders, but since none were
found, it slowed its execution frequency over several
Beginning with the 9th cycle, a “lunch rush” was simulated, execution cycles. After restarting the FTP server, AIM_GET
and the order volume began to exceed the expected volume of resumed collecting and transferring files from the target to
10 orders. For the next several cycles, the interval was reduced host inbound folders, and AIM_PROC detected and processed
by 25% to increase the frequency at which the AIM executed. them accordingly. It adjusted its interval appropriately by
The interval never reached the floor value of one minute, running more frequently due to the FTP outage until the
however, and beginning with the 14th cycle, the interval began detected volume returned to expected levels.
to increase again as the order volume decreased. The rest of Fig. 7 illustrates the behavior of AIM_PROC during the
the table illustrates the adjustments the AIM continued to same simulation and order volume depicted in Fig. 5. For this
make as the order volume fluctuated. AIM, the expected volume was set to 15, and modified during
the 6th cycle by the author to a value of 10 to simulate a
B. GET_PROC stakeholder “tuning” the process. The starting interval value
The second AIM was executed for the first time one minute was set to 4.5 minutes, with a floor of 3 minutes and a ceiling
after the initial AIM_GET was launched. This AIM of 6 minutes, with an adjustment factor of 0.12 (12%). Like
(AIM_PROC) periodically polled the inbound host folder on the AIM_GET simulation, AIM_PROC initially adjusted its
the simulated host machine and “processed” all files present. interval upward in respond to lower-than expected volume
This processing entailed “sleeping” for 1 minute per order until it eventually reached the ceiling value. During the 8th
and generating an acknowledgement file for each order, cycle, order volume exceeded the expected volume and the
placing the result in the host outbound folder. Depending on interval was modified accordingly. The remainder of the table
the expected volume value found in the environment variable illustrates the self-optimizing behavior over the rest of the
for AIM_PROC, the new frequency was observed by the simulation.
author to be adjusted up or down accordingly.
The AIM_PROC component performed four steps to
accomplish these tasks:
• Schedule Successor – Check if an instance of
AIM_PROC has been scheduled but is not yet
executing. If no instance is detected, a new one
scheduled using the Windows Task Scheduler.
• Check Concurrency – Check if an instance of
AIM_PROC is currently executing. If instance is
detected, continue on to the next step, otherwise
abort the rest of the steps of this instance.

Fig.7. Processing Orders


C. AIM_PUT adjusted its interval upward in response to lower-than
The third AIM was executed one minute after the initial expected volume until it eventually reached the ceiling value.
AIM_PROC instance was launched. This AIM periodically Since the expected volume threshold was set so low, this AIM
polled the outbound folder on the simulated host machine and adjusted its interval nearly every cycle during the simulation.
transferred all files present to the outbound folder on the
simulated target machine. Depending upon the expected III. CONCLUSION
volume value for AIM_PUT (defined in an environment The case study described in this paper was designed to
variable unique to AIM_PUT), the new frequency (interval) validate the repeatable platform-agnostic approach first used
was adjusted up or down accordingly during the simulation. in [11] to collect and process web-based customer orders from
The AIM_PUT component performed four steps to a third-party system. The validation tested by reengineering
accomplish these tasks: the original autonomic components (AIMs) to operate in a
• Schedule Successor – Check if an instance of new environment with a different operating system and task
AIM_PUT has been scheduled but is not yet manager and using different programming languages and data
executing. If no instance is detected, a new instance communication protocol than the original implementation.
is scheduled using the Windows Task Scheduler. The goal was to demonstrate how the approach could be
successfully used to develop autonomic interaction managers
• Check Concurrency – Check if an instance of that can be deployed to new platforms while retaining the
AIM_PUT is currently executing. If no instance is original behavior and without requiring the reengineering of
detected, continue on to the next step, otherwise other components of the legacy system in which they
abort the rest of the steps of this instance. operated. While the components steps of each AIM were
reengineered, the overall architecture was not, nor were the
• Configuration – Use FTP to check for files in the host
outbound folder. Using FTP, transfer each file to the self-* autonomic attributes that resulted from that architecture.
target machine’s outbound folder. The total number The development effort took less than fifty hours and the
of files is counted and passed to the next step. Each testing effort took a single day, validating the efficacy of the
acknowledgement file is archived to a different folder approach. The resulting solution was structured the same way
to prevent it from being processed again. as the original solution and behaved similarly. Testing proved
that the solution could run autonomously, exhibiting the
• Optimization – Using the number of files processed
desired autonomic attributes of self-configuring, self-healing,
by the configuration step as a guide, adjust the
self-optimizing, and self-protecting. To show that human
interval value for the next execution of GET_PUT by
operators can influence the solution’s behavior at run-time, the
comparing expected value versus detected volume.
author periodically adjusted environment variables over the
In our simulation, GET_PUT launched itself at frequencies course of the testing process. The adjustments did not disrupt
varying between the ceiling and floor intervals constrained by the solution. The effort demonstrates the efficacy of the design
its environment variable values. No duplicate instances were approach introduced in prior works by the authors.
observed, and successor instances were successfully
In future work, the authors intend to expand the scope of the
scheduled. Connectivity failures were simulated by
several aspects of the case study: the self-configuration and
temporarily shutting down the FTP server. AIM_PUT
self-optimizing steps will use more sophisticated algorithms to
continued to poll for acknowledgement files, but since
automatically set and alter the expected volume thresholds
connectivity failed, it gradually slowed its execution
based on historical order traffic. The self-protecting and self-
frequency. After restarting the FTP server, AIM_PUT
healing steps will adjust execution frequency of the AIMs to
resumed the collection and transfer of files from the host to
avoid duplicate instances by monitoring the time it takes to
target outbound folders once AIM_GET and AIM_PROC
process a typical order and to transmit a typical file.
began populating the host folders. It adjusted its interval
appropriately by running more frequently due to the FTP
outage and subsequent “piling up” of files, until the volume
fell below the expected level.
Fig. 8 illustrates a sample of the behavior of AIM_PUT
during the same simulation and order volume depicted in Figs.
6 and 7. For this AIM, the expected volume was set to 5
orders. This threshold was chosen to simulate a stakeholder
desire to update Amazon with order acknowledgements at a
higher frequency than the order collection and order
processing steps. The starting interval value was set to an
arbitrary 2.76 minutes, with a floor of one minute and a
ceiling of 6 minutes, and an adjustment factor of 0.25 (25%).
Fig. 8. Processing Order Acknowledgements
Like the other AIMs in the simulation, AIM_PUT initially
REFERENCES [7] F. Zoufaly, “Issues and challenges facing legacy systems,”
Developer.com, 2002.
[1] H. Klaus, M. Rosemann, and G. Gable, “What is ERP?,” Information
Systems Frontiers, vol. 2, no. 2, pp. 141-162. 2000. [8] J. Kephart, “An architectural blueprint for autonomic computing,” IEEE
Internet Computing, vol. 18, no. 21. 2007.
[2] Gartner, “Gartner says by 2016, the impact of cloud and emergence of
postmodern ERP will relegate highly customized ERP systems to legacy [9] M. Salehie and L. Tahvildari, “Self-adaptive software: Landscape and
status.” Available at http://www.gartner.com/newsroom/id/2658415. Research Challenges,” ACM Transactions on Autonomous and Adaptive
Last accessed 21 November 2014. Systems, vol. 4, no. 2, art. 14. 2009.
[3] Y. Brun, G. Serugendo, C. Gacek, and H. Geise, “Engineering self- [10] J. Mulcahy, S. Huang, and A. Veghte, “Leveraging Service-oriented
adaptive systems through feedback loops,” Software Engineering for Architecture to Extend a Legacy Commerce System,” Systems
Self-Adaptive Systems, Springer Berlin Heidelberg, 2009 , pp.48-70. Conference, 2010 4th Annual IEEE, pp. 243-248. 2010.
[11] J. Mulcahy and S. Huang, “Autonomic Software Systems: Developing
[4] M. Lehman, “On Understanding Laws, Evolution, and Conservation in
for Self-Managing Legacy Systems," Software Maintenance and
the Large-Program Life Cycle," Journal of Systems and Software, vol. 1,
pp. 213–221. Evolution, 2014 30th International Conference on: Victoria, pp. 549-
552. 2014.
[5] S. Dehaghani, N. Hajrahimi, “Which Factors Affect Software Projects
Maintenance Cost More,” Acta Informatica Medica, vol. 21, no. 1, pp. [12] J. Mulcahy and A. Huang, "An autonomic approach to extend the
63–66. 2013. business value of a legacy order fulfillment system," Systems
Conference, 2015 9th Annual IEEE International (SysCon): Vancouver,
[6] R. Seacord, D. Plakosh, and G. Lewis, “Modernizing Legacy Systems: pp. 595-600. 2015.
Software Technologies, Engineering Processes, and Business Practices,”
Addison-Wesley Professional, 2003.

You might also like