Você está na página 1de 5

Seven Tips for Keeping

Software Development
Projects Healthy
Frank Hurley

I
n the beginning, most soft-
ware development projects Every software
are a joy to work on. development
People are excitedly draw-
ing on whiteboards, developing project goes
use cases, building their UML through
(Unified Modeling Language)
models—it’s the fun part of the unplanned
project. Pretty soon, some ini-
tial code is up and running;
twists and turns.
clients adjust the requirements; These tips help
developers change the UML,
modify code, work out a few
keep things
minor glitches; and soon the on track.
automated tests are giving the
software a virtual thumbs up.
Next, more functionality comes development projects: require- guideline for basic practices that
into play, tests expand to check ment errors, outdated software keep a project on track.The dri-
the new code, developers management methods, poor ving force behind these tips is
implement fixes, and tests finally customer management result- efficiency; developers either
pass. Things are running fairly ing in feature creep, unrealistic ignore inefficient development
smoothly and everybody’s rela- scheduling—the list goes on and processes, or progress slows to
tively happy. on. Recently, new approaches to a crawl. Although these tips
However, toward the end of software project manage- require some up-front work,
the project’s life cycle, the situ- ment—such as UML, XP they are general and open-
ation often changes drastically. (Extreme Programming), and ended enough to apply to any
Requirements have increased various requirements-tracking development project.
and changed, some budgets tools—have addressed some of
have been overrun, time has run these issues.
out, and developers are 100 per- Each of these has its own Tip 1:
cent focused on patching bugs guidelines and caveats, such as
quickly, often leading to more a list of common modeling mis- Keep the human
bugs. Testing is haphazard at takes. But no matter what network up and running
best. Many automated regres- approach or design and devel- Communication problems
sion tests (if there are any) no opment tools you use, problems often crop up during a typical
longer work at all. Brain- can easily topple the delicate project. Developers complain
storming has turned into blame- balance of running a software that management is not clear
storming and nobody’s happy. development project. To pre- about its goals. Management
vent these problems, you should complains that developers are
SO WHAT’S employ good basic-practice not forthcoming about prob-
THE PROBLEM? techniques. lems. Unfortunately, the further
For years, software manage- into the project you are, the
ment texts have discussed rea- BASIC PRACTICES
sons for failures in software The following tips form a Continued on page 60

64 IT Pro July ❘ August 2002 1520-9202/02/$17.00 © 2002 IEEE


PERSPECTIVES
Continued from page 64

more people keep quiet and go on


with their jobs. This behavior occurs
the command line type: cvs update
-d /prog/example.mk; or
Tip 2:
because of the real concern that any • if you don’t like prepending your Constantly look for
suggestions developers have will static final int variables with ‘sFi_’, and plug time/effort leaks
directly affect (read “increase”) their write to Worse than memory leaks,
already overwhelming workload. coding_ptteam@mycompany. time/effort leaks insidiously sap the
A project manager can only resolve com. strength and morale out of develop-
these issues if well-known project pre- ers. An outdated process that man-
requisites—such as firm project goals, Survival guides should evolve and agement still mandates is often the
source control, and so on—are in be republished regularly, ideally as an culprit here; technology can also
place. Even then, communication intranet Web page. Most importantly, waste time and effort.Three examples
gaps occur in situations such as devel- changes should be highlighted. come to mind.
oper turnover or when no one owns a Nothing is worse than reading weekly For one, many projects use UML-
certain design space of the project. updates to a document and trying to modeling tools that go the extra step
Here are a few ideas for building a pick through the whole thing looking of generating code skeletons for
robust human network. for the lone change. developers. This capability has the
Establish point teams. Point teams Use (but don’t abuse) e-mail. E-mail perceived double benefit of saving
resolve conflicts associated with the can be the hero of efficiency when developer time and keeping the
development project. Examples of used properly. In particular, tools such model and the code in sync. However,
conflict include requirements clarifi- as bug trackers that send out an auto- as the project goes into a mode that
cation, coding-style issues, errors in matic e-mail to the owner of the prob- tracks down bugs, the cycle of chang-
survival guides (see the next point), lem space prevent human error from ing UML, regenerating and testing
and changes to a class’ interface. causing unnecessary issues and wast- code, finding more problems, and
Developers contact one member of a ing time. starting the process all over again can
point team with an issue, and that However, too much e-mail can be severely debilitating. At this point
team member delivers an answer. bring productivity to a screeching in the project, it’s often better to get
Normally, projects do have a point halt. Most of us have come into the things working and modify the UML
person (such as a chief architect) to office after a few days off, only to model afterward.
resolve these issues, but often this one spend the first full day back slogging Secondly, when deploying a project
person is heavily overloaded, and the through unread mail. Here are three in a test environment, developers
chances of getting a prompt answer ideas for fighting off the e-mail flood: must often bounce—stop and
are slim. So more often than not, con- restart—each component of the sys-
flict remains unresolved, resulting in • Publish information such as sur- tem. Depending on the project’s size,
inconsistencies throughout the pro- vival guides to an intranet Web site the time required for bouncing can
ject. (as suggested earlier). grow from several minutes to an hour
A point team is most efficiently set • Consolidate announcements into a or more, especially for multitiered
up as an e-mail group, so a disgruntled single, scheduled e-mail. For exam- applications running on more than
person need only send one e-mail to ple, write “new CVS guide is up, one host machine.
the group. Also, one person can interface to the advertisement- To plug these time/effort leaks and
belong to more than one point team. ToXml class has changed, and team other technology-oriented woes, the
Publish survival guides. Survival lunch is tomorrow” instead of send- solution is to pull together a tempo-
guides are short, project-specific doc- ing out multiple messages. Or, rary tiger team (or person) to identify
uments describing how to work on a instead of e-mail, set up internal the problem and propose a solution.
particular project. Examples include newsgroups (or some similar com- For example, instead of having a per-
guides for source control, coding style, munication mechanism) for son sit there and bounce a multitiered,
UML modeling, and point teams. No announcements, topic discussions, multihosted application, it might be
developer comes up to speed quickly and so on. possible to use a script. Such a script
when just given a stack of manuals to • Finish off runaway e-mail threads, can be quite complicated and out of
read. These guides should have spe- which can severely reduce produc- any single developer’s realm, but well
cific examples, such as: tivity. My suggestion is to alert the within the capabilities of a person or
point team that owns the topic team with more cross-functional
• to see the latest system-wide UML under discussion or establish a run- authority.
diagram, open J:\proj\models\ away-thread point team to summa- Finally, consider a situation in which
latest\main.dlg; rize opposing arguments and management requires that develop-
• to get an example make file, from present them for decision. ers not change the production system

60 IT Pro July ❘ August 2002


without checking it into source con- The major culprit—not checking an • Reduced testing effort (and failures).
trol, building it on a development box, input string’s size—has led to numer- Test planners know which functions
and then moving it to production. ous security problems. Most of the or components to create invalid-
Along comes a tough bug, and this time, user interfaces check parame- data tests for, and which ones
process turns hours of work into days. ters after manual testing uncovers assume validated data.
Obviously, you cannot build a pro- problems. But often, the developers • Increased code efficiency. Functional
ject of any magnitude without some of internal functionality assume that contracts prevent data validation in
process, but a rigid process can often data passed to them is valid, an overly more than one place. However,
override common sense. One solution optimistic assumption. On the other increasing robustness can require
is to establish a point team to collect hand, having functions check all checking data validation in more
opinions about the process. Even if parameters all of the time is ineffi- than one place in the system.
long-term benefits outweigh public cient. • Increased code reliability. Invalid
opinion, the point team should clearly In 1985, Bertrand Meyer developed data never makes it into the pro-
publicize that decision. Keeping peo- the Eiffel programming language that duction testing, preventing it from
ple in the dark often causes mistrust mandated functional contracts, which wreaking havoc on the system.
and, more importantly, substandard define and assign responsibility (to
work output. the function’s caller or the function
itself) for validating parameters. Tip 4:
“Function” can literally refer to a pro-
Tip 3: grammatic function or a larger system Test early, but not too early
component (for example, the B2B The golden rule of “test early, test
Establish functional exchange server). Any development often” is golden for good reason but
contracts (who checks what) project can use this concept of func- often misunderstood.Although some
Invalid input data can cause big tional contracts and reap three major projects start off with well-defined
problems in software development. benefits: requirements (such as “play the

Get access
to individual IEEE Computer Society

documents online.

More than 57,000 articles

and conference papers available!

US$9 per article for members

US$19 for nonmembers

http://computer.org/publications/dlib/

July ❘ August 2002 IT Pro 61


PERSPECTIVES

DVD” or “fly the airplane”), many do quite literally to unit testing. Follow tion, testers often repeat many steps
not.They may look like they do, but as the XP approach of writing tests to return to the state where the error
the project progresses, new require- before the code for functions, public condition occurred. Each of these
ments creep in, the user interface class methods, and so on. Ensure that steps can be time-consuming and are
changes, reports need new fields, and these tests cover all error conditions often easily automated. So supporting
so on. Often, automated tests designed that can arise. Build or use stub code the test team with automated tools
to test the system according to the for dependencies (see tip 7, which fol- can greatly increase its efficiency.
original spec are constantly playing lows) so that the test can control what Scripting tools, such as those writ-
catch-up with the new system code. is returned to it. Use a code coverage ten in Perl or Visual Basic, can inter-
Generally, you should develop high- tool to gauge how well tests check the rogate databases, scan log files, and
level test plans early in the project, code. Remember the second golden then calculate and combine as neces-
with test cases such as “enter the rule of testing:“Assume code that has sary to present useful information to
order, then cancel it, then reenter the never been executed is broken.” the tester. They can also perform
order.” Early on, avoid explicitly repetitive tasks to return to a specific
detailed test cases, such as “enter state. For example, the script could
‘04356’ in the SKU field, hit the Tip 5: login a test user, go to a specific prod-
‘Submit’ button, then hit the ‘Cancel uct screen, select several products, go
order’ button.” Although they might Support manual testing to the order screen, then stop and let
apply to an early system, such detailed with automated tools the tester take over. Depending on
test cases can fall by the wayside as To maximize information about a the tester’s technical knowledge, these
the project progresses. Even worse, bug, manual testers often go beyond scripts will require a developer’s time
coding this detail into an automated the user interface, especially when and effort to implement. But testers
test too early in the project will cer- testing a complicated, multitiered should develop what the script does,
tainly become wasted effort. Save application. They will check log files, and in many cases they can also sup-
detailed automated regression tests database information, and other port and modify these scripts.
for when the project has stabilized. sources to determine the state of the
The golden rule, however, applies system. To duplicate an error condi-
Tip 6:
Sign Up Today Use automated code
checkers/generators
for the IEEE Modern software development
involves the use of many other soft-
Computer ware tools to aid the development
process. From yesteryear’s Case tools
Society’s to today’s UML modeling tools, rapid-
application-development tools,and the
e-News “wizards” integrated development
environments,these tools increase pro-
ductivity by eliminating manual work.
Be alerted to Building custom tools to parse code
and automatically perform tasks that
• articles and otherwise take up time during code
special issues reviews or, worse, debugging sessions,
can extend this idea. These custom
• conference news tools can be a tough sell, because
building them often involves a lot of
• submission and
up-front work, but the payoff is well
registration deadlines
worth it.
• interactive forums Automated code checkers/genera-
tors provide three major benefits:
Available for They enforce a coding style, catch cod-
FREE to members. ing errors, and generate test skeletons.
computer.org/e-News Enforcing coding style. Any software
development project involving two or

62 IT Pro July ❘ August 2002


more people requires a coding style developing such tools and their poten- stub code requires code changes on
(such as Hungarian notation), and tial benefits. The more complex the the dependent’s part, it won’t be
many books have emphasized the rea- tool,the more time and energy you will worth it. For example, do not name
sons for adopting a style. However, spend to develop, debug, and support the stub code for OrderFulfillment
these standards are typically enforced it. So choose the problems you solve something else, like OrderFulfillment-
during code reviews;a fact that kills the with automation wisely. _stub, or name it in another name-
review’s efficiency. It’s better to use a space. Naming can be tricky, but
tool that parses the code and checks clever use of location facilities (such
that developers have followed the cor- Tip 7: as CLASSPATH for Java) can make it
rect naming conventions (among other possible to name stub code without
things) than to spend person-hours on Write stub code where requiring changes to dependent
such routine checking. possible classes.
Catching coding errors. Besides Stub code acts like real code with-

A
checking for coding policy, such a tool out doing very much. The advantage s mentioned earlier, I don’t
can also perform limited checking for behind stub code is that developers intend for these tips to replace
code known to cause problems. For who depend on another class that is the need for well-known pre-
example, in some cases, Java code for still under development can continue requisites in software development,
a servlet cannot use any class instance working if stub code for that class is such as clear requirements, reason-
variables. The solution is to build a available. able scheduling, and so on. But these
tool that automatically detects and For example, a class ProductOrder tips will help keep a basically sound
flags these conditions and to run this might need a class called project running smoothly. ■
tool for all project code as part of a OrderFulfillment. Depending on
normal build process. resource scheduling and the complex-
Generating test skeletons. As it is, ity of each class, ProductOrder may be
having to write unit tests drags on ready to use OrderFulfillment before Frank Hurley is a senior consultant at
developers’ time; make their lives a it’s been developed. However, if devel- Cigital in Dulles, Va. Contact him at
little easier by automating at least part opers initially write OrderFulfillment fhurley@cigital.com.
of the task. For example, a Java pro- as stub code, methods like
ject that contains the class IsOrderShipped can just return True For further information on this or any
XmlOrderAdapter could have a instead of checking the database. other computing topic, visit our Digi-
script that creates XmlOrder For stub code to be effective, it must tal Library at http://computer.org/
Adapter_test, which subclasses JUnit look just like the real code. If using publications/dlib.
and contains a call to each method of
the class. The developer still needs to
fill out the code but the script saves Circulation: IT Professional (ISSN 1520-9202) is published bimonthly by
the effort of creating another file and the IEEE Computer Society. IEEE Headquarters, Three Park Avenue, 17th
putting in the method calls—it’s not a Floor, New York, NY 10016-5997; IEEE Computer Society Publications
very time-consuming task, but every Office, 10662 Los Vaqueros Circle, PO Box 3014, Los Alamitos, CA 90720-
little bit helps. 1314; voice +714 821 8380; fax +714 821 4010; IEEE Computer Society Head-
As mentioned earlier, these auto- quarters, 1730 Massachusetts Ave. NW, Washington, DC 20036-1903. Annual
mated tools involve plenty of work, subscription: $38 in addition to any IEEE Computer Society dues. Nonmem-
ber rates are available on request. Back issues: $10 for members, $20 for non-
but the time saved in catching errors
members. This magazine is also available on microfiche.
that would otherwise cause hours or
days of debugging makes the effort Postmaster: Send address changes and undelivered copies to IT Professional,
worthwhile. Rather than building IEEE Service Center, 445 Hoes Lane, Piscataway, NJ 08855. Periodicals
Postage Paid at New York, N.Y., and at additional mailing offices. Canadian
these tools from scratch, you can buy
GST #125634188. Canada Post Publications Mail (Canadian Distribution)
one of many third-party parsing prod-
Agreement Number 1445669. Printed in USA.
ucts and configure and extend it to do
the job. Editorial: Unless otherwise stated, bylined articles, as well as product and
service descriptions, reflect the author’s or firm’s opinion. Inclusion in IT
For example, JavaCC is a freeware
Professional does not necessarily constitute
package for parsing Java (and other
endorsement by the IEEE or the Computer
languages) and is extendable. C/C++ Society. All submissions are subject to editing
code checking tools such as lint help for style, clarity, and space.
catch errors early.Also, you must strike
a balance between the complexity of

July ❘ August 2002 IT Pro 63

Você também pode gostar