Beruflich Dokumente
Kultur Dokumente
PR nit T
BE TIC ting
U
AC es
ST ES
:
VOLUME 6 • ISSUE 1 • JANUARY 2009 • $8.95 • www.stpmag.com
8
COV ER STORY
The Chart That Saved The World
(and other assorted fables)
Knowing where a project stands is central to success. The Project Progress
Viewer chart might save your world (and your bacon). By Robert Vanderwall
15 Better Code is
Reusable Code
Not a fan of leftovers? You might be if
you were the cook. Here’s a lesson
about building reusable code from a
company that specializes in reusable
code competition. By Sean Campion
Depar t ments
20 Going Bananas
To Automate
Engineering Quality
4 • Contributors
Get to know this month’s experts and the
best practices they preach.
4 • Feedback
Function testing’s no monkey business, It’s your chance to tell us where to go.
nor is automating the practice. Even
more of a jungle is doing it in the 5 • Editorial
healthcare industry. By Rex Black, Between me and Big Brother, we
Daniel Derr and know everything.
Michael Tyszkiewicz
28 • ST&Pedia
Industry lingo that gets you up to speed.
25 How to Scale
Mt. Automation
As with any great and arduous journey,
29 • Best Practices
As is true in so many other areas of life,
size matters in unit testing. By Joel Shore
Between Me
VOLUME 6 • ISSUE 1 • JANUARY 2009
EDITORIAL
Editor Editorial Director
Edward J. Correia Alan Zeichick
The complete
Strategy Define Development
application Plan Launch Operate
/design /test
lifecycle
Project and
programs
Portfolio
management
Re-use
New deployment
Fix/patch Fix/patch Fix/patch
Demand
Mirror release Mirror release
Central to the HP approach is the concept of Equally important, the HP approach is the first to
“strategic control points” in the application truly integrate security into the QA process. Rende
lifecycle. These critical activity or decision points adds, “All too often, security initiatives have been
sanity-check downstream business and technical perceived as separate from—or even working in
consequences at every stage of the application opposition to—traditional QA goals. Managing
lifecycle. “…it might make little difference in quality along the entire application lifecycle helps
the end if the application is written in Java™ companies control costs and risks while ensuring
or .NET,” says Rende, “but it is critical that the that their software applications are aligned with
business requirements are established properly, the the business goals.”
application is validated against those requirements,
and that there is traceability to ensure that the Get the details
functionality, performance and security outlined
HP Software can help your organization get
in the business requirements is what was
beyond “quality management as usual” and
delivered in the final application.”
make the move to the real application lifecycle.
By optimizing the functionality, performance and
security of applications, IT can have a direct
impact on business results. For details about HP’s
ALM offerings visit www.hp.com/go/alm and
download the white paper entitled “Redefining
The Application Lifecycle.”
Portfolio
management
Re-use
New deployment
Fix/patch Fix/patch Fix/patch
Demand
Mirror release Mirror release
T he goal of software development is to release a fully functional and the quality in terms of the number
of tests passed. For this project, the
product on time and with high quality. To do this, the team needs number of function points expected to
to know if and when the product is fully of quality achieved while adding features be delivered is 100. Each function point
functional and of high quality. But just to the product. And finally, the time has about 3 test cases, so the expected
knowing the current quality and func- aspect is useful for knowing how quick- number of test cases is 300. We now
tionality is not enough; you must also pre- ly features are being added and if the have a target to shoot for. The data in
dict whether you can achieve both by the required features can be added given Table 1 was collected over the first 6
release date. And knowing the function- the remaining time. weeks of the project, which was expect-
ality and quality history provides the back- ed to last 12 weeks. The Functionality
ground to make these kinds of predic- Introduction to the Chart Index column shows the number of
tions. This was the motivation for the Figure 1 (next page) shows the history function points completed at the end of
Project Progress Viewer chart. of the quality and functionality of a proj- the week. The Quality index column
The PPV rolls up three aspects of the ect. A graph provides clear insight into shows the number of test cases executed
project into a single, easily understood these factors more quickly and impact- and passed by the end of the week.
chart. The first is functionality, which fully than a table of raw data ever could. By examining the table (and doing
easily displays how many new functions To illustrate this, let’s look at a project some mental gymnastics), you’ll even-
or features are added during a given from the fictional Acme Corp. This tually see that things don’t look good for
project. The second aspect is quality; it company measures the functionality of this project. For instance, only 35 out of
is equally useful to understand the level the product in terms of function points 100 function points are finished, yet
we’ve burned 6 out of 12 weeks allowed. in a weighted sum. FIGURE 1: HISTORY OF THE PROJECT
You can gain insight by looking at this The quality index
table, but it requires a good bit of men- (QI) is the measured
tal effort, especially when there are more quality. In the example,
numbers, the numbers are larger, or they the only contributor is
don’t fall on nice clean boundaries, like the number of test cas-
Functions
35/100. es that passed. Factors
Now let’s put the same data into visu- such as code coverage,
al form. I’ll use the PPV chart to plot number of unit tests, or
the quality and functionality of the prod- failure-free operating
uct over time. The x-axis represents hours may also be con-
sidered. Again, multiple
TABLE 1: RAW DATA FOR THE
ACME CORP. PROJECT factors can be combined
in a weighted sum. Note Tests Passed
Week Functionality Quality that quality is a subjec-
index index
1 10 6 tive thing to measure, and whatever con- sion. Again, this tool is for understand-
2 14 24 tributing factors are chosen will likely be ing the general direction of the project,
3 20 48 argued or dismissed. The point is that this not for precise control.
4 26 72 tool is not a precise instrument, but rather Another consideration with the target
5 28 102
6 35 126 a visual aid that helps provide insight into is that it is likely to move. New feature
12 (Target) 100 300 the direction of the project. requests, market demands, and tech-
For the chart, the numerous meas- nologies all affect the target. For this rea-
functionality delivered by the project; it urements of FI and QI are connected in son, a revised target should be determined
is calculated by summing the weighted temporal sequence to produce the pro- periodically. It’s convenient to track the
contribution of various factors. In this ject’s path. Each diamond on the line motion of the target as well as the current
example, the only contributor is the represents data for the week. It becomes target so that it’s clear how it migrates.
number of function points. The y-axis obvious that the second week was a slow The light green circle in Figure 2 shows
represents the quality of the product week, relative to others. This observa- the original target and it becomes clear
being delivered. It is also calculated tion could prompt further questions and when feature creep affect the project.
using a weighted sum of several con- investigation. If cost were irrelevant, the target
tributing factors. In this case, the only The Target is shown as a green cir- would be the entire area with function-
contributing factor is the number of test cle and represents the set of acceptable ality larger than some minimum and
cases run. solutions. These solutions, (i.e., possible quality greater than some other mini-
At a glance, you can easily see the same project outcomes) satisfy the marketing mum, (i.e., the upper right quadrant of
information that required some effort to requirements for functionality and the the graph shown in pale green).
derive from the table. Even to the unini- customer demands for quality. The final However, solutions that are to the right
tiated, the graph clearly shows that the values for all the contributing factors of and above the target are achieved at
project is behind schedule. Understanding must be understood from sources such higher cost. That is, if a project ends up
the specifics of the message may take some as requirements, marketing and project in the upper right region, but passes the
explanation but once that is understood, management organizations. Once the target zone, it will have achieved the
even a quick glance at the chart yields a needed values for the contributing fac- desired goals, but perhaps will have wast-
wealth of information. tors are known, the target is determined ed money by producing functionality or
using the same weighting formula that achieving quality that is not necessary
Project Data Line was used to find the path of the project. to the customer.
The project’s Current Data (the dark, Notice that the target is
FIGURE 2: THE MOVING TARGET
solid line) shows actual measurements not a point in space,
made at multiple times in the past. but rather an area of
Each week, for example, the function- extent. This indicates
ality index and the quality index are that many project
calculated based on the contributing results are acceptable
factors. The functionality index (FI) is solutions. It’s possible
the delivered functionality and is the to release a viable prod-
weighted sum of various contributing uct with a few less or a
factors that can include counts such as few more features and
delivered function points, as in the still satisfy customer
above example. While a function point demands. There are
count is arguably the most reliable subtleties and com-
functionality measurement, other fac- plexities associated with
tors may include the number of knowing which features
screens, the number of defect fixes, or are really critical, but
performance improvement metrics. that’s the topic of a
The multiple factors can be combined whole different discus-
FIGURE 3: PATH PROJECTIONS respect to time. The ed by the two cones, each cone showing
velocity of a project can a different scenario. The lower cone indi-
be found by determin- cates a situation in which the functional-
ing how much progress ity has been achieved, but the quality has
has been made in a giv- not. In this case, more testing will likely
en time period. The be required and more effort will need to
amount of time be spent repairing defects before the prod-
remaining for the proj- uct is considered ‘deliverable.’ Of course,
ect to complete is mul- market forces, windows of opportunity
Projection Lines and the tiplied by the previous velocity, yielding and customer demands need to be con-
Predicted Path Cone the line length. That is, it shows how sidered before using this chart to delay a
The predicted path cone is similar to much progress is expected in the product.
that used in hurricane tracking charts. remaining time. The upper cone shows a situation in
It tells us the expected path of the proj- The leading edge is a line between the which the functionality has been
ect with a given confidence. In the case high and low boundaries. This leading achieved and the quality has been sur-
of the PPV, we have a 90 percent confi- edge indicates a span of likely outcomes passed. It’s likely that the project expend-
dence that the project will remain with- and completes the cone. This completed ed unnecessarily and overachieved qual-
in the cone. The cone consists of four cone now represents, with 90 percent con- ity at possibly little benefit. If there had
parts: fidence, the possible end positions of the been a percieved benefit to the higher
1. Expected Line project after the remaining time has quality index, then the goal would like-
2. High Edge elapsed. ly have been set higher to reflect that.
3. Low Edge Throughout the life of the project, as On the other hand, if this higher quali-
4. Leading Edge new data is gathered, all of the projec- ty was achieved at the same cost, this
The Expected line, in solid cyan, tions and the resulting prediction cone could be indicative of some process
shows an extension of a best-fit approx- should be continually recalculated. Using improvement.
imation (linear regression) of the data. a spread sheet makes this work less In both cases, you can get some deep
In the example, the first six weeks saw tedious. insight into the workings of the project,
the functionality grow to 35, yielding a but this insight cannot be found by look-
rate of 5.8 per week. During the same Line Types ing at the PPV in isolation. You’ll need to
time, the quality index grew to 126 for Since we now understand how the PPV interpret the chart in the full context of
a rate of 21 per week. The expectation for was constructed, let’s look at what we the project.
the change in functionality can be found can learn from the shape of the project Figure 5 shows two more situations,
by multiplying the remaining time, 6 path. Figure 3 shows three different in both of which the quality objective was
weeks, by the growth rate of 5.8 per project paths. The path on the
FIGURE 4
week. The prediction, that is, the expect- left can often be seen in agile
ed future value, for the functionality projects. In this path, the func-
index can then be found by adding this tionality and the quality grow
change, 35=6*5.8, to the current func- together. At every point in time,
tionality of 35 for a value of 70. Doing the product is ready to go, albeit
the same calculation for the quality at reduced functionality. The mid-
yields an expected future value for the dle path shows an iterative project
quality index of 252 = 126 + 6 * 21. The that adds some functionality, then
expected path is the line from the cur- tests that functionality, and
rent position to this expected future repeats. The last path shows a
position. The expected line can also be waterfall project, in which the
calculated by finding the slope of the majority of the functionality is
curve, but we will stick with this method added during development, and
and use the slope to find the other the product is then handed off to
edges. a test organization to test.
FIGURE 5
When we calculate the slope, it is pos- The insight that the PPV can
sible to calculate a range of slopes from provide regarding the shape of the
the data and create a confidence interval line is in confirming your expecta-
for the path. The High edge is shown in tions of the project processes. For
dashed red and the Low edge is shown in example, if you employ an agile or
dashed fuchsia. These are the high and iterative process and the progress
low ends of a 90 percent confidence inter- path is similar to that of the water-
val. (See the side bar for a practical sug- fall, you know something is amiss.
gestion.) The two edges form the bound- Given an understanding of the
aries of a cone within which we expect target and the predicted path cone,
the project to progress. we can now understand the possible
The length of the edges is deter- scenarios and how to interpret them.
mined by the velocity of the project with In Figure 4, two scenarios are depict-
F
achieved. The left cone shows a situation one is to determine what factors con-
in which the functionality was not tribute to your functionality and to UZZY MATH
achieved. The product meets the quali- your quality. Typically, keep this as sim-
ty considerations, but does not provide ple as possible, but no simpler. Often,
sufficient functionality to many factors are counted When finding the high and low edges
please the customer. ! and great pains are taken of the path cone, some fancy sta-
Competing products may to get the numbers col- tistical calculations are required.
overtake this product in Stick with a lected, only to discover However, it turns out that simply
the market by offering that just one or two of the using 0.9 and 1.1 as slope multi-
more features. Again, if somewhat flawed factors carry the bulk of pliers works surprisingly well. This
the customer is demand- the influence. For the doesn’t provide the mathematical
ing a product immediate-
ly, it may be better to deliv-
graph rather functionality index, I’d
recommend using func-
rigor needed in academia, but it pro-
vides insight that’s accurate enough
er a less functional prod-
uct now than a more func-
than flip-flop- tion point counts, if that’s
available. Other useful
for most enterprises.
Remember, this graph is not a
tional one later. things might be features,
The cone on the right
ping around a feature points, story
precision instrument; it’s intended
to be more like a GPS map on a
reflects a situation in points, use cases, or user
which the quality was meaningless one. scenarios. In short, what-
boat. It will give you a good indi-
cation that you’re on track or drift-
achieved and extra func- ! ever you use for burn-
ing off track. From that, you can
tionality was delivered. down charts or to measure
make corrections as needed to get
The extra bells and whistles potentially progress can likely be used as a con-
reflect a condition of waste. The cus- tributor in the functionality index. If back on course.
tomer neither asked for, nor expects, this multiple factors are going to be used,
additional functionality. In some cases, the functionality index would simply counts come in, but it’s typically suffi-
this would be a pleasant surprise to the be the weighted sum. cient. Other measurements you may
customers. In others, it could indicate I recommend that the contributors consider are unit test count, code cov-
overspending, later delivery, unnecessary to the quality index be equally simple, erage, and mean time between failures.
complexity and/or additional training. such as the number of test cases passed. Again, if more than one factor is con-
If the message of the graph is a nega- The downside of this measure is that you sidered, the quality index is the weight-
tive situation, there are several ways to may not know the total number of test ed sum.
address it, as shown in Table 2. cases, and thus the target. I have used Once you agree on the factors that
with some success estimates of the test you’ll consider for the functionality and
Building your own PPV case count based on the number of fea- quality indexes, you can find the target.
Now that the PPV is understood, how tures and function points. The target I wouldn’t suggest making changes to
can we build one for your project? Step tends to move a bit as the actual test case the contributors or weights, as that real-
ly confounds the interpretation. Stick
TABLE 2: PROJECT REPAIR PLAN with a somewhat flawed graph rather
Observation Possible Corrective Actions than flip-flopping around a meaning-
less one.
Too short for target If the cone simply falls short of the target, you can extend the sched- When you have the two indexes and
ule or to add resources.To make this call, you’ll need to weigh up the target, you can begin building the
things like resources, budget and pending projects. PPV. I use a spreadsheet since it has a con-
Too long for target If the cone extends far beyond the target, it may be possible to pull venient way to manage tabular data, per-
back the release date. form the calculations and render the
graph. You can grab my template from
Undershooting If the cone shows that the functionality is met, but the quality is tinyurl.com/5trzox.
quality lower than desired (the lower cone in Figure 4), then it might be The Project Progress Viewer provides
helpful to allocate resources to the quality effort. an intuitive way to gain insight into the
Overshooting quality If the cone shows that the functionality is met and the quality goal path your project is taking. You can use
will be surpassed (the upper cone in Figure 4), options include scal- it to confirm assumptions about the
ing back quality activities (freeing up resources for other activi- processes, to ensure the project is track-
ties) or releasing the product and marketing its superior quality ing, and to ensure you’ve got the desired
as an advantage. balance of function and quality. This
chart, like any other, is not a replacement
Undershooting If the cone shows that the functionality is not met (the left cone for all other tools. It is an additional tool
functionality in Figure 5), you might consider scaling the functionality goal or in your toolbox. When you combine proj-
adding resources to development. ect milestones, burn-down charts, defect
Overshooting If the cone shows that the functionality is exceeded (the right cone graphs, and the PPV, you can put togeth-
functionality in Figure 5), you might either reallocate resources or market the er a very compelling story of the project,
more feature-rich product as an edge on the competition. and more importantly, gain the insight
needed to take action. !
By Sean Campion
CBSE extends these well-established ideas nization’s library. This has a number of Unit-Testing Components
by emphasizing the componentization of positive effects: Another advantage of component use is
pieces of the application system and the • Application timelines are reduced that white-box and black-box testing are
controlled assembly of those pieces due to the reuse, as less application easy to build and include with the com-
through well-defined interfaces. code must be developed. ponent. It’s usually best to have the
• Application costs are decreased component developer build the white-
It Starts With a Component because reused components have box tests (since they know the inside
In essence, a component is any inde- already been paid for. workings of the component best) and
pendently-usable piece of software. • Application quality improves as more have a different developer write the
Almost every developer today is reusing a focus is spent on newly-developed black-box tests based on the component
component at some granularity, such as code, and a higher percentage of the specification. Ensuring the component
Hibernate, Spring, MS SQL and so on. final application code consists of well- is able to pass both the white- and black-
The reuse of these high-level compo- tested, proven components. box tests is a good measure of quality.
nents is so ingrained that when choosing • As the library of reusable components What’s more, packaging the unit tests
a database to use for a new application, grows, so does the percentage of any with the component provides a built-in
rarely does one propose the option of new application consisting of pre- regression test suite for any future
building their own rela- built components. updates.
tional database. ! An important addition- Unit tests should be further broken
It is important to define al aspect of a reusable com- down by type, which might include:
the granularity of the com- The component ponent is packaging. Since • Functional
ponents used in building these components will be • Stress
our applications; this level size we recom- distributed far and wide • Failure
of granularity will become and used by a group other • Accuracy
a general target during mend for most than the one that built Doing so ensures that each of these
application decomposi- them, it is critical that the test categories is thoroughly covered.
tion. There is a ‘just-about- use is an average distribution contain full Separated tests also help keep each indi-
right’ granularity size. design and development vidual test focused on one item; having a
Make the components too of 700 to 800 documentation, as well as single test cover multiple categories makes
small and you might incur the binary for the compo- it harder to determine the actual cause
the overhead of managing lines of source nent and for its testing of the failure by just looking at the test
many very small compo- suite. Lastly, the package result logs.
nents. Make the compo- code, and should include the source Another aspect of unit tests is to
nents too large and risk and test code itself, which include a code coverage tool and to
frequent updates and roughly 3,000 will allow developers to require a minimum coverage. A mini-
unused code. recompile and deploy to mum of 85 percent is a good standard, as
The component size we
recommend for most use is
lines of test code. their specific environments.
The inclusion of quali-
far as providing adequate coverage. While
requiring higher minimums might seem
an average of 700 to 800 ! ty documentation is a key preferable, there are cases when the
lines of source code, and factor in a CBSE reuse amount of effort required outweighs the
roughly 3,000 lines of test code. This size program. While leveraging pre-built benefits, so determine what level fits best
is big enough to encapsulate sufficient components will reduce the application for your organization’s use.
functionality for most standalone com- timeline, there is a small trade-off in Coverage alone only tells us whether
ponents, yet is small enough to allow a what is called “searching time,” which a line of code was executed or not, not
single individual, such as a developer or is the amount of time it takes an archi- how well it was tested. Combining cov-
reviewer, to fully understand it. tect or developer to search for, find and erage with the other separate testing cat-
Building reusable components estab- understand the component enough to egories will increase the likelihood that
lishes the bar for discrete quality and a determine whether it is suitable for use the code is not only exercised, but exer-
positive feedback cycle that continuous- in their application. The larger the com- cised appropriately.
ly works to improve and maintain over- ponent library is, the more likely an
all quality. existing component exists for reuse, but Mind Your Environments
the more time may also be spent look- Ensuring the component will run in var-
Perseverance Begets Reuse ing for it. ious environments is perhaps the trick-
Starting a reuse program means that Keep in mind that the documentation iest part of building a Component-
your first few applications become the must target two audiences. First, consid- Based Software Engineering model.
test beds for identifying functionality er the architect who is looking to use the Contrary to developing for one-time
that is suitable to be componentized component in their design and must use, building a component for true
and engineered for future reuse. These understand the component from an inter- reuse makes it difficult to predict the
first applications themselves are not face/design/function point of view. Then, particular environment in which any
likely to benefit from reuse, but subse- documentation must consider the devel- given component will be used. The envi-
quent applications will gradually reap oper who will be adding the component ronment consists of the operating sys-
the gains as more and more compo- to the overall application, and therefore tem, hardware, software, character sets
nents are built and added to your orga- must understand the specific usage. and many other items on the target sys-
TABLE 1 The number of defects per thousand On the flip side of this situation are the
lines of code (defects/KLOC) is still the benefits that come from tracking defects
Application 1 Application 2 standard measure of software quality. It is at the component level across multiple
Component A X a highly useful metric and should be applications. In the previous table,
Component B X X aggressively tracked and measured. But a Component B has two defects, one that
CBSE program introduces two addition- affects Application 1, the other Application
tem within which the component will al metrics, and throws a curve into how to 2. If defects are tracked solely at the appli-
operate. track defects at the application level. cation level, it may be difficult to cross-ref-
The solution to this is to test the com- The first new metric to track is the erence all of Component B’s defects across
ponent in the target reuse environment defect density per component. Using this any application. Once a defect is found in
as soon as possible. This is another advan- metric normalizes the component meas- a component via its usage in one applica-
tage of building reusable components; ures vis-à-vis lines of code. This provides tion, the defect must be tested for in all
previously-built components are already a way of comparing components imple- other applications that use it to determine
available as the application’s initial archi- mented in different languages. the impact.
tecture phase is in progress, providing A second new metric is the number of
the opportunity to test them early on in functional revisions per component. A The CBSE Bottom Line
the new environment and giving suffi- functional revision is when the compo- The bottom line is that to have a suc-
cient time to fix any issues. nent is altered to add new functionality, cessful CBSE reuse program, you must
to remove unnecessary functionality, or also have a solid, matrix-based defect
Component Design to significantly alter existing functionali- tracking mechanism.
and Peer Review ty. This metric is important in determin- Components, by virtue of their small
The basic premise of peer reviews is to ing the effectiveness of the upfront engi- size and complete packaging, facilitate
have someone other than the authors neering done to make the component systematic implementation of industry
examine the work closely for issues. The generic. Revisions to remove functional- QA best practices of unit testing and peer
benefits of peer reviews are well docu- ity indicate a tendency to over-engineer reviews. The widespread adoption of
mented, and it is always better to have a the component design. An over-engi- Component-Based Software Engineering
co-worker find a bug in the code than neered component costs more to devel- affects application quality by allowing
the customer. Frequent peer reviews op but does not provide any additional more time to be spent on new code devel-
conducted in all stages—from docu- ROI for that additional cost—and may opment, and by higher percentages of an
mentation, design, development and cost more over time to maintain the application that’s built with hardened
testing—will uncover more defects than unneeded functionality. components.
testing alone. Revisions to add functionality indicate The key to reaping the benefits of
Software components are ideal for under-engineering up front, resulting in reusable components is to implement
code reviews. Their small size and self- lost opportunity for additional, needed the complete program: library, peer
containment means a reviewer can easi- functionality with minimal additional cost. reviews, quality measurement, unit test-
ly and quickly grasp the intent of the A revision to modify existing core func- ing, packaging, and defect tracking.
entire component, and can invest a finite tionality indicates the component was not While any one of these will provide ben-
amount of time to accomplish the review. properly designed to carry out its func- efits, only the synergistic combination
All facets of a component should be tion in the first place. of them all will afford rewards greater
examined critically during review, and Reusing components across multiple than the sum of the parts—increasing
this includes all documentation, test cas- applications can throw further compli- software quality while driving down cost
es, and packaging structure as well as cations into measuring defect rates at the and timelines. !
the actual source code itself. Using a application level.
detailed checklist to accomplish the Looking at Table 1, the situation may REFERENCES
review ensures not only that all these arise where Component A has a defect • Wiegers, Karl. “Seven Truths About Peer
Reviews,” http://www.processimpact.com
items are looked at and verified, but pro- that affects the functionality of Application (Cutter IT Journal, July, 2002)
vides a means of recording and track- 1, but not Application 2. This could occur • Brown, Norm. “Industrial-Strength Management
ing the results. Possibly the most impor- for a number of reasons, for example Strategies,” www.stsc.hil.af.mil/crosstalk/1996/08/
tant step of a code review is a follow up Application 2 may not use a method that industri.asp (STSC, Aug 1996)
review to ensure that all documented Application 1 does, or the range of values
issues are corrected. Finally, the results from Application 2 is smaller than that
of the code review and all follow-ups used by Application 1, or
should become part of the component Application 2 may run in
documentation and included in the a different environment.
package distribution. When measuring the
defects for Application 2,
Measuring Quality, Judging Success we do not want to include the
To ultimately determine the success of a defect that applies to
reusable CBSE program in terms of Application 1 only. This fine-
quality means measuring defects. grained defect tracking requires
Measuring defects in this environment a more sophisticated, matrix-based
is not as straightforward as it may seem. defect tracking system.
FutureTest is
a two-day conference
results-oriented
The Cyber Tester: Web Bloopers—Avoiding
sessions taught by Blending Human and Machine Common Design Mistakes
By Paco Hope By Jeff Johnson
top industr y Cigital UI Wizards
Technical manager Principal consultant, respected in the art of
professionals. at software security consultancy human-computer interaction
JUST TWO
POWER-PACKED
DAYS! REGISTER by
January 30 for
EARLY BIRD RATES!
SAVE $200!
www.futuretest.net
Engineering Quality
Goes Bananas
How a ‘Dumb Monkey’ Helped One
Company Automate Function Testing
By Rex Black, Daniel Derr and Michael Tyszkiewicz reducing test cycle duration
through 24x7 testing
Collectively, the ePRO-LOG applica- from the Chunky Monkey. The output
tion and the scripts described in Table consists of the current form, whether a LISTING 3
3 implement the system described in screen shot was taken, and any actions digraph studyFlow
{
Figure 1. taken by the Think Monkey. In the exam- FormLogin [label = "", shapefile =
Let’s take a look at examples of the ple in Listing 2, we started on the login "images/FormLogin.png"];
three main types of documents that make screen, pressed Button1 four times, hit FormHome [label = "", shapefile =
"images/FormHome.png"];
up the Monkey’s anatomy. ButtonOkay, then selected ButtonTools
FormTools [label = "", shapefile =
Monkey Chow describes the form and on FormHome. Screens shot where also "images/FormTools.png"];
all of the widgets belonging to the form. taken along the way.
Figure 2 shows some examples of Monkey This data can also be used to create a FormLogin -> FormTools;
FormLogin -> FormHome;
Chow corresponding to FormHome. dot file for the Presentation Monkey. }
White space was added to make the data FormTools was added to the dot file for
more readable. purpose of illustration. Listing 3 shows
To use this data to hit ButtonTools, we a sample GraphViz dot file.
would pass in the form handle=
"0x001502FA", lparam="0x001304A8", FIG. 2: THE MONKEY’S GUTS
and controlId="0x5" to the Push Monkey.
Additional data is used to provide insight
to the Think Monkey and to make the
Monkey Droppings more descriptive.
The subroutine in Listing 1 was
extracted from the Push monkey. The
print statement at the end will become
a single entry in the Monkey Droppings.
Monkey Droppings record the output
LISTING 1
sub hitGraphicButton
{ ready:
my $formContainer = shift;
my $widgetParams = shift; form:handle="0x001502FA":objectGuid="21":type="1":
name="FormHome":x="0":y="0":width="320":height="320":
my $handle = $formContainer->{"params"}->{"handle"};#
form:handle="0x001502FA":
my $message= "0x000111"; # widget:lparam="0x001A0496":controlId="0x1":objectGuid="22":type="6":
WM_COMMAND message name="ButtonExit":x="0":y="232":width="75":height="34":formGUId="21":
my $wParam = $widgetParams->{"controlId"};
# controlId="0x5"
my $lParam = $widgetParams->{"lparam"}; # widget:controlId="0x2"
lparam="0x001304A8":
widget:lparam="0x001804A4":controlId="0x3":objectGuid="24":type="6":
my $result = `postmsg.exe -p -h $handle $message
$wParam $lParam`; name="ButtonMainMenu":x="20":y="105":width="200":height="30":formGUId="21":
Figure 3 displays the result of FIG. 3: THE MONKEY SHINES which does not adhere to customer
Presentation Monkey using GraphViz to requirements.
render the dot file into a screen flow
image. What’s Next for the Monkey?
We plan to scale our usage of Monkey
The Monkey’s Hidden Powers labor to perform long term software
The monkey has a latent capability that reliability testing. By using a large num-
we have not yet used—the ability to ver- ber of PCs or a Monkey cloud, we could
ify the actual screen flows against the simulate tens or even hundreds of thou-
requirements specification. This is par- sands of hours of operation in as little as
ticularly important in an FDA-regulated a week. This will allow us to produce sta-
environment where complete coverage tistically valid software reliability esti-
of requirements are mandated by 21 mates for the ePRO-LOG.
CFR and other regulations. For compa- We also intend to introduce scripting
nies that are operating in regulated capabilities into the Monkey. This will
environment, maintaining the required allow for a pre-determined decision about
level of documentation can be a signifi- screen flows (rather than a random deci-
cant operating cost. sion) during scripted tests.
Figure 4 shows a comparison of spec- Creating a Monkey with simple archi-
ifications with screens and test screen flow. spec-based screen flow. The output is fed tecture allowed us to address our risks while
Let’s work our way around this figure, to the Presentation Monkey, which pro- saving time and money. Using open source
starting with the sequence originating on duces a comparison like that shown in components and minimal software devel-
the right side. Figure 5. opment effort, we created a custom testing
The Presentation Monkey can pro- Figure 5 highlights the differences application that provides far greater ben-
duce a screen flow diagram from the between the screen flow described in the efits than existing commercial products.
Monkey Droppings file as shown previ- specification and what was observed dur- The Monkey has already paid for itself
ously in Figure 3. This diagram shows ing testing. For example, the requirements many times over in time saved, and gives
what screens where observed during specification called for the screen flow to the company a competitive advantage by
Monkey testing. proceed from FormT4 to FormT5 prior improving our documentation and testing,
However, we can also produce a screen to entering FormSave, but instead we went and allowing for faster turnaround time.
flow diagram using our requirements straight from FormT4 to FormSave. In Also, it should be noted that no mon-
specification instead of the Monkey addition, the requirements specification keys where harmed during the develop-
Droppings file. Our testers can use this called for the screen flow to proceed from ment of this application. !
diagram to show the expected function- FormI2 directly to
al flow of the application. FormSave, but instead FIG. 5: PRIMATE PATHS
Now, that capability alone would be we went from FormI2
exciting enough, but would still leave to FormI3 before pro-
the tedious and error prone task of com- ceeding to FormSave. FormHome Requirements Application
paring the two screen flows. However, This capability great-
we also have a comparator that can com- ly reduces the risk of
FormMainMenu
pare the test-based screen flow with the releasing a product
FormInjections
Monkey-Ready Monkey
Comparator FormQ1 FormT1
Specification Dropping
FormQ2 FormT2
Presentation
Monkey
FormT3 FormT1
MakeDot FormQ3
FormT4 FormT2
Graphviz
Requirements Only Application Only
FormT5 FormT3
Spec-Based Difference-Based Test-Based Requirements Only Application Only
Flow Diagram Flow Diagram Flow Diagram
FormSave
By Lawrence Nuanez
H ave you ever stood at the base of a mountain best for your project. To narrow the field, the focus here will be
on commercial tools.
and looked up? Staring up the face of a
mountain can make you dizzy, and the thought of Know Your Needs
climbing it can strike fear into your heart. Yet its majesty can Like most projects, it all starts with requirements. To choose
leave an indelible memory. You may have had similar feelings the best tool for your project, it’s essential to begin with a firm
if you’ve thought seriously about automating your tests. knowledge of what you need the tool to do. This requires you
Standing before Mt. Automation can be a dizzying experi- to look at the applications under test with automation objec-
ence, yet conquering its efficiencies can be extremely satisfying. tives in mind. It’s highly unlikely that you’ll be able to automate
This article will help you gear up for the journey. There are everything, and you probably don’t even want to. You might
numerous tools for test automation, each with its challenges, begin by focusing on parts of the application that are new or
capabilities and rewards. Here’s how to figure out which will be mission-critical.
When thinking about automation, your goal is to identify por-
Lawrence Nuanez is senior consultant with ProtoTest, a software QA tions of your application that are “automatable” and would help
process consultancy.
you achieve higher quality. Given enough time and money any-
thing can be automated, but it is much been there a long time and are firmly To get to know the tool, the salesper-
easier, for example, to automate a stan- entrenched. Others are overgrown and son might recommend going through a
dard implementation of a Web service all but forgotten. Still others are newly tutorial using a sample application that
than a highly customized application created, and still a bit bumpy. Your can be installed with the tool. This can be
developed using Ajax that relies only on options for selecting a tool are similar. beneficial if you are unfamiliar with the
select configurations. Any custom-built but selecting the most popular path might tool or with automation in general.
parts also could present challenges. This not be the best for you. However, you should limit the amount of
often requires talking to the development Once you know what you need the time you spend with the sample applica-
team to determine how the application tool to do and which operating systems tion and quickly turn the focus to your
was developed. It may be necessary to and other technologies it must support, app. After all, if it doesn’t do what you need
answer questions like the following: your choices should be narrowed to a with your application, it doesn’t matter
• For a Web product, SSL being used? handful. Now is the time to perform how cool the tutorial is, and there’s bound
• Is data being encrypted? proofs of concept on each. This is an to be a limit to how much time companies
• Are ActiveX controls being used? important part of the process and there will devote to evaluation support.
• What type of database is being used? are no shortcuts. As you perform your evaluation, be
You will need to break up your appli- I recommended that you dedicate at sure to fulfill and check off your require-
cation into logical partitions. It is likely least one a machine to be used only for ments as you go. Create a matrix with all
you have already done this as your test this purpose. This will let you conduct the the requirements down one side and the
scripts may be broken out by functional- proof of concept on a machine that oth- tools to be evaluated across the top. Take
ity. For example, if you have an order ers are not using and if the need arises to notes on how each tool satisfies each
entry and delivery system, your logical wipe the machine and start over, it will requirement. Note is how easily each tool
partitions at a high level could be the not be a huge loss. Unless you have sep- satisfies each requirement, perhaps in a
order entry system, the shopping cart, the arate machines that you can devote to scale of one to five. Two tools may each
payment system, fulfillment functionali- each tool you are evaluating, I recom- be able to support a requirement but one
ty, shipping functionality, and order mend performing your proof of concepts tool may do it out of the box while anoth-
returns functionality. When evaluating one at a time. Many automation tools er requires you build a custom library to
these areas, you come the conclusion that don’t play nice in the same sand box. And perform the same actions. Or one tool
automating the order entry system, shop- some tool makers will not support proofs may be able to natively connect to your
ping cart, and payment functionality of concept when they’re performed on a test management system while another
would be easiest and would help reduce system with that’s not completely “clean.” doesn’t support it at all.
the time it takes to regression-test the If you need to support Internet
entire application. The remaining areas Proof of Concept Explorer 6.x and 7.x and Firefox, create
are still important and could be candi- Most commercial tool makers offer a script and see if it works. Do you have
dates for automation down the road. They free versions of their software that you to create a separate script for each ver-
also should be included in the proof of can download for trial use. Some even sion or can one script be used for both?
concept, covered later. offer support if you go through their If you need support for SQL Server 2005
You also need to think in terms of sup- sales department. This is an important ensure that you can create a connection
port for operating systems, Internet factor in your evaluation, because even to your database and perform the
browsers, databases etc. Start by listing if you have an automation expert on required actions.
all the operating systems, browsers, data- staff, it’s helpful to receive assistance Any sales person will push for a deci-
bases, etc. that your application uses or from the ultimate domain expert while sion as soon as possible. It is best to be up
supports. After you have that list, deter- you perform the proof of concept. It front and let them know what your deci-
mine which ones are “must haves.” For also frees up your automation person sions will be based on and when those
example, if you support Internet or eases their job of learning. decisions will be made. Let them know
Explorer 6.x and 7.x, Mozilla 1.x and 2.x, In any event, it’s also helpful to have you will not rush through the proof of
Safari 3.x, and Opera, of those you might an initial exploratory conversation with concept stage and will not make a deci-
decide that only Firefox and IE are the tool maker to go over what you are sion until you have evaluated all your
absolutely essential. Adding support for looking for and what will be expected of selected tools.
Safari will greatly impact your choice of the tool. A good sales person will be hon- If you need more time to evaluate the
tools. Only you can know what your est on what their tool can realistically do tool ask the sales person for an extension
needs and wants are. and not do. You might even eliminate of the trial license. Most tool makers are
some tools based on that initial conver- happy to give you more time. Conducting
Tool Evaluation sation. Or, if it only supports a subset of full and thorough testing will provide the
Once you have gone through the process what you need, you can drop it the end information you need to make the right
of evaluating your application and what or revisit it later if your requirements decision. Resist the urge to select a tool
needs to be supported, you can begin change. before you have evaluated all the tools on
looking at tools. This is where the fun After you determine that a proof of your list. You may miss out on a perfect
begins, but this stage also requires some- concept would make sense with a partic- tool due to impatience.
what of a commitment from you; the ular tool, install it on the dedicated
process can be somewhat long. machine. It is imperative that your appli- Sage Advice
Returning to our analogy, there are cation be on that machine and be used Few individuals would think of embark-
many paths up the mountain. Some have for the proof of concept. ing on an arduous mountain expedi-
Eliminate
ed against the target environment of the
appliance, without cycles being spent on
how things may have changed at the cus-
tomer site.
“What if”
Despite the benefits of a more efficient
testing process, add-on software still can
increase unpredictability. This is anoth-
er area in which the purpose-built appli-
From Testing
ance can provide significant benefits.
Some appliances offer a secure phone-
home capability for remotely installing
encrypted manifests and patches to appli-
ances in the field. They can automati-
cally provide compressed and encrypted
If you’re thinking about When applications fail to updates for dark sites and deliver secure
deploying your application work as expected in pro- and comprehensive upgrades for the
on an appliance, you’ll also duction, the user’s first operating system as well as the resident
need to consider the impact response is to view it as your application and drivers. Furthermore,
it will have on established problem. Even though rea- they offer advanced image backup man-
test/QA practices. In many sons have nothing to do with agement techniques used to automate
cases, the decision to use a your application, you’re left the backup of the full software partition
software appliance boils to diagnose the problem, of appliances. Thus you can ensure that
down to the fact that no restore proper operation an image backup is created automatical-
matter how business-critical and suggest safeguards ly prior to the update process. Should the
it may be, your application against future issues. It’s not appliance fail, it can be rolled back to a
Gregory Shortell
is just one piece of a com- enough to say that your pre-failure image and quickly restored for
plex puzzle. application runs brilliantly in the lab and proper operation.
Storage, security or communication “please don’t change anything because Information captured during the
applications all typically interact in some we just can’t guarantee it will still work.” update process can then be delivered to
way with other applications, management A better approach is to the testing organization to
software and/or middleware. As we move use dedicated appliances ! help determine when and
into the future, the typical enterprise envi- that provide a self-con- why the upgrade did not go
ronment will host even more operating tained, locked-down appli- As applications as planned and provide
systems and hardware platforms - each cation that includes your insight into how to fix the
requiring secure and seamless interop- specific code paired to a become ever problem in the future.
erability. Maintaining the quality of your defined operating system, While most discussions
software and the integrity of the appli- matched to application driv- more complex , of purpose-built appliances
ance will become increasingly critical. ers and shipped on a known focus on ease of deploy-
When applications are deployed on piece of hardware. The efficiency will be ment, integration and use
general-purpose “white box” servers, you integrity of the delivered in the enterprise, signifi-
lose control of the hardware. With these product is assured with this
paramount. cant benefit to the QA
open servers, modifications can be made approach. The integrity of ! process also exist. Cost,
to the platform at any time and for any the platform is assured and time-to-market and testing
reason. Hardware vendors make changes the additional work of programming and efficiency are all byproducts of control-
to the BIOS, interface cards and disk testing for unlimited use cases goes away. ling the integrity of the platform on which
drives as they work to lower costs or adjust The same goes for the QA process. your software application will be deliv-
to supply chain shortages; enterprises The “What if” scenarios no longer exist, ered. In my experience, building brand
oftentimes “tweak” the application for nor does testing against every conceivable loyalty always starts and ends with prod-
performance, to cite just two examples. permutation of what the application may uct quality. As applications become ever
Such changes can create major prob- encounter in the customer’s enterprise. more complex and mission-critical, effi-
lems. Tightly timed I/O interactions Your testing organization is free to ensure ciency will be paramount to the future of
between software and hardware elements that the application performs as expect- testing. !
break down and cause the application to ed in the target environment of the pur-
exhibit errors, or worse, to be unavailable. pose-built appliance. Equally important, Gregory Shortell is president and CEO
of NEI, which offers vertical-market
Such unpredictable production envi- the QA process becomes significantly
hardware and software appliances,
ronment scenarios couldn’t possibly have more streamlined as the application is platforms and services.
been addressed in the testing process. upgraded. New code only needs to be test-
SPTechCon
January 27-29, 2009
Hyatt Regency
The SharePoint San Francisco Airport
Check out this list of classes! 702 Integrating SQL Server 2005
Reporting Services With
SharePoint
W-1 Getting up to Speed 203 SharePoint Search Configuration 405 Create an Electronic Form Solution 703 SharePoint Custom
As a SharePoint Administrator And Administration Using InfoPath and SharePoint Navigation Solutions
W-2 Success With SharePoint, 204 Getting Started With 406 Successfully Implementing 704 Search Engine Optimization
From Start to Finish SharePoint Workflows New Solutions In SharePoint
W-3 Mastering the Art of Customizing 205 Administering SharePoint 407 A Deep Dive: Rich Clients And 705 A Simple, Out-of-the-Box
The SharePoint User Experience From the Command Line SharePoint Web Services Project Management Solution
With STSADM.EXE
W-4 Share and Ye Shall Find: Deliver- 501 Fast Track to SharePoint Feature 706 Optimizing Information Security
ing Content That Users Need Generation In SharePoint
206 Office and SharePoint:
Better Together 502 Into the Wild: TheChallenges
W-5 Creating an Information 801 Using Custom Actions
Architecture Of Customized SharePoint Apps
207 Working With SharePoint Designer And Application Pages
In Release
To Manage Issues
W-6 Getting Started With 301 To Code or Not to Code:
SharePoint Development SharePoint Customization 503 SharePoint Directory Management
802 Excel Services As a Business
Vs. Development 504 Protect and Defend Your Data Intelligence Solution
W-7 Leveraging SharePoint
For Project Management 302 SharePoint Security Management 505 SharePoint Information Rights 803 ECM, Extranets And
For the Business User Management Customization
W-8 Leveraging SharePoint
In a SOA-based Infrastructure 303 How to Build a Change Control 506 Administering SharePoint Using 804 A Bridge Not Too Far: Linking
System in a SharePoint PMIS PowerShell Oracle ERP to Requirements
101 Teaming up to Deliver Complex
SharePoint Apps 304 Building the Platform As a Service 601 SharePoint Content Types: 805 Best Practices in SharePoint
Keys ToManaging Information Backup and Recovery
102 Planning for a Successful 305 Planning, Designing And
SharePoint Project Customizing SharePoint Search Taxonomy
806 SharePoint and Search Server:
103 Building Composite Office 306 Social Networking and User 602 10 Quick Wins with SharePoint— Getting the Right Results
Business Applications Profiles for Business And No Code! Every Time
104 SharePoint Best Practices: 307 Scaling With SharePoint 603 Customizing SharePoint Search
Doing It Right the First Time 604 Tuning Memory
401 Customizing the SharePoint User
105 Moving to SharePoint: Experience, Revisited Management LAST CHANCE
In SharePoint
“Won’t Everyone Need Training?”
402 10 Checkpoints for SharePoint- TO SAVE!
106 SharePoint Planning based Document Management 605 SharePoint With Windows
And Governance
403 SharePoint Administrators:
2008 and SQL 2008
REGISTER by
Jan.14
107 Working With SharePoint APIs The Reluctant SQL Server DBAs 606 Case Study: How Energizer
Trained Its Users to Change
201 Getting to Know the SharePoint 404 How to Balance Web Apps,
701 Building Scalable, High-Perfor-
Object Model
>F^[bfioeki[[j^[X_]f_Yjkh[WdZcWdW][j^[Wffb_YWj_ed
b_\[YoYb[$<hecj^[cec[dj_jijWhjiÄ\hecWXki_d[ii]eWb"je
h[gk_h[c[dji"jeZ[l[befc[djWdZgkWb_jocWdW][c[djÄ
WdZ^[h[_ij^[Z_\\[h[dY[ÄWbbj^[mWoj^hek]^jeef[hWj_edi
m^[h[j^[Wffb_YWj_edjekY^[ioekhYkijec[hi$
>F7BCe\\[h_d]i^[bfoek[dikh[j^WjoekhWffb_YWj_edidej
edbo\kdYj_edfhef[hbo"Xkjf[h\ehckdZ[h^[WlobeWZWdZWh[
i[Ykh[\hec^WYa[hi$9WdÉjoek`kij^[WhoekhYkijec[hiY^[[hdem5