Вы находитесь на странице: 1из 12

SOFTWARE REUSE

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

Editors Note: Although this article was originally published in


2001, many of the experiences associated with the practice of
software reuse continue to resonate today. In addition to leverag-
ing open source libraries, many organizations have policies or
informal practices supporting code sharing and reuse. We are
honored that the author has also provided a retrospective on this
article, sharing his additional perspectives and insights on this
topic from the nearly two decades since this originally appeared
in print. The new commentary appears at the end of this article.

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.

4 SQP VOL. 19, NO. 4/ 2017, ASQ


Software Reuse AntipatternsRevisited

INTRODUCTION Systematic reuse involves the repeated use of software


to build new systems or extend existing systems, resulting
Software reuse is nearly as old as the software profession in some significant benefit. These benefits may include
itself. I can remember my days in college working with improved quality, reduced cost, improved schedules,
keypunch cards. If I needed to create a new program, or enhanced maintainability. To carry out systematic
I often reused individual keypunch cards in my new reuse, software organizations must undergo significant
program. This was often necessary, since the first few organizational, process, and compensation changes.
cards were in a complex language that allowed my program Otherwise, reuse will remain just a dream.
to be readable by the mainframe computer I was using.
(Students from the old keypunch days will remember job
control language, or JCL.) These cards contained ones WHAT ARE REUSE
name, student ID, and a variety of codes. Students never
really understood what was on these cards, but they reused
ANTIPATTERNS?
Many different software organizations have attempted
them because their programs did not run without them.
systematic reuse in the past, with often disappointing
That was reuse in the small. In other words, I was
results. This is because they attempted to solve the
just getting some small tactical benefit out of reusing
problem with what I call reuse antipatterns.
bits and pieces to make my next program.
Before I can define the term antipattern, I need to
Years later, as a graduate teaching assistant, I taught an
define what I mean by pattern. A pattern is an answer
introductory computer science class to business majors.
to a significant, recurring problem. Patterns are different
Their first assignment was a simple program that used a
from good ideas (Coplien and Harrison 2005) because:
single loop and some print statements. When my students
turned in their assignments, they all looked pretty similar. A pattern solves a problem. It is not just an
After all, it was a very simple assignment. However, I had abstract or theoretical approach to a problem.
to give a failing grade to one student who had obviously A pattern has a proven track record. It has
reused the entire set of keypunch cards of another been demonstrated to solve a problem.
student. He had copied the single comment line used by the The solution is not obvious. Many problem-
other student, as well as the control cards at the beginning, solving techniques (such as software design
which contained the other students name. That was not paradigms or methods) try to derive solutions
only reuse in the small but reuse in the boneheaded. from first principles. The best patterns
Today, of course, programmers still practice reuse in generate a solution to a problem indirectly
the small. Programmers create modules and objects that a necessary approach for the most difficult
they may hand over to another programmer down the problems of design.
hall to use in creating their next system. As valuable as
A pattern describes a relationship. Patterns
this might be to the typical programmer, the benefits of
do not just describe modules, but describe
reuse in the small pales in comparison to the prospect
deeper system structures and mechanisms.
of reuse in the large, also called systematic reuse.
One of the first jobs I ever had was with a large defense The pattern has a significant human
contractor. One of the companys specialties was combat component.
simulations for the U.S. Department of Defense. The An antipattern is similar to a pattern except it is an
company primarily built air-to-air combat simulations obvious but wrong solution to a problem. Antipatterns
involving aircraft, but it reused these simulators to build have been tried over and over again with the same
ground combat simulations involving infantry and tanks. result: failure. Nevertheless, these antipatterns will be
This was reuse in the large. Years later, I was talking tried again by someone simply because they appear to
to an individual who had been on the receiving end of be the right solution.
one of these simulations. He said the ground combat Antipatterns were first introduced by Michael Akroyd
simulation was a good one, but he noticed that the tanks in a presentation at the 1996 Object World West confer-
could somehow mysteriously fly across lakes and other ence (Akroyd 1996). It was created as a reaction to the
bodies of water. Obviously, this was not only reuse in pattern literature that had been floating around since the
the large, but also reuse in the absurd. early 1990s. By 2001, antipatterns had been the subject

www.asq.org 5
Software Reuse AntipatternsRevisited

of a number of collaboratively authored books (Brown et TABLE 1 Format for antipattern


al. 1998; Brown, McCormick, and Thomas 1999; Brown, definitions
McCormick, and Thomas 2000).
Following is a list of many of the reuse antipatterns Antipattern Name
I am aware of, but first I need to define a few terms Reuse-related
motivation or problem
related to reuse: it is trying to solve
Component: A source code or executable How it is applied
that is designed for reuse and manipulable via Actual results
aninterface. and unintended
consequences
Asset: Any artifact that may be reusable. An
Primary fallacies
asset might include source code, executables,

2017, ASQ
Related antipatterns
designs, requirements, test cases, test data,
templates, or other development work that is Key words

storable in electronic files. Components are


just one type of asset. The problem of reuse antipatterns begs for a resolu-
Systematic reuse should focus on reuse of specific tion to the antipatterns, which are simply called reuse
types of assets, and component reuse is just one type patterns. Amblers article identifies a number of reuse
of reuse. It should be noted that components are source patterns, but again in an abbreviated form. The end of
code or executable assets specifically created for reuse. this article identifies a number of reuse patterns as well,
I will use these terms in the following antipattern but does not describe them in depth due to the length
descriptions. For those in the patterns community, of the material.
these antipatterns are just representative scenarios, not
formal antipattern descriptions. The antipatterns are:
Field of Dreams
ANTIPATTERN DEFINITIONS
Garbage Dump Field of Dreams
Abracadabra In a hit film years ago, Kevin Costner is a farmer in the
Midwest, wondering how he will keep his struggling
High Noon
farm going. A mysterious voice whispers, If you build
Used Car Fiasco
it, they will come. Somehow, he realizes he is supposed
Hunter-Gatherer to build a baseball diamond in the middle of his corn
One Size Fits All field. Reluctantly, he obeys. By the end of the movie, a
Domain Analysis Paralysis long line of cars is waiting to get in to see baseball games
Object Explosion take place on his diamond.
One of the most oft-repeated mistakes experienced
Of Course its Reusable!
by any organization starting a reuse program is to think
The Cost-Cutter that all it needs to do is create a reuse library, a place to
Each antipattern will be described in two ways. First, put its reusable assets. This is usually the result of grass-
there will be a textual overview of the antipattern, which roots thinking. If we just create a repository someplace
will primarily be of interest to the general audience. where people can find our little code snippets, they will
Second, there will be a more formal antipattern defini- be beating down the door to use whats in there, so the
tion, which will use the template in Table 1. thought process goes. In other words, If you build a
It should also be noted that Scott Ambler first created a reuse library, they will come.
set of antipatterns for reuse in the February 2000 issue of A few hot-shot programmers contribute some of the
Software Development magazine (Ambler 2000). However, code they have used successfully. Others volunteer to
his article did not formally define the antipatterns. In addi- run the library on their own. They take the code, put it
tion, his antipatterns were somewhat short. This article into zip files, and place it into a library on the file system.
addresses many of the same issues but provides more Several internal messages are broadcast, proclaiming a
description and rigor to the definition of the antipatterns. reuse repository is about to be initiated.

6 SQP VOL. 19, NO. 4/ 2017, ASQ


Software Reuse AntipatternsRevisited

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

Related antipatterns Garbage Dump


Actual results After some initial use, there
Key words Repository and unintended is great reluctance to use the
consequences repository.
Primary fallacies Assuming the quality of the
Garbage Dump reusable asset does not matter;
not providing sufficient capability
The next common fallacy is related to the previous to browse, search, and find assets
one. In this scenario, the role of the reuse repository is of interest amid a large number
of assets
greatly expanded. You know, there are lots of things
2017, ASQ

Related antipatterns Field of Dreams


that can be reused, beams the department manager.
Its not just code. We can reuse test cases, designs, Key words Repository, catalog

www.asq.org 7
Software Reuse AntipatternsRevisited

Abracadabra No, Jack. We can still call it reusable. Its gotta be


reusable to somebody. Just meet your deadline even if
The process of creating highly reusable assets is so very
we have to dump some functionality. Jack begins to
different from the process of traditional software develop-
walk out the door and turns. Steve, will we ever get to
ment that many high-level managers often just throw
make these components really reusable?
their hands up in confusion and declare that the results
Someday, Jack. Someday. After weve got a few
of the next software development effort will be reusable.
releases out, maybe we can focus on reuse. The result
Abracadabra! Presto! Change-o! Reuse will happen!
was that the development teams got very little benefit
This may sound ludicrous, but this is sometimes the
from reusing the software. They did not get much
intention of executives not well-versed in systematic reuse.
reuse, because they did not make that an explicit goal.
Consider an executive named Steve who announced
If a company does not plan for reuse, it will not get much
to his organization that they were now going to create reuse. Moral: If a company does not focus on reuse, it
reusable components for other groups to reuse. All just will not happen (see Table 4).
of Steves managers agreed that this was a worthwhile
mission and agreed to get started implementing the
necessary changes. A few months later, Steve is visited High Noon
by Jack, one of his managers, who says, Steve, you gave The major problem with the Abracadabra antipattern is
my department the objective of creating components for that some managers just assume reuse will happen if they
the Yangtze.com project, right? simply state that reuse is going to happen. Of course,
Yeah, Jack pauses, wondering whats next. not all managers are so naive. Some managers actually
Well, you only gave us two months to create these go that important step and tell their subordinates to
components, Steve continues. These are supposed to reuse each others code. This type of manager makes
be reusable components. Components that other groups the assumption that merely telling others to produce
can reuse besides this project. We dont have time to reusable code will result in actually doing so.
make these reusable. We barely have time to get these The scenario often goes like this. Executive Ed brings
out the door as it is. his managers into a strategy session. During that time,
I understand, Steve, but were running on internet he outlines that he wants to get the benefits of software
time here. We have to get these components out ASAP, reuse. To do this, all of his managers must reuse each
replies Jack. others code. They all leave the session later, determined
Well, can we at least drop the reusability require- to make the reuse work.
ment? asks Steve. Bob, a manager with the FooBar project, is eager to get
his project started with some form of reuse. So, he calls
TABLE 4 Abracadabra around to the other managers. Do you have anything I
might be able to reuse? he asks. No, they tell him, but
Antipattern Name Abracadabra theyre all ready to reuse anything he might come up with.
Reuse-related A high-level manager feels As time goes on, Bob realizes that he just has to create
motivation or problem frustration that no one will reuse
his application from scratch. He considers making his
it is trying to solve the software of other groups.
code available to others, but it is too specialized for them
How it is applied The organization does not have
time for reuse now. Employees to use at the present, he does not have the resources to
are told to go ahead and develop make it more generic, and he does not want anyone to
software and that in the future ask him to make changes to it. Doing anything to further
lots of groups will be reusing the
software because of how good it is. its reuse would take away resources from his project,
Actual results There is little actual reuse due which is already under time and resource pressures.
and unintended to inadequately enabling groups Although he might help someone else, he knows that
consequences toreuse. he is evaluated on how well he finishes the project hes
Primary fallacies No actual focus on reusejust talk; on, not on how much he helped someone elses project.
executive leadership is also missing.
Weeks later, when Mary, another project manager, asks
2017, ASQ

Related antipatterns High Noon


Bob if he has anything she might be able to reuse, he
Key words Management
pauses, but answers no. He has nothing he can offer.

8 SQP VOL. 19, NO. 4/ 2017, ASQ


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

Related antipatterns Abracadabra


motivation or problem another group believes it
Key words Incentives, process, management it is trying to solve couldreuse.
How it is applied The software is made available
as-is from the originating group
Used Car Fiasco without any determination of how
reusable it is.
Lets return to the previous story and consider a differ- Actual results The reusing group finds that the
ent outcome. Bob has conscience pangs and decides to and unintended software has numerous bugs
make some of his software available for reuse after all. consequences that require significant effort to
fix. The originating group is not
He calls Mary back and tells her about a few programs
interested in making bug fixes,
that she might be able to do something with. He promises so the reusing group has to do it.
to have one of his developers call her technical lead to However, the software continues
arrange for a transfer. to have bugs, so the reusing
group just abandons the software
The transfer takes place, and Marys technical lead, and starts from scratch.
Chen, finds some useful conversion software to reuse. Primary fallacies Not testing the software and
He plugs it into his application and starts testing. It certifying its reusability rating
seems to work fairly well with the few tests he tries, before making it available
forreuse
although he does have to make a few bug fixes. Weeks
2017, ASQ

Related antipatterns None


later, during integration testing, Chen finds that there are
some inconsistent results coming from the conversion Key words Testing, certification

www.asq.org 9
Software Reuse AntipatternsRevisited

Hunter-Gatherer Afterwards, a number of people who were familiar


with that configurator came to me, with desperate looks
Many primitive cultures consisted of what anthropolo-
on their faces, trying to persuade me not to reuse the
gists call hunter-gatherers. These hardy individuals
configurator. It is really, really bad code, I was told by
lived completely off what the land provided them. This
one individual. Really bad stuff. Youll have to rewrite at
might include hunting animals and/or gathering whatever
least half of it. If you want to make it reusable, its best to
berries or wild fruits and vegetables could be found. If
start over. Needless to say, I gave up that project. Only
conditions got such that they could no longer find what
software that is of good quality may yield good results
they needed, they moved on.
when harvested for reusable components.
The hunter-gatherer evokes a vision of the noble sav- In the same way, a farmer can yield a bountiful harvest
age, roaming across the forest and plain, searching for if he prepares his field, plants the seeds in an orderly
his daily provision. Needless to say, land was not really way, keeps out the weeds and bugs, and harvests at the
settled by these types of people. It wasnt until farming right time. Organizations that attempt to reuse without
and trade came along that a land could permanently changes in organization, quality, and planning often
be populated by a group of people. Harvesting in the end up as groups of hunter-gatherers. Moral: Harvesting
wild may have been adequate for primitive cultures, reusable software only yields good results if it is planned
but organized and planned harvesting (that is, farming) for (see Table 7).
yielded much more powerful results.
This is similar to what happens in an unorganized
reuse effort (also called opportunistic reuse). To reuse TABLE 7 Hunter-Gatherer
software, a project team must sift through a lot of software, Antipattern Name Hunter-Gatherer
looking for those few good parcels of code, bypassing Reuse-related A project team wants to extract
lots of other stuff that just doesnt have value. It takes motivation or problem software from one application to
quite a bit of time, since a code harvester must try to it is trying to solve use in a new development effort.

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

10 SQP VOL. 19, NO. 4/ 2017, ASQ


Software Reuse AntipatternsRevisited

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

Related antipatterns Hunter-Gatherer


genericizing the software so it can
Key words Harvesting be used by practically any user.
Actual results Advanced developers decide

One Size Fits All and unintended


consequences
against using the software
because it is too cumbersome.
After using my gas grill for a few seasons, the burner They believe they could write their
own analogous software from
needed to be replaced. It was a combination of rust and scratch that would be a lot simpler.
built-up grease gunk, which made it only partially useful. Primary fallacies Adding too many levels of
There were no dealers in my area who carried my brand, abstraction and not constraining
so I looked in the hardware stores for similar parts. the scope of reuse
I found a burner that was the same size as my grill, Related antipatterns None
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

12 SQP VOL. 19, NO. 4/ 2017, ASQ


Software Reuse AntipatternsRevisited

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

Related antipatterns None


Unfortunately, many developers and managers are
Key words Object, class, library, granularity
unaware that the most dramatic benefits from reuse

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

Key words Benefits, costs, quality, time-to-


market, funding a cost-effective way of providing needed
assets in a timely manner by overcoming
the primary objection to creating reusable
RESOLVING THE componentswho pays for it.

ANTIPATTERNS 5. Show Me the Money!: Show the real,


measurable benefits of reuse. Simple,
If one were only left with the reuse antipatterns, one
compelling financial reuse metrics enables
would probably never see anyone implement systematic
executive sponsorship.
software reuse. Many organizations have become so
discouraged about past reuse efforts that the term 6. Buy-In: Transform the culture from the top
reuse has become a negative word. This is a serious to the bottom. Implementing systematic
problem. In a study by Jones (2000), the most important reuse typically requires radical changes in a
positive factors in software development productivity business environment.
were listed. At the top, far above all other factors, was 7. Control Thyself: Dont make everything
reuse of high quality deliverables. This is significant, reusable. Without constraints on what is
but not necessarily surprising. made reusable, costs will go out of control.

14 SQP VOL. 19, NO. 4/ 2017, ASQ


Software Reuse AntipatternsRevisited

8. Plan and Stand: Determine how REFERENCES


reusable assets fit together. Architectural Akroyd, M. 1996. AntiPatterns: Vaccinations against object misuse.
management is needed to help reduce or Object World West, San Francisco, CA.
control redundancy in assets. Ambler, S. 2000. Thinking objectively: Reuse patterns and antipatterns.
9. Move Back, Move BackOops!: Make Software Development 8, no. 2:60.
assets general and abstract, but not too Brown, W. J., R. C. Malveau, H. W. McCormick, and T. J. Mowbray. 1998.
AntiPatterns: Refactoring software, architectures, and projects in crisis.
much. Assets that are too generic are
New York, NY: John Wiley & Sons, Inc.
often difficult to customize.
Brown, W. J., H. W. McCormick III, and S. W. Thomas. 1999. AntiPatterns
10. Planning the Garden: If one wants to and patterns in software configuration management. New York, NY: John
harvest, he or she has to plan the garden. Wiley & Sons, Inc.
In the same way, if one wants to harvest Brown, W. J., H. W. McCormick, and S. W. Thomas. 2000. Anti-patterns
reusable assets, upfront planning must project management. New York, NY: John Wiley & Sons, Inc.
occur to ensure created components will Coplien, J. O., and N. B. Harrison. 2005. Organizational patterns of agile
be valuable to the harvesters. software development. Upper Saddle River, NJ: Pearson Prentice Hall.

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

Of Course its Reusable! X X X X X


views of authors current employer, Blue Cross Blue
The Cost-Cutter X X
Shield NC.

www.asq.org 15

Вам также может понравиться