Static Testing
Static Testing
Chapter
6
Static Testing
cussed earlier. Since verification activities are required at every stage of SDLC
till coding, static testing also can be applied at all these phases.
Static testing techniques do not demonstrate that the software is operational
or that one function of software is working; rather they check the software
product at each SDLC stage for conformance with the required specifications
or standards. Requirements, design specifications, test plans, source code,
user’s manuals, maintenance procedures are some of the items that can be
statically tested.
Static testing has proved to be a cost-effective technique of error detec-
tion. An empirical comparison between static and dynamic testing [26, 27],
proves the effectiveness of static testing. Further, Fagan [28] reported that
more than 60% of the errors in a program can be detected using static testing.
Another advantage of static testing is that it provides the exact location of a
bug, whereas dynamic testing provides no indication of the exact source code
location of the bug. In other words, we can say that static testing finds the in-
process errors before they become bugs.
Static testing techniques help to produce a better product. Given below are
some of the benefits of adopting a static testing approach:
As defects are found and fixed, the quality of the product increases.
A more technically correct base is available for each new phase of
development.
The overall software life cycle cost is lower, since defects are found
early and are easier and less expensive to fix.
The effectiveness of the dynamic test activity is increased and less time
needs to be devoted for testing the product.
Immediate evaluation and feedback to the author from his/her peers
which will bring about improvements in the quality of future products.
The objectives of static testing can be summarized as follows:
To identify errors in any phase of SDLC as early as possible
To verify that the components of software are in conformance with its
requirements
To provide information for project monitoring
To improve the software quality and increase productivity
6.1 INSPECTIONS
Software inspections were first introduced at IBM by Fagan in the early 1970s
[43]. These can be used to tackle software quality problems because they
allow the detection and removal of defects after each phase of the software
development process. Inspection process is an in-process manual examina-
tion of an item to detect bugs. It may be applied to any product or partial
product of the software development process, including requirements, design
and code, project management plan, SQA plan, software configuration plan
(SCM plan), risk management plan, test cases, user manual, etc. Inspections
are embedded in the process of developing products and are done in the early
stages of each product’s development.
This process does not require executable code or test cases. With inspec-
tion, bugs can be found on infrequently executed paths that are not likely to
be included in test cases. Software inspection does not execute the code, so
it is machine-independent, requires no target system resources or changes to
the program’s operational behaviour, and can be used much before the target
hardware is available for dynamic testing purposes.
The inspection process is carried out by a group of peers. The group of
peers first inspect the product at the individual level. After this, they discuss
the potential defects of the product observed in a formal meeting. The sec-
ond important thing about the inspection process is that it is a formal process
of verifying a software product. The documents which can be inspected are
SRS, SDD, code, and test plan.
An inspection process involves the interaction of the following elements:
Inspection steps
Role for participants
Item being inspected
The entry and exit criteria are used to determine whether an item is ready
to be inspected. Entry criteria mean that the item to be inspected is mature
enough to be used. For example, for code inspection, the entry criterion is
that the code has been compiled successfully. Exit criterion is that once the
item has been given for inspection, it should not be updated, otherwise it will
not know how many bugs have been reported and corrected through the
inspection process and the whole purpose of the inspection is lost.
Define purpose
of the
Overview inspection
meeting
Team members
Individual
identify
preparation
potential errors
Item is
Inspection inspected in the
meeting inspection
meeting
want to go for a less formal process having no bars of organized meeting, then
walkthroughs are a good option.
A typical structured walkthrough team consists of the following members:
Coordinator Organizes, moderates, and follows up the walkthrough
activities.
Presenter/Developer Introduces the item to be inspected. This
member is optional.
Scribe/Recorder Notes down the defects found and suggestion pro-
posed by the members.
Reviewer/Tester Finds the defects in the item.
Maintenance Oracle Focuses on long-term implications and future
maintenance of the project.
Standards Bearer Assesses adherence to standards.
User Representative/Accreditation Agent Reflects the needs and
concerns of the user.
Walkthroughs differ significantly from inspections. An inspection is a six-
step, rigorous, formalized process. The inspection team uses the checklist
approach for uncovering errors. A walkthrough is less formal, has fewer steps
and does not use a checklist to guide or a written report to document the team’s
work. Rather than simply reading the program or using error checklists, the
participants ‘play computer’. The person designated as a tester comes to the
meeting armed with a small set of paper test cases—representative sets of
inputs and expected outputs for the program or module. During the meeting,
each test case is mentally executed. That is, the test data are walked through
the logic of the program. The state of the program is monitored on a paper
or any other presentation media. The walkthrough should have a follow-up
process similar to that described in the inspection process. The steps of a
walkthrough process are shown in Fig. 6.7.
Rework and
Organization Preparation Walkthrough
Follow-up
SUMMARY
Static testing techniques are not as popular as dynamic testing techniques. However, research-
ers have found static testing to be an effective aid in finding and preventing the defects at an
early stage. In recent years, due to the importance of early testing, these techniques are finding
their place in industries.
This chapter introduces static testing as a complementary technique to dynamic testing.
Static testing reveals the bugs which cannot be detected by dynamic testing. We have taken
three categories of static testing, namely inspection, walkthroughs, and reviews, and distin-
guished them. Inspection process is a widely used term for static testing. A lot of terminologies
are used interchangeably for static testing.
We have discussed every aspect of inspection process including the team members and the
inspection process. Moreover, in the literature, many variants of this process are also available.
These variants have also been discussed.
Let us review the important concepts discussed in this chapter:
The inspection process is a formal in-process manual examination of an item to detect
bugs. It may be applied to any product or partial product of the software development
process. This process is carried out by a group of peers with the help of checklists.