Chapter-6 Static Testing
Chapter-6 Static Testing
Chapter-6 Static Testing
1 Tadele M.
Software Testing
2
Software Testing
4
When to Perform Static Testing?
Static testing is performed at the early stage of SDLC, before the testing
phase.
Static testing is recommended to be done during the design,
documentation, and development phases before dynamic testing
commences.
5
Participants in static testing
Manager
Allocate time in the project schedule and determine
whether review process objectives have been met.
Moderator
leads the review of the document(s), including
– planning the review,
– running the meeting,
– following-up after the meeting
Author
Writer or person with chief responsibility for the
document(s) to be reviewed.
6
Participants in static testing
7
Features: What is Subject to Static Testing?
8
Static Testing
Types of the defects that are easier to find during the static testing are:
Deviations from standards.
Missing requirements.
Design defects.
Non-maintainable code.
Inconsistent interface specifications.
Programming errors (e.g. Infinite Loops)
9
Static Testing Techniques
Static techniques can be grouped under two categories:
1. Reviews : evaluation of technical matter by a group of people working together.
2. Static Analysis: the code is analyzed to find any structural defects that could lead to
errors when the program runs.
Reviews can be of following types:
Informal Reviews
Walkthroughs
Technical Review
Inspections
10
Informal Reviews
11
Walkthroughs
12
Technical Review
13
Inspection
It is the most formal review type
It is led by the trained moderators
Reviewers have checklist to review the work products.
They record the defect and inform the participants to rectify those errors.
14
Stages in a review process (formal)
Formal reviews follow a formal process. A typical formal review process consists
of six main steps:
1. Planning
Selecting the personnel, allocating roles; defining the entry and exit criteria for more
formal review types (e.g. inspection); and selecting which parts of documents to look a
2. Kick-off
Distributing documents; explaining the objectives, process and documents to the
participants; and checking entry criteria
3. Preparation
Work done by each of the participants on their own before the review meeting, noting
potential defects, questions and comments.
15
Stages in a review process (formal)…
4. Review meeting
Discussion or logging, with documented results or minutes (for more formal review
types). The meeting participants may simply note defects, make recommendations
for handling the defects, or make decisions about the defects.
5. Rework
Fixing defects found, typically done by the author
6. Follow-up
Checking that defects have been addressed, gathering metrics and checking on exit
criteria
16
Static Code Analysis
It is the systematic process of analyzing the source code of the software without
actually executing it.
In this process, the source code for the software is analyzed for different
parameters, such as below:
Whether or not the code meets the industry coding standards?
Are there any loopholes in the dry run of the code?
Is the syntax correct?
Is the source code optimized or needs more optimizations?
Is there any dead code or unreachable code?
Are there any unassigned variables?
Infinite loops present in the code.
17
Static Code Analysis
Static code analysis can be performed either manually or automatically by using tools.
Some of the tools which can be used for static analysis of code are:
SourceMeter
Find Bugs
PMD
PyCharm
JTest
Checkstyle
Clang
Sonarqube
Soot
Thread Safe
JArchitect
18
Review questions
1. What is the difference between static testing and dynamic testing?
2. Which documents can be reviewed in static testing?
3. List the roles participated during static testing and their responsibilities
4. What are the different types of review in static testing? Identify their levels of
formality.
5. What are the stages of a formal review process?
6. What is Static Code Analysis? Mention some tools used to which can be used for
static analysis of code.
19