You are on page 1of 18

RECAP OF STATIC

TECHNIQUES
STATIC TECHNIQUES
Static test techniques provide a powerful
way to improve the quality and
productivity of software development.
What is Static Testing?
*What is static testing?
Static testing can be defined as testing a
system without executing its code.
With dynamic testing methods, software is

executed using a set of input values and its


output is then examined and compared to
what is expected.
During static testing, software work

products are examined manually, or with a


set of tools, but not executed.
It consists of REVIEWS-all software work
products can be tested using review
techniques.
Types of defects that are found during
static testing are:
Deviations from standards.
Missing requirements, design defects,
non-maintainable code and inconsistent
interface specifications.
ADVANTAGES OF REVIEWS
Studies have shown that as a result of
reviews, a significant increase in
productivity and product quality can be
achieved.
Reducing the number of defects early in
the product lifecycle also means that
less time has to be spent on testing and
maintenance.
Defects found early are easy to fix.
What is a Review?

Its a type of static testing.


It could be code review, design review, test
plan review, documentation review, etc.
A process or meeting during which a software
product is examined by someone
-In most cases done by the team members
-To confirm discrepancies from planned results
-To recommend improvements
Finds defects by directly examining
documents
REVIEW PROCESS
A formal review process consists of six main steps:
1 Planning-Selecting the personal, allocating roles, defining
entry and exit criteria
2 Kick-off-Distributing documents, explaining the objectives,
checking entry criteria
3 Preparation-identify defects, questions and comments,
according to their understanding of the document.
4 Review meeting-defects are logged,discussion,decision.
5 Rework-Based on the defects detected, the author will
improve the document under review step by step.
6 Follow-up-Checking the defects have been addressed,
gathering metrics and checking on exit criteria
STATIC ANALYSIS BY TOOLS
Static analysis, also called static code
analysis, is a method of computer
program debugging that is done by
examining the code without executing
the program.
Static analysis tools are typically used by
developers before, and sometimes
during, component and integration
testing and by designersduring software
modeling.
Static analysis is performed on
requirements, design or code without
actually executing the software artifact
being examined.
The goal of static analysis is to find
defects, whether or not they may cause
failures. As with reviews, static analysis
finds defects rather than failures.
Coding Standards
Following a consistent coding standard
helps improve the quality of the overall
software system.
WHAT IS CYCLOMATIC COMPLEXITY?

Cyclomatic complexity is a software metric used


to measure the complexity of a program.
It is important to testers because it provides an
indication of the amount of testing (including
reviews) necessary to practically avoid defects.
Areas of code identified as more complex are
candidates for reviews and additional dynamic
tests.
To calculate cyclomatic complexity, the easiest
way is to sum the number of binary decision
statements (e.g. if, while, for, etc.)
Lower the Program's cyclomatic
complexity, lower the risk to modify and
easier to understand.
FORMULA:
Cyclomatic complexity = E - N + P
where, E = number of edges in the flow
graph.
N = number of nodes in the flow graph.
P = number of nodes that have exit points
PROBLEMS:

The Cyclomatic complexity is


calculated using the above control
flow diagram that shows seven
nodes(shapes) and eight edges
(lines), hence the cyclomatic
complexity is 8 - 7 + 2 = 3
** 7
nodes ,
8 edges
and 2
decision
points

*Alternatively one may


The control flow shows seven calculate the cyclomatic
nodes (shapes) and eight edges complexity using
(lines), thus using the formal the decision points rule.
Since there are two
formula the cyclomatic decision points, the
complexity is 8-7 + 2 = 3. cyclomatic complexity is 2
SUMMARY:Static analyis is
used for:
Early detection of defects prior to test
executions.
Early warning about suspicious aspects

of the code, design or requirements.


Identification of defects not easily found

in dynamic testing.
Improved maintainability of code and

design.
Prevention of defects.
RECAP

You might also like