3) Testing - StaticDynamic L D
3) Testing - StaticDynamic L D
Foundation Level
• Module 3 of 6: Static Techniques
February 2017
Study Sessions
2
Static Techniques
Session Plan
4
Static Techniques and the Test Process
Dynamic vs. Static
6
Reviews
• Reviews are a way of testing the software work products (including code) well
before dynamic test execution
• Reviews can be done entirely manually, but there is also tool support.
• The main manual activity is to examine a work product and make comments
• Any software work product can be reviewed including requirements
specifications, design specifications, code, test plans, tests, user guides.
7
Benefits of Static Testing
• Defects detected early in the life cycle (eg. Requirements) are often much cheaper
to fix
• Early defect detection and correction
• Development productivity improvements
• Reduced development timescales
• Reduced testing cost and time
• How many cycles of testing are needed?
• Lifetime cost reductions
• Easier to maintain
• Fewer defects
• Improved communication
8
Objectives
• Reviews, static analysis and dynamic testing have the same objective – identifying
defects. They are complementary; the different techniques can find different
types of defects effectively and efficiently.
• Compared to dynamic testing, static techniques find causes of failures (defects)
rather than the failures themselves.
• Typical defects that are easier to find in reviews than in dynamic testing include:
• deviations from standards
• requirement defects
• design defects / insufficient maintainability
• incorrect interface specifications
9
Review Process
Types of Reviews
• Informal
• No written instructions
• Systematic
• Team participation
• Documented results
• Documented procedures
11
Objectives of Reviews
1. Find defects
2. Gain understanding
3. Educate testers and new team
members
4. Discussion and decision by
consensus
12
Activities of a Formal Review
1. Planning:
• Defining the review criteria
• Selecting the personnel
• Allocating roles
2. Defining the entry and exit criteria for more formal review types
(e.g., inspections)
• Selecting which parts of documents to review
3. Kick-off:
• Distributing documents
• Explaining the objectives, process and documents to the participants
13
Activities of a Formal Review continued…
14
Activities of a Formal Review continued…
15
Roles and Responsibilities
• Moderator: the person who leads the review of the document or set of
documents, including planning the review, running the meeting, and following-up
after the meeting. If necessary, the moderator may mediate between the various
points of view and is often the person upon whom the success of the review rests.
• Author: the writer or person with chief responsibility for the document(s) to be
reviewed.
16
Roles and Responsibilities continued…
• Scribe (or recorder): documents all the issues, problems and open points that
were identified during the meeting.
17
Checklists can help
Looking at software products or related work products from different perspectives and
using checklists can make reviews more effective and efficient.
18
Types of Reviews
1. Informal Review
2. Walkthrough
3. Technical Review
4. Inspection
• You can use more than one type of review for a single work product
For example you might hold…
an informal review before a technical review
and then an inspection on a requirements specification
And finally a walkthrough with customers.
19
Informal Review
• No formal process
• May take the form of pair programming or a technical lead reviewing designs and
code
• Results may be documented
• Varies in usefulness depending on the reviewers
Example: Issue the test strategy document via email to a group for comments.
• No formal tracking of comments or updates
• Suggestion may or may not be taken on board
20
Walkthrough
21
Technical Review
22
Technical Review continued..
• Preparation of a review report which includes the list of findings, the verdict
whether the software product meets its requirements and, where appropriate,
recommendations related to findings
• May vary in practice from quite informal to very formal
• Main purposes: discussing, making decisions, evaluating alternatives, finding
defects, solving technical problems and checking conformance to specifications,
plans, regulations, and standards
23
Inspection
24
Inspection continued..
• Pre-meeting preparation
• Inspection report including list of findings
• Formal follow-up process
• Optional process improvement components
• Optional reader
• Main purpose: finding defects
25
Success Factors for Reviews
26
Success Factors for Reviews continued..
• Review techniques are applied that are suitable to achieve the objectives.
• Checklists or roles are used if appropriate to increase effectiveness of defect
identification.
• Training is given in review techniques, especially the more formal techniques
such as inspection.
• Management supports a good review process (e.g., by incorporating adequate
time for review activities in project schedules).
• There is an emphasis on learning and process improvement.
27
Static Analysis by Tools
Static Analysis by Tools
• Static analysis can locate defects that are hard to find in dynamic testing. As with
reviews, static analysis finds defects rather than failures.
• Static analysis tools analyze program code (e.g., control flow and data flow –
defined on next slide), as well as generated output such as HTML and XML
29
Control Flow and Data Flow Definitions
• data flow analysis: A form of static analysis based on the definition and usage of
variables.
• Example: helps find inconsistencies where a variable is defined, but isn’t used
30
The Value of Static Analysis
31
Typical Defects Found
32
Who uses Static Analysis Tools?
• Static analysis tools are typically used by developers (checking against predefined
rules or programming standards) before and during component and integration
testing or when checking-in code to configuration management tools, and by
designers during software modeling.
• Static analysis tools may produce a large number of warning messages, which
need to be well-managed to allow the most effective use of the tool.
• Compilers may offer some support for static analysis, including the calculation of
metrics.
33
Example Static Analysis Tool - Jtest
Source: http://www.testingfaqs.org/t-static.html#Jtest
34
Example Static Analysis Tool - STATIC
35
Can you answer these questions?
36
Can you answer these questions?
37
Can you answer these questions?
A. Unreachable code
B. Performance problems
C. Inconsistent interfaces between modules
D. Programming standards
E. Security vulnerabilities
38
ISTQB Practice Exam Question
Which one of the following examples describes a typical benefit of static analysis
supported by tools?
A. Static analysis supported by tools may find defects prior to manual test
execution.
B. Static analysis supported by tools prevents business analysts and requirement
engineers building software models (e.g. state transition diagrams), which do not
match the requirements.
C. By using static analysis tools user acceptance testing can be shortened because
the users need to execute less tests.
D. By performing static analysis of the code supported by tools the need for the
developers doing unit testing is decreased.
39
References :