You are on page 1of 22

1

Software Testing, 2nd edition


NARESH CHAUHAN

© Oxford University Press 2017. All rights reserved.


2

Chapter 6
Static Testing

© Oxford University Press 2017. All rights reserved.


Objectives
1
 Static testing is complementary to dynamic testing

 Static testing also improves the software quality

 There are bugs which are detectable only through static testing

 There are 3 types of static testing: Inspection, Walkthroughs and Reviews

 Inspections are the most widely used technique for static testing which is a formal
process to detect the bugs at early stage

 Walkthrough is a less formal and less rigorous method as compared to inspection

 Review is higher level technique as compared to inspection or walkthrough, as it also


includes Management

© Oxford University Press 2017. All rights reserved.


Static Testing
2

 Static testing techniques do not demonstrate that the software is operational


or one function of software is working.

 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 detection.

 Another advantage in static testing is that a bug is found at its exact location
whereas a bug found in dynamic testing provides no indication to the exact
source code location.

© Oxford University Press 2017. All rights reserved.


Types of Static Testing 3

 Software Inspections

 Walkthroughs

 Technical Reviews

© Oxford University Press 2017. All rights reserved.


Inspections
4
 Inspection process is an in-process manual examination of an item to detect bugs.

 Inspection process is carried out by a group of peers. The group of peers first
inspects the product at individual level. After this, they discuss potential defects
of the product observed in a formal meeting.

 It is a very formal process to verify a software product. The documents which can
be inspected are SRS, SDD, code and test plan.

 Inspection process involves the interaction of the following elements:

 Inspection steps

 Roles for participants

 Item being inspected


© Oxford University Press 2017. All rights reserved.
Inspection Team 5

 For the inspection process, following team members are required:

 Author / Owner / Producer: fixes defects discovered during the inspection


process

 Inspector: finds errors, omissions, and inconsistencies in programs

 Moderator: manages the whole inspection process

 Recorder: records all the results of the inspection meeting

© Oxford University Press 2017. All rights reserved.


Inspection Process 6

© Oxford University Press 2017. All rights reserved.


Benefits of Inspection Process 7

 Bug Reduction
 Bug Prevention
 Productivity
 Real-time Feedback to Software Engineers
 Reduction in Development Resource
 Quality Improvement
 Project Management
 Checking Coupling and Cohesion
 Learning through Inspection
 Process Improvement

© Oxford University Press 2017. All rights reserved.


Variants of Inspection Process 8

© Oxford University Press 2017. All rights reserved.


Active Design Reviews 9
 Used for inspecting the design stage of SDLC
 Conducted in the following stages:
 Overview A brief overview of the module being reviewed is presented which
explains the modular structure

 Review Reviewers are assigned sections of the document to be reviewed and


questionnaires based on the bug type. They are also assigned a timeframe during
which they may raise any questions they have, and a time to meet with designers
after they have read the completed questionnaires
 Meeting The designers read the completed questionnaires and meet the reviewers
to resolve any queries that they may have about the reviewer’s answers to the
questionnaires © Oxford University Press 2017. All rights reserved.
Formal Technical Asynchronous 10
Review Method (FTARM)
 Setup Involves choosing the members and
preparing the document for an asynchronous
inspection process
 Orientation Same as the overview step of the
inspection process
 Private review Same as the preparation phase
discussed in the inspection process. Here, each
reviewer or inspector individually gives his/her
comments on the document being inspected,
which cannot be seen by other inspectors
© Oxford University Press 2017. All rights reserved.
FTARM (contd.) 11
 Public review All private comments are made public
and all inspectors are able to see each other’s
comments. Based on this feedback, it is decided that
there is a bug
 Consolidation The moderator analyses the result of
private and public reviews and lists the findings and
unresolved issues
 Group meeting Any unresolved issues are discussed
in this step
 Conclusion The final report of the inspection process
along with the analysis is produced by the
moderator
© Oxford University Press 2017. All rights reserved.
Gilb Inspection 12
 Entry The document must pass through an entry
criteria that the inspection time is not wasted
on a document that is fundamentally flawed
 Planning The leader determines the inspection
participants and schedules the meeting
 Kick-off The relevant documents are distributed,
and the participants are assigned roles and
briefed about the agenda of the meeting
 Checking Each checker works individually and
finds defects
 Logging Potential defects are collected and
logged
© Oxford University Press 2017. All rights reserved.
Gilb Inspection (contd.) 13

 Brainstorming In this stage, process


improvement suggestions are recorded
based on the reported bugs
 Edit After all the defects have been
reported, the author takes the list and
works accordingly
 Follow-up The leader ensures that the edit
phase has been executed properly
 Exit The inspection must pass the exit
criteria as fixed for the completion of the
inspection process
© Oxford University Press 2017. All rights reserved.
Humphrey’s Inspection Process
14

 Preparation phase emphasizes on


finding and logging of bugs
 Also includes an analysis phase
between preparation and
meeting
 Individual logs are analysed and
combined into a single list

© Oxford University Press 2017. All rights reserved.


N-Fold Inspection 15
 Planning and overview This is the
formal planning and overview
stage. Also includes the planning
of how many teams will
participate in the inspection
process
 Inspection stages There are many inspection processes adopted by many teams. It is
not necessary that every team will choose the same inspection process. The team is
free to adopt any process
 Collation phase The results from each inspection process are gathered, collated, and
a master list of all detected defects is prepared
 Rework and follow-up This step is same as the tradition Fagan inspection process
© Oxford University Press 2017. All rights reserved.
Reading Techniques 16
 Defined as a series of steps or procedures whose purpose is to guide an
inspector in acquiring a deep understanding of the inspected software product.
 Techniques are:
 Ad-hoc Method: no technical support on how to detect defects is provided.
Defect detection fully depends on the skills, knowledge, and experience of
an inspector
 Checklists: Purpose is to gather expertise concerning the most common
defects and thereby support inspections. Are in the form of questions
which are very general and are used by the inspection team members to
verify the team
 Scenario based Reading: Based on scenarios where inspectors are
provided with more specific instruction than typical checklists. The
inspectors are provided with different scenarios, focusing on different kind
of defects

© Oxford University Press 2017. All rights reserved.


Scenario based Reading 17
 Perspective based Reading
 Software item should be inspected from the perspective of different
stakeholders. Inspectors of an inspection team have to check software
quality as well as the software quality factors of a software artifact from
different perspectives.
 Usage based Reading
 The method given is applied in design inspections. Design documentation is
inspected based on use cases, which are documented in requirements
specification.
 Abstraction driven Reading
 This method is designed for code inspections. In this method, an inspector
reads a sequence of statements in the code and abstracts the functions
these statements compute.

© Oxford University Press 2017. All rights reserved.


Scenario based Reading (contd.) 18
 Task driven Reading

 This method is also for code inspections . In this method, the inspector has
to create a data dictionary, a complete description of the logic and a cross-
reference between the code and the specifications.

 Function-point based Scenarios

 This is based on scenarios for defect detection in requirements documents.


The scenarios, designed around function points, are known as the Function
Point Scenario. It consists of questions and directs the focus of an inspector
to a specific function-point item within the inspected requirements
document.
© Oxford University Press 2017. All rights reserved.
Structured Walkthroughs 19

 It is a less formal and less rigorous technique as compared to inspection.

 The very common term used in the literature for static testing is inspection

but it is for very formal process.

 If you want to go for a less formal process having no bars of organized

meeting, then walkthroughs are a good option.

© Oxford University Press 2017. All rights reserved.


Technical Reviews
20

 A review is similar to an inspection or walkthrough, except that the review

team also includes management. Therefore, it is considered a higher-level

technique than inspection or walkthrough.

 A technical review team is generally comprised of management-level

representatives of the User and Project Management.

 Review agendas should focus less on technical issues and more on oversight

than an inspection.

© Oxford University Press 2017. All rights reserved.

You might also like