Академический Документы
Профессиональный Документы
Культура Документы
Software Reuse
Software reuse is a productivity technique
attempted by many development organi-
zations, with mixed success. In analyzing
Antipatterns
reuse failures, a number of antipatterns
emerge. Antipatterns are obvious, but wrong,
solutions to recurring problems. This article
outlines a number of reuse patterns that have
Revisited
been observed within the software industry.
KEY WORDS
antipattern, asset, component, library, pat-
tern, repository, reuse
JOHN LONG
PREFACE
When I originally wrote this article in 2001, I had been working
in the reuse world for some time and wanted to share some of my
experiences about reuse that ran counter to the obvious. I wish I
would have continued to write along these lines, because I prob-
ably could have found tremendous success writing books about
antipatterns, including father antipatterns, husband anti
patterns, and getting rid of wasps using fireworks antipatterns.
As the software industry has embraced agile development more
and more, there would seem to be ample reasons embracing sys-
tematic reuse as well, but reuse will always require planning. It is
unfortunate that agile development is more focused on timeliness
than quality. However, if the software product is successful, there
may yet be time afterward for harvesting and systematic reuse.
Since writing the article, my career has moved me into archi-
tectures and process workflows. Concerning the latter, there is
typically not a problem with organizing a process library (Field
of Dreams antipattern) because the processes typically fit within
some business process hierarchy or enterprise framework. Nor
is there typically a problem with overselling the value of process
reuse (Cost-Cutter antipattern). However, there are often problems
with quality of the workflows (Garbage Dump antipattern), which
is why I wrote Process Modeling Style in 2014.
I hope these few words of wisdom from the past will help
inspire the next generation of reusers.
www.asq.org 5
Software Reuse AntipatternsRevisited
2017, ASQ
Related antipatterns
designs, requirements, test cases, test data,
templates, or other development work that is Key words
The day comes for the repository to be open to the requirements, presentations, templateseverything!
programming community. The librarian waitsand Weve set our sights too low about this reuse thing. From
waits. Finally, the phone rings. What was the location now on, everyone should put everything into our reuse
of that library again? someone asks. repository. Its a mandatory part of your job. Just find
Over the next few months, the librarian examines the the right place to put your stuff, and place it in there.
access logs and realizes that very little of the code has Programmers, architects, testers, and others began
actually been downloaded by anyone. One individual putting everything they created into their repository.
has contributed some code, but it turned out to be quite At first, it was nice being able to browse around at what
buggy, so it was discarded. others in the department had been doing. Artifacts from
The group decides that they have not really publicized one project were occasionally useful in the next project.
the repository very well, so they send out more messages, Unfortunately, it did not take long before the reposi-
brief managers, and post signs. Within the next few tory became too large and too jumbled for anyone to
months, a few more inquiries are made, and a little more really use. Workers often had to ask around about the
code is downloaded, but again the results are disappoint- location of a file, which only occasionally resulted in
ing. What did we do wrong? they ask themselves in a actually finding the file. Many times, it took so long to
department meeting. Why wont anyone use our library? find something that the individual just gave up.
The repository falls into disuse and is one day removed I have witnessed this same problem in a major
to provide more storage space for the department. Moral: corporation that had a very large amount of contributed
Creating a place for reusable assets, while laudable, does software. The software was organized only by title. It
not bring about systematic reuse (see Table 2). took a significant amount of time for potential reusers
to find what they were looking for. Searches often led
TABLE 2 Field of dreams to dead ends. In the end, the company gave up on the
whole idea.
Antipattern Name Field of Dreams The idea for the repository was a good one, but the
Reuse-related A need to store reusable assets so repository simply contained too many documents for
motivation or problem others could reuse the assets
it is trying to solve
most individuals to find what they were looking for. Moral:
How it is applied A reuse repository is created and
If companies try to get anything and everything for reuse,
assets are stored in it, but that they will end up having nothing to reuse (see Table 3).
is all.
Actual results Only a few people end up using TABLE 3 Garbage dump
and unintended the assets in the repository. There
consequences is little business justification Antipattern Name Garbage Dump
to continue to support the
Reuse-related Developers within the organization
repository.
motivation or problem are always creating new software.
Primary fallacies Potential reusers assumed to it is trying to solve There must be a way to collect it
already be enabled to reuse. all and make it available for reuse.
This involves understanding
How it is applied A reuse repository is created. A
the value of reuse, trust in the
large number of assets are stored
reusable assets and their support,
in the repository, of varying quality,
knowledge of what assets are
overlapping in functionality, and in
available, and other aspects.
a haphazard manner.
2017, ASQ
www.asq.org 7
Software Reuse AntipatternsRevisited
The whole scenario is reminiscent of the old movie software. He spends the time to go into the code in depth
High Noon in which gunfighters square off against and fix a few more problems that he sees.
each other in the main street, waiting to see who will Unfortunately, the problems keep cropping up. Chen
draw a gun first and fire. In the same way, these project is faced with the decision of either rewriting the code
managers are all staring each other down, waiting for himself, or continuing to try and fix the reusable
someone else to go first and create something reusable. software. He has already invested so much time into the
They are perfectly willing to try to reuse what someone software that it seems a shame to throw it away, but with
else creates, but none of them are willing to actually all the time it took to understand the code, test it, and
create anything reusable. They know it will only draw debug it, he probably could have done it from scratch
resources away from what they are already doing, and himselfand with better results. Chen tells Mary that
it wont benefit them. Moral: Reusable software will they should not try to reuse anything they got from Bobs
usually not be created unless there is a dedicated team team. Its not a good use of their time and resources.
(see Table 5). If reusable software is not of high quality, then it is
like buying a used car from a previous owner. People
TABLE 5 High noon never really know what they are going to get. They might
get a good deal, but the seller might not be telling them
Antipattern Name High Noon what is really wrong with the car. Or, the seller might
Reuse-related No one will either reuse the assets not really be aware of problems in the car. By going to
motivation or problem of other groups or make reusable
a dealer who gives warranties and other assurances,
it is trying to solve assets for other groups.
people can be much more sure that the used car will
How it is applied Management mandates that
reusable assets will be created not break after they buy it.
and reused, but no support is If the dealer ends up selling a bad car, the buyer
provided to carry it out. probably wont ever buy another car from that dealer.
Actual results Each group declares it is ready to Moral: If ones assets are not of product quality, reusers
and unintended reuse, but no one actually does
consequences so. They blame each other for not
typically will not come back (see Table 6).
producing the right assets, not
reusing something they should be
reusing, and so on. TABLE 6 Used car fiasco
Primary fallacies Not providing positive incentives,
processes, and support for reuse Antipattern Name Used Car Fiasco
Reuse-related One group has software that
2017, ASQ
www.asq.org 9
Software Reuse AntipatternsRevisited
understand the software. Often, there are inadequate or How it is applied A small team is put together
to extract the software from
missing comments, requirements, designs, documenta- its existing application. It is
tion, or test cases. The harvesters gather everything that assumed to be a short-term
seems to be valuable and then try to reassemble it into task. After extraction, the team
must resolve missing identifiers,
a reusable component.
fix functionality that no longer
I once worked for a telecommunications company that works, introduce a greater level
spent a lot of effort creating configurators for its switching of generalization, and port the
code to a new platform. This takes
systems. It seems that telephony switches come with lots
longer than expected.
of options, and there was a great need for applications
Actual results The cost of the harvesting effort
that could easily step a customer through the different and unintended was underestimated. Tasks
options and then lay out the different parts needed by consequences that had dependencies on the
the configuration team and the pricing of the parts for harvested software got behind
in their schedule and the project
the sales team. Unfortunately, the company was always slipped major milestones.
creating new configurators. Whenever one product line Primary fallacies Underestimating the cost of
came up with a configurator, they expected the other reusing unharvested software. All
product lines to reuse their configurators, but it never reuse has a cost.
2017, ASQ
happened. The company always just created another Related antipatterns Used Car Fiasco
configurator for the next product line. Key words Harvesting, extraction, cost
As an individual charged with promoting reuse, I
noticed a particularly good configurator that had been
developed for one of the smaller product lines. In a Of Course its Reusable
meeting, I expressed a desire to harvest the configurator Related to the Hunter-Gatherer antipattern is the Of
and make it reusable for other product lines. I figured it Course its Reusable antipattern. In their zeal to uncover
was time for someone to put an end to reinventing the reusable assets, harvesting teams often find a consider-
configurator over and over. able amount of software that works well within its context
and appears, at first look, to be reusable as-is. This is I tried to install it, but without success. It was about a
the gem or mother lode that harvesters want to find. half-inch out of sync with the connection points on my
The idea is that, since the software worked so well in grill. I tried other universal burner replacements, which
another development project, then it must be useful in were both larger and smaller than my grills stated size,
plenty of other projects, too. This is one of the main but none of these universal parts worked. I guess my
driving forces behind the desire to reuse. grill came from a different universe. After contacting the
Unfortunately, that concept is a bit naive. Most soft- grill company, I was able to obtain a part for my specific
ware that was developed for a specific application must grill. It only took me five days of calling to finally get
undergo some change to make it reusable. That typically a service rep at the companys antiquated call center.
involves increased and enhanced documentation and Attempts to create a one size fits all product do not
self-descriptiveness, more abstraction and generality, always work. Many times, it turns out to be one size fits
adherence to standards, and testing in wider contexts. none. Misguided reuse practitioners can fall into this
It may also involve some redesign and recoding. trap. Once a company decides to spend the resources
Once in a while, software is found that is reusable in to make components reusable, there can sometimes
a wide variety of contexts as-is. However, these tend to be a tendency to over-engineer components for reuse.
be smaller in size. See the Object Explosion antipattern The result may be that the component is too large or
for problems related to small granularity. Moral: Dont too generic to be really useful to a development project.
confuse a reusable gem for an unpolished lump of If a component over-abstracts, then it may be very
coal (see Table 8). difficult to understand how it specifically applies to a
situation. In addition, if a component is over-generalized,
TABLE 8 Of course its reusable! it may contain so many levels of inheritance and function
calls that performance, maintainability, and understand-
Antipattern Name Of Course its Reusable! ability suffer. There is a balance concerning the amount
Reuse-related A software asset that has of reusability in a component. This balance should be
motivation or problem significant functionality is reused
it is trying to solve as-is. somewhere in the middle between specificity to a single
How it is applied The software is given to a group customer and applicability to any developer at any time.
to reuse without doing any prep Moral: Dont make a component too reusable (see Table 9).
work to make it fully reusable.
Actual results The team reusing the software
and unintended spends an inordinate amount of TABLE 9 One size fits all
consequences time trying to reuse it. Project
overruns occur. Antipattern Name One Size Fits All
Primary fallacies Assuming that functionality is the Reuse-related A software asset needs to be
only important aspect of reusing motivation or problem made more generic so it can be
software. One must also consider it is trying to solve reused by a wider audience.
understandability, maturity, How it is applied A developer is assigned the task
fault tolerance, generality, of making the software asset
portability,etc. more reusable. He or she spends
a significant amount of time
2017, ASQ
with the label universal burner replacement. It claimed Key words Inheritance, generalization,
abstraction
to work for any brand of grill that was of my grills size.
www.asq.org 11
Software Reuse AntipatternsRevisited
Domain Analysis Paralysis do. Consultants also like to convince their customers
on the need for domain analysis because it means lots of
Lets return to the corporate setting. One day, Manager
consulting hours. For those who do know what domain
John Knowitall comes into Director George Sludgefactors
analysis is, the rule of thumb is that it takes six full-time
office with an excited look on his face. Ive figured it
workers six months to perform domain analysis on a
out, George! The reason we havent been able to get our
well-understood domain.
reuse program going. Its domain analysis! We should
The results of domain analysis are actually useful.
have been doing domain analysis all along!
Domain analysis helps provide a common language
George looks over Johns face and pauses. OK, but
and structure for communicating about a domain and
whats domain analysis? John then goes into a 15-min- identifies an overall architecture for the domain. It can
ute diatribe about scoping the domain, classification help identify which components in the domain have
schemes, and more. He assures George that this is the the most promise for reuse. However, companies can
most important activity to making systematic reuse often get started in systematic reuse without waiting for
work in their enterprise. Georges eyes glaze over after domain analysis to complete. In many companies, if one
the first 30 seconds. However, he has always trusted waits for domain analysis to complete before starting
John to provide good advice. After a few more weeks reuse, the organization will already be in the process of
and in-depth presentations, George finally approves reorganization. Moral: When starting a reuse program,
Johns domain analysis project. Results are promised do not make it dependent on the completion of domain
within weeks. analysis (see Table 10).
During their first status meeting, John tells George
how difficult it was to get the domain experts together
and keep them interested. When he was able to keep TABLE 10 Domain analysis paralysis
their interest, the experts provided such an abundance Antipattern Name Domain Analysis Paralysis
of information that it was difficult to capture it all. The Reuse-related Wanting to know what reusable
domain experts provided a large amount of collateral motivation or problem software assets should be built
material that would take time to synthesize. The experts it is trying to solve
themselves were too used to their own documentation How it is applied A domain analysis project is
initiated. No efforts to create
and too busy that they did not participate in helping boil
reusable software assets are
down the information to just what John needed. It will allowed until the project is
take a little more time than I thought, John reports. finished.
After seven months and several more status meetings, Actual results By the time the project has
John provides George with a final report, but tells George, and unintended finished, enthusiasm has waned for
consequences reuse and the efforts are shelved.
I could have gone on for another seven months, but I When corporate reorganization
need to get on with the rest of my work. George takes takes place, there is little to show
the report and provides it to a few other colleagues, for the reuse project, and the
project is defunded.
which generates a little enthusiasm. However, John never
Primary fallacies Not allowing tactical reuse to
comes back to George to do a domain analysis again. prove its worth before investing
Domain analysis has been the subject of a great deal in strategic reuse
of confusion over the past decade or so. There are no Related antipatterns None
2017, ASQ
real de facto standards for what domain analysis is or Key words Domain analysis, domain model,
how to go about it. It has been used in object-oriented domain architecture
analysis and design, knowledge management, and
product engineering. In fact, there is no definitive source
to turn to concerning domain analysis. Object Explosion
This makes domain analysis open game for interpreta- Many years ago, object technology was touted as the
tion. Software developers who want to do reuse can panacea for a whole range of problems in the software
convince their managers that they need to do domain industry. And, according to the object evangelists, one
analysis, and when they win approval, they then get to of the most important problems it solved was that of
use it as an excuse for whatever it is they really want to software reuse. The theory was that object-oriented
languages possessed many of the attributes needed for user interface development, but little else. Moral:
to support software reuse, including encapsulation, Objects are puny. Real developers reuse components
abstraction, loose coupling, and inheritance, among (see Table 11).
others. However, it was that last attribute (inheritance)
that actually caused a little too much reuse.
Inheritance allows one object class to inherit func-
The Cost-Cutter
One of the most obvious reasons managers initiate a
tions and attributes from its parent class. This sounds
reuse program is to reduce time and costs in developing
good, but the difficulty was determining when to stop
software. Typically, the scenario involves a managerI
creating subclasses. This sometimes caused an explosion
will call him Timwho does not have the resources to
in the number of classes and difficulty in managing
develop the applications and/or products he is charged
them. However, the most important problem with object
with providing. In a strategic move, Tim brings together
technology was that it often focused reuse efforts at a
all of his team leads and announces he is going to begin
very low level. Reusing single classes by themselves often
a program of software reuse in order to reduce costs and
does not make much sense because of the number of
increase time-to-market. He convinces his management
dependencies on other classes. In one industry standard
to support this move by pledging to reduce his budget
e-business product I am familiar with, there are hundreds
by 30 percent during the next year.
of classes that may be reused.
Over the next several months, Tim oversees the
Many times, groups of classes must be reused together
creation of a reuse library and a number of reusable
in order to be effective. As developers have recognized components. It is not until the latter part of the year
this, classes have been grouped into components. that projects begin to reuse some of the components.
Component-level reuse makes for a much simpler and Initial feedback is favorable. Reusing organizations like
more effective approach to systematic reuse because it the components, but they do require some modifications
greatly reduces the number of interfaces that must be before they can reuse the components. This requires
dealt with by the reuser. Component-level reuse groups a considerable amount of additional work to harvest
classes along the lines of use cases or related functional- the modifications, retest, and republish, but the new
ity. Nevertheless, there are still vendors out there that components are made available late in the fiscal year.
insist on providing object-level reuse. This is useful New projects have not yet had time to reuse the new
versions of the components.
TABLE 11 Object explosion As the fiscal year ends, Tim once again goes to
upper management to discuss the results of the year
Antipattern Name Object Explosion
and justify next years budget. As he goes through his
Reuse-related Reuse was not achieved with
presentation, Tim indicates that his organization did
motivation or problem traditional programming
it is trying to solve technology, so object technology not reduce its budget but actually overran the budget
is applied. significantly, having to ask his superior a number of
How it is applied New development is to take place times for additional funds during the year. However,
using object-oriented languages. with several reusable components in the reuse library
Developers can reuse classes.
and a number of projects committed to reusing them,
Actual results Developers cannot reuse a single
and unintended class. They must reuse a large
Tim predicted the cost-cutting windfall would happen in
consequences number of related classes, which the next fiscal year. All that was necessary was for the
results in the need to reuse an executives to provide the upfront funding to complete
entire class library. Developers
the start-up of the reuse program.
who do not start their projects by
using the class library are unable The funding board decided to provide a constant level
to reuse until they restructure of funding for Tims organization with the stipulation
their software.
that the reuse program be ended and the compo-
Primary fallacies Introducing reuse at a low level nents provided as-is to the projects that wanted them.
ofgranularity
Dejected, Tim went back to his old way of doing things.
2017, ASQ
www.asq.org 13
Software Reuse AntipatternsRevisited
are often not in the area of reduced costs. Often, the What was surprising is that the study went on to list
greatest benefits are reduction of defects and lower the most important negative factors in software develop-
time-to-market (Poulin 1997). Lower development costs ment productivity. At the top of the list, far above all
do happen, but often not until a few years have passed. other factors, was reuse of poor-quality deliverables.
That is because the initial overhead involved in creating This was the surprising part. This says that reuse, if done
a group focused on systematic reuse are significant in well, can have a very significant boost for productivity.
the first year or so. However, if reuse is done badly, then it can actually hurt
The benefits of reuse are often not seen until a few the development effort. It is critical that any organization
years after starting a reuse program. This is because the seeking to implement systematic reuse do so in a care-
reusable assets must be stable to reap the benefits of reus- ful, well-crafted manner because a badly implemented
ing them. Typically, this does not take place until after approach to reuse will set one much further back than
the asset has been reused a few times, as summarized when he or she started.
by one of Biggerstaffs Reuse Rules of Three: Before To foil the antipatterns described previously, one
you can reap the benefits of reuse, youll need to reuse should use the software reuse patterns. These are:
it at least three times (Tracz 1995). Moral: Systematic 1. Divide and Conquer: Separate the functions
reuse will save money, but not at first (see Table 12). of building, managing, and reusing
components. This shields development
TABLE 12 The cost-cutter organizations from the cost of creating
Antipattern Name The Cost-Cutter
reusable components.
Reuse-related The desire to reduce costs for 2. Publish or Perish: Create a library of assets
motivation or problem a development organization in with multiple, effective catalogs, and push
it is trying to solve the short term by introducing information about assets out to the reuse
systematic reuse
community. This allows reuse organizations
How it is applied The reuse program is sold to
upper-level management as a way to make their assets available in an
to reduce costs in the near term. organized, managed way.
Actual results The start-up costs of starting the 3. Spit and Shine: Make components that
and unintended reuse program eclipse any other
consequences cost savings within the first year
are product quality. By providing product
or so. quality components, the reuse organization
Primary fallacies Assuming that the costs involved will provide a measure of trust that the
with reuse are free or very assets will function as documented.
nearlyso
4. Partner and Build: Build reusable assets by
Related antipatterns None
working with a reuse center. This provides
2017, ASQ
11. Focus, Pinky, Focus!: Dont try to Jones, C. 2000. Software assessments, benchmarks, and best practices.
Boston, MA: Addison-Wesley Longman Publishing Co., Inc.
reuse small things, like objects, but
medium-grained things, like components. Long, J. 2001. Software reuse antipatterns. ACM SIGSOFT Software
Engineering Notes 26, no. 4:68-76. Available at https://doi.org/10.1145/
(Note: the title of this pattern refers
505482.505492.
to an oft-used phrase in the animated
Poulin, J. S. 1997. Measuring software reuse: Principles, practices and
cartoon Pinky and the Brain in which economic models. Boston, MA: Addison-Wesley.
an intelligent lab rat called The Brain
Tracz, W. 1995. Confessions of a used-program salesman: Lessons learned.
is constantly having to deal with a very ACM 20, no. SI:11-13).
unintelligent lab rat called Pinky.) If the
granularity of assets is too small, reusers BIOGRAPHY
will spend a significant amount of time John Long is a business architect and process architect who has worked
combining assets. If the granularity is across many different industries, including healthcare, crop science,
too large, reusers will spend a significant banking, energy, defense, and software. He has written some profes-
amount of time removing functionality sional books, including Process Modeling Style (Elsevier 2014) and ITIL3
at a Glance. Long holds a masters degree in computer science from
from the assets. This pattern will help
the University of TennesseeKnoxville, and he is still hoping to win the
keep the right balance between combining first Nobel Prize in Dad humor. He can be reached by email at j1long@
assets and reducing asset functionality. mindspring.com.
Each of these patterns foils the
antipatterns shown in the mapping
in Table 13. For example, possible TABLE 13 Antipatterns vs. software reuse patterns
remedies for the Used Car Fiasco anti-
PATTERN
pattern include Divide and Conquer (1),
ANTIPATTERN 1 2 3 4 5 6 7 8 9 10 11
Publish or Perish (2), Spit and Shine (3),
Field of Dreams X X X X
or Planning Your Garden (10). Much
Garbage Dump X X X X X X X
more could be written about these
Abracadabra X X X X
patterns, but that could be the subject
High Noon X X X X X X
of another paper.
Used Car Fiasco X X X X
ACKNOWLEDGMENTS Hunter-Gatherer X X X X X X
This article has been reprinted with permission, One Size Fits All X X X
with additional commentary from the author, from Domain Analysis Paralysis X X
Long 2001. The views in this article are those of Object Explosion X
the author and do not necessarily represent the
2017, ASQ
www.asq.org 15