R Static Testing
R Static Testing
1
Overview
Static Testing
Comparison with Dynamic Testing
Requirement of Manual Testing
Review Techniques
Code Reviews
Walkthroughs
Inspection
Static Analysis
2
What is Static Testing?
5
Static Testing
Two parts:
6
Why do we need manual review?
Early defect detection
Comparison with requirements specification
Easier to fix defects
Less amount of mistakes
Finding errors like using two names for a single
variable
Ensuring path coverage
Less time to understand the code: adequate comments in
code, Conformance to coding standards
Well-documented software
Easier to get started for newcomers
Fast adoption of frequently changing requirements
Review Techniques
Code Review
Walkthrough
Inspection
(In increasing order of formalism)
8
Code Reviews
Types:
Self
Peer
Superior
Features:
Unstructured
Informal
Done by developer community only
No log or checklist
If error found rectified on the spot
9
Code Reviews
Advantages:
Reviewer is well equipped to understand the code
Few logistic and scheduling overheads
Minimum delay in error correction
Disadvantages:
Author is not the best person to review
Method is person-dependent and may not work consistently
among developers
Not an impartial process: may be affected by relationships
10
Walkthroughs
More formal than Code Reviews
Involves more people
People raise questions
Author answers, explains the logic and justifies
Finds answers to questions he is not able to answer
Advantages:
Larger groups can attend (education)
Brings in multiple perspectives
More material per meeting
Less preparation time
Disadvantages:
May turn into assessment of author and not the product
Scope is limited to the questions asked
Inspection
Team and clients meet to discuss
May review selected product aspects only
Focus on important issues
Involve people examining the source representation to discover
anomalies and defects
Anomalies in the code might be non-compliance with standards
May be applied to any representation of the system
(requirements, design, test data, etc.)
Very effective technique
Formalised approach to document reviews
13
Inspection: Features
Formal
Scheduled event
More preparation time: supplied documents in advance
Defined procedure
Reported result
Technical : Not schedule, Not budget
Give an assessment decision
Accept
Minor revision required
Major revision required
Reject
Unanimous approval required 14
Inspection pre-conditions
Prepare before
Thorough review of the product
Participate
Act professionally: no Personal agendas, egos and
shyness
Give both Positive and negative comments
19
Inspection Checklist
Checklist of common errors should
be used to drive the inspection
Logistics and
scheduling can
become a issue as
many people are
involved
Not possible to go
through every line of
code
22
Inspection: Solution
During planning:
23
Review Report
Purpose
Tell managers the outcome
Early warning system for major problems
Provides historical record
Process improvement
Tracking people involved with projects
Contents
Product issues
Other related issues
Summary 24
Benefits of Reviews
Compiling code
26
Static Analysis Finds
Syntax violations
A variable with an undefined value
Variables that are declared but never used
Unreachable code (or) Dead Code
Programming standards violations
Inconsistent interfaces
Security vulnerabilities
27