Escolar Documentos
Profissional Documentos
Cultura Documentos
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
Get access
to individual IEEE Computer Society
documents online.
http://computer.org/publications/dlib/
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
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