Functional Engineering Whitepaper
Functional Engineering Whitepaper
will continue to prove an Functional engineering is the process of building a mathematically rigorous
representation of the expected functional behavior of the proposed software.
allusive goal.”
The problem of defining, measuring, and testing detailed functionality has
—Peter Becker previously been tackled by hardware engineers, and chip testing engineers in
CEO
particular. These engineers needed to be able to quickly confirm the correct
Critical Logic
functional behavior of every computer chip coming out of a fabrication plant.
The algorithms used to design tests for chip logic should also apply to the
functional logic of software.
This work has been used by Critical Logic and its partners to develop a
modeling solution that allows functional/test engineers (the line between the
two is significantly blurred when models represent requirements as well as
tests) to focus on building a graphical model of the expected behavior of the
software, then rely on design software and other tools to analyze the
requirements and generate the actual test cases.
1
The modeling algorithms are based on chip-testing technology that essentially
builds a series of cause-effect graphs. The purpose of the model is to:
THE PROCESS
The essential process steps in functional engineering are straightforward:
1. Collect information that describes the expected behavior of the system as
observed at its interfaces (GUI, databases, inter-system transactions,
etc.).
2. Represent this functional behavior in a cause-effect logic diagram.
3. Process the model through automated algorithms that design the
optimum number of test cases giving full functional coverage.
4. Revise the models and regenerate tests as necessary to support
functional changes to the software.
Great requirements obviously have substantial value, but the real benefit
of effective functional engineering rests in the design of test cases.
Functional engineering means that IT now has the ability to “prove” to the
business that all their requirements are being met because the tests cover
all defined functionality.
APPROACH
This approach, typically called Model-based testing, carries with it important
implications:
4
• The Functional Engineer derives the model from the same business
requirements that traditionally were used by the coder. The
difference is that the Functional Engineer can start working almost as
soon as the first set of overall Use Cases or User Stories are created.
In this way, the Functional Engineer enhances the requirements
discovery process by using the graphical tools in the modeling
software to quickly expose inconsistencies and incompleteness in the
requirements. This means the specifications are dramatically
improved with a result of at least a 50% reduction in the number of
defects found in code as it is delivered to the QA team for testing.
• Since the models are built as requirements are completed, test case
design can be accomplished in parallel with or even ahead of coding.
Project managers can more accurately size the development effort
since the requirements and specifications are much more stable.
Coders use the model-based specifications and test cases as a guide
for unit-level testing and to verify correct interpretation of the
specifications. Other test issues such as data setup and test
environment configuration can also start much earlier in the
development lifecycle.
• In an agile or short-period iterative development methodologies, test-
driven development and having tests before coding is done as an
important critical success factor. The reality is that getting tests ready
this early has proven to be extremely difficult, leading to a testing
bottleneck that extends out the process to the point where the
development cycles starts looking more like a waterfall approach.
Since functional models are built as part of the requirements process,
model-generated tests may be the only practical means of meeting
this important demand short of applying significant numbers of QA
staff to the problem. For example, agile suggests a 1:3 ratio of QA
staff to developers. With functional engineering, that ratio is reduced
to around 1:5 or 1:6.
• With model-based testing, the impact of a change in requirements or
specifications is immediately visible. Since specifications, test cases,
and other quality products are automatically derived from the model,
changing the model changes the test scripts. 5
and other quality products are automatically derived from the model,
changing the model changes the test scripts.
• Test effectiveness is consistent and complete. Functional coverage is
always 90%-100% and other test coverage measurements such as
code coverage are also very high. These results are consistent from
test engineer to test engineer and independent of their experience
with the application or business area.
Instead, verifying the value of functional engineering and test design requires
reliance on individual opportunities to track data for specific projects and
assess the results. This opportunistic approach yields important results that
clearly show the benefits, even though the inconsistency of metrics from
project-to-project makes generalizations harder to prove. Therefore, the
remainder of this paper looks at specific results from individual projects where
quantitative or qualitative data has been collected and conclusions arrived at
about the effectiveness of functional engineering and model-based testing.
6
DEFECT AVOIDANCE
One of the strengths of functional engineering is that the modeling process
itself highlights errors and ambiguities in the specification of the functionality.
Such ambiguities lead to misunderstandings on the part of developers that, in
turn, translate into coding defects. Therefore, modeling should reduce the
number of initial functional defects introduced into code. Two Critical Logic
client projects have done analysis in this area, both confirming the substantial
reduction in defects.
70%
effect.
60%
50% 65%
During the testing of
40%
the application, 2148 30%
DEFECT ESCAPES
The key measure of any testing approach is prevention of defect escapes into
production. Functional engineering and the automated test designs derived
from it are valuable in that the resulting tests are quite thorough in their
coverage of the application functionality. The following are representative
examples:
8
of test cases.
Counts were kept of defects and the test phase in which each was found. If
functional engineering and test design are effective, these tests should find
most, if not all, of the functional defects, leaving relatively few to be detected
in later test phases. Earlier detection means less rework. The results of the
analysis are presented in the following chart:
100%
32
90%
18 151
80%
70%
60% UAT
50% 154 CORE
40% 232
SIT
30%
20%
121
10%
0%
Model Coverage All Ad Hoc
As the numbers make clear, the functional engineering tests were highly
effective in identifying defects when compared to traditional ad-hoc
approaches to test-case design. In this project, the same test engineers did
both the model-based test design and the ad-hoc test design, suggesting that
it is the functional engineering that provides the value, not differences in test
teams. As the numbers clearly show, ad-hoc test approaches unfortunately
justify the need for multiple test phases using different teams, imposing higher
project costs and later defect discovery.
business rules change as new products are introduced and current products
rules describing all options for integrating and pricing Sun products. The fast
pace of Sun technology development means that each month, 25% of the
business rules change as new products are introduced and current products
changed or deleted. With this level of complexity and change, testing
presents a huge challenge. ANY defect is costly and visible to the customer.
At the same time, frequent, thoroughly tested releases are required to keep
pace with product
releases. There
is no room for
error and no time
to go back and
get it right later.
10
was simply a result of avoided rework time and associated costs.
While reductions in test time and staffing are desirable, the biggest focus
must be placed on rework avoidance. 40%-50% of total project costs are
typically expended in rework, specifically in fixing defects after they have
already made their way into the code and are discovered during test or
production. Even if there is no reduction in the staffing or time required to
model, generate, and execute tests, the ability to avoid defects or to find them
in the earliest test phases means substantial rework elimination.
The projects cited in this paper were carefully measured to determine the
impact of functional engineering and test design on defect rates. The
evidence is clear that this approach does make a major contribution to the
reduction in defects for delivered applications. Moreover, the ability of this
technology to identify functional ambiguities in specifications and thus reduce
the number of defects introduced into code means that rework costs will be
substantially reduced as well.
For more information on this white paper or other inquiries, please contact us
at [email protected] or visit www.critical-logic.com.
12