SlideShare a Scribd company logo
Static Testing 
Session 3 
© AiTi Education 1
Overview 
• Reviews and the test process 
• Types of review 
• Static analysis 
© AiTi Education 2
People techniques 
• individual: 
– desk-checking, data-stepping, proof-reading 
• group: 
– Reviews (informal & formal): for consensus 
– Walkthrough: for education 
– Inspection (most formal): to find faults 
SSttaattiicc tteecchhnniiqquueess ddoo nnoott eexxeeccuuttee ccooddee 
© AiTi Education 3
Benefits of reviews 
• Development productivity improvement 
• Reduced development timescales 
• Reduced testing time and cost 
• Lifetime cost reductions 
• Reduced fault levels 
• Improved customer relations 
• etc. 
© AiTi Education 4
Reviews are cost-effective 
• 10 times reduction in faults reaching test, testing 
cost reduced by 50% to 80% 
– Freedman & Weinberg, Handbook of Walkthroughs, 
Inspections & Technical Reviews 
• reduce faults by a factor of 10 
– Yourdon, Structured Walkthroughs 
• 25% reduction in schedules, remove 80% - 95% 
of faults at each stage, 28 times reduction in 
maintenance cost, many others 
– Gilb & Graham, Software Inspection 
© AiTi Education 5
What can be Inspected? 
• policy, strategy, 
business plans, 
marketing or advertising 
material, contracts 
• system requirements, feasibility studies, 
acceptance test plans 
• test plans, test designs, test cases, test results 
• system designs, logical & physical 
• software code 
• user manuals, procedures, training material 
Anything written down 
Anything written down 
can be Inspected 
can be Inspected 
© AiTi Education 6
What can be reviewed? 
• anything which could be Inspected 
– i.e. anything written down 
• plans, visions, “big picture”, strategic 
directions, ideas 
• project progress 
– work completed to schedule, etc. 
• “Should we develop this” marketing 
options 
© AiTi Education 7
What to review / Inspect? 
Tests 
Tests 
Tests 
Tests 
© AiTi Education 8 
RReeqquuirireemmeenntsts 
DDeessigignn 
CCooddee 
FFuunncctitoionnss 
InInteteggrraattioionn T Teesstt 
UUnniti tT Teesstt 
AAcccceeppt.t .T Teesstt 
SSyysstetemm T Teesstt
Costs of reviews 
• Rough guide: 5%-15% of development 
effort 
– half day a week is 10% 
• Effort required for reviews 
– planning (by leader / moderator) 
– preparation / self-study checking 
– meeting 
– fixing / editing / follow-up 
– recording & analysis of statistics / metrics 
– process improvement (should!) 
© AiTi Education 9
Overview 
• Reviews and the test process 
• Types of review 
• Static analysis 
© AiTi Education 10
Types of review of documents 
Informal Review undocumented 
• widely viewed as useful and cheap (but no one can prove it!) 
A helpful first step for chaotic organisations. 
Technical Review: (or peer review) 
• includes peer and technical experts, no management 
participation. Normally documented, fault-finding. Can be 
rather subjective. 
Decision-making Review: 
• group discusses document and makes a decision about the 
content, e.g. how something should be done, go or no-go 
decision, or technical comments 
© AiTi Education 11
Types of review of documents 
© AiTi Education 12 
Walkthrough 
• author guides the group through a document and 
his or her thought processes, so all understand the 
same thing, consensus on changes to make 
Inspection: 
• formal individual and group checking, using 
sources and standards, according to generic and 
specific rules and checklists, using entry and exit 
criteria, Leader must be trained & certified, metrics 
required
Reviews in general 1 
• Objectives / goals 
– validation & verification against specifications 
& standards 
– achieve consensus (excluding Inspection) 
– process improvement (ideal, included in 
Inspection) 
© AiTi Education 13
Reviews in general 2 
• Activities 
– planning 
– overview / kickoff meeting (Inspection) 
– preparation / individual checking 
– review meeting (not always) 
– follow-up (for some types) 
– metrics recording & analysis (Inspections and 
sometimes reviews) 
© AiTi Education 14
Reviews in general 3 
• Roles and responsibilities 
– Leader / moderator - plans the review / Inspection, 
chooses participants, helps & encourages, conducts 
the meeting, performs follow-up, manages metrics 
– Author of the document being reviewed / Inspected 
– Reviewers / Inspectors - specialised fault-finding roles 
for Inspection 
– Managers - excluded from some types of review, 
need to plan project time for review / Inspection 
– Others: e.g. Inspection/ review Co-ordinator 
© AiTi Education 15
Reviews in general 4 
• Deliverables 
– Changes (edits) in review product 
– Change requests for source documents 
(predecessor documents to product being 
reviewed / Inspected) 
– Process improvement suggestions 
• to the review / Inspection process 
• to the development process which produced the 
product just reviewed / Inspected 
– Metrics (Inspection and some types of review) 
© AiTi Education 16
Reviews in general 5 
• Pitfalls (they don’t always work!) 
– lack of training in the technique (especially 
Inspection, the most formal) 
– lack of or quality of documentation - what is 
being reviewed / Inspected 
– Lack of management support - “lip service” - 
want them done, but don’t allow time for them 
to happen in project schedules 
– Failure to improve processes (gets 
disheartening just getting better at finding the 
same thing over again) 
© AiTi Education 17
Inspection is different 
not just product, sources 
• the document to be reviewed is given out in advance 
• typically dozens of pages to review 
• instructions are "please review this" 
• some people have time to look through it and make 
comments before the meeting (which is difficult to 
arrange) 
• the meeting often lasts for hours 
• "I don't like this" 
• much discussion, some about technical approaches, 
some about trivia 
• don't really know if it was worthwhile, but we keep doing 
it 
chunk or sample 
training, roles 
entry criteria to meeting, may not be worth holding 
2 max., often much shorter 
Rule violations, objective, not subjective 
no discussion, highly focused, anti-trivia 
only do it if value is proven (continually) 
© AiTi Education 18
Inspection is more and better 
• entry criteria 
• training 
• optimum checking rate 
• prioritising the words 
• standards 
• process improvement 
• exit criteria 
• quantified estimates of 
remaining major faults 
per page 
© AiTi Education 19 
typical review 
early Inspection 
mature Inspection 
effectiveness return on investment 
10 - 20% unknown 
30 - 40% 6 - 8 hrs / Insp hr 
80 - 95% 8 - 30 hrs / Insp hr
The Inspection Process 
Change 
Request 
© AiTi Education 20 
Software 
Development 
Stage 
. 
Process 
Improvement 
. 
Planning 
Kick 
off 
Ind 
Chk Meet Edit 
Entry 
Next Software 
Development 
Stage 
Exit
At first glance .. 
Here’s a document: review this (or Inspect it) 
© AiTi Education 21
Reviews: time and size determine rate 
Time 
© AiTi Education 22 
Checking 
Rate 
Size 
2 hrs? 
100 pages? 
Checking 
Rate 
50 pages per hour
Review “Thoroughness”? 
major minor 
ordinary “review” - finds some faults, one major, fix them, 
consider the document now corrected and OK 
© AiTi Education 23 
minor
Inspection: time and rate determine size 
Time 
Checking 
Rate 
Size 
© AiTi Education 24 
2 hrs? 
Optimum: 
1 page* 
per hour 
2 pages (at optimum rate) 
* 1 page = 300 important words
Inspection Thoroughness 
Inspection can find deep-seated faults: 
• all of that type can be corrected 
• but needs optimum checking rate 
© AiTi Education 25
Inspection surprises 
• Fundamental importance of Rules 
– democratically agreed as applying 
– define major issues / faults 
• Slow checking rates 
• Strict entry & exit criteria 
• Fast logging rates 
• Amount of responsibility given to author 
© AiTi Education 26
Overview 
• Reviews and the test process 
• Types of review 
• Static analysis 
© AiTi Education 27
What can static analysis do? 
• A form of automated 
testing 
Remember: static 
techniques do 
not execute 
Remember: static 
techniques do 
not execute 
– check for violations 
of standards 
– check for things which 
may be a fault 
• Descended from compiler technology 
the code 
the code 
– a compiler statically analyses code, and “knows” a lot 
about it, e.g. variable usage; finds syntax faults 
– static analysis tools extend this knowledge 
– can find unreachable code, undeclared variables, 
parameter type mis-matches, uncalled functions & 
procedures, array bound violations, etc. 
© AiTi Education 28
Data flow analysis 
• This is the study of program variables 
– variable defined* where a value is stored into it 
– variable used where the stored value is accessed 
– variable is undefined before it is defined or when it 
goes out of scope 
x = y + z 
IF a > b THEN read(S) 
x is defined, y and z are used 
a and b are used, S is defined 
*defined should not be confused with declared 
© AiTi Education 29
Data flow analysis faults 
© AiTi Education 30 
n := 0 
read (x) 
n := 1 
while x > y do 
begin 
read (y) 
write( n*y) 
x := x - n 
end 
Data flow anomaly: n is 
re-defined without being used 
Data flow fault: y is used 
before it has been defined 
(first time around the loop)
Control flow analysis 
• Highlights: 
– nodes not accessible from start node 
– infinite loops 
– multiple entry to loops 
– whether code is well structured, i.e. reducible 
– whether code conforms to a flowchart 
grammar 
– any jumps to undefined labels 
– any labels not jumped to 
– cyclomatic complexity and other metrics 
© AiTi Education 31
Unreachable code example 
• Macro definitions (different for different platforms 
the code runs on) 
Buffsize: 1000 
Mailboxmax: 1000 
IF Buffsize < Mailboxmax THEN 
Error-Exit 
© AiTi Education 32 
ENDIF 
• Static Analysis finds the THEN clause 
unreachable, so will flag a fault
Cyclomatic complexity 
• cyclomatic complexity is a measure of the 
complexity of a flow graph 
– (and therefore the code that the flow graph 
© AiTi Education 33 
represents) 
• the more complex the flow graph, the 
greater the measure 
• it can most easily be calculated as: 
– complexity = number of decisions + 1
Which flow graph is most complex? 
What is the cyclomatic complexity? 
© AiTi Education 34 
1 
2 3 5
Example control flow graph 
Result = 0 
Right = 0 
DO WHILE more Questions 
IF Answer = Correct THEN 
Right = Right + 1 
ENDIF 
END DO 
Result = (Right / Questions) 
IF Result > 60% THEN 
Print "pass" 
ELSE 
Print "fail” 
ENDIF 
init 
res 
© AiTi Education 35 
Pseudo-code: 
do 
if r=r+1 
end 
if 
pass 
fail 
end
Other static metrics 
• lines of code (LOC) 
• operands & operators (Halstead’s metrics) 
• fan-in & fan-out 
• nesting levels 
• function calls 
• OO metrics: inheritance tree depth, 
number of methods, coupling & cohesion 
© AiTi Education 36
Limitations and advantages 
• Limitations: 
– cannot distinguish "fail-safe" code from 
programming faults or anomalies (often 
creates overload of spurious error messages) 
– does not execute the code, so not related to 
operating conditions 
• Advantages: 
– can find faults difficult to "see" 
– gives objective quality assessment of code 
© AiTi Education 37
Summary: Key Points 
• Reviews help to find faults in development and 
test documentation, and should be applied early 
• Types of review: informal, walkthrough, technical 
/ peer review, Inspection 
• Static analysis can find faults and give 
information about code without executing it 
© AiTi Education 38
Thank You 
AiTi Education 
published by www.aiti.edu.vn @aiti_aptech 
aiti.edu.vn 
© AiTi Education 39

More Related Content

PPT
AiTi Education Software Testing Session 02 b
PDF
Bjarne Mansson - Risk-based Testing,A Must For Medical Devices - EuroSTAR 2010
PPTX
ISTQB foundation level - day 2
PPT
AiTi Education Software Testing Session 01 b
PPTX
Se 381 - lec 28 -- 34 - 12 jun12 - testing 1 of 2
PPTX
Introduction To Testing by enosislearning.com
PDF
The SEI Approach
PPTX
Stuart Reid - ISO 29119: The New International Software Testing Standard
AiTi Education Software Testing Session 02 b
Bjarne Mansson - Risk-based Testing,A Must For Medical Devices - EuroSTAR 2010
ISTQB foundation level - day 2
AiTi Education Software Testing Session 01 b
Se 381 - lec 28 -- 34 - 12 jun12 - testing 1 of 2
Introduction To Testing by enosislearning.com
The SEI Approach
Stuart Reid - ISO 29119: The New International Software Testing Standard

What's hot (20)

PPT
Atos Origin - Testing - An Olympic Challenge
PPT
Software Engineering (Testing Activities, Management, and Automation)
PDF
L software testing
PPT
Michael Snyman - Software Test Automation Success
PPTX
Unit 2 hci in software process
PPTX
Unit3 software review control software
PDF
Software Quality Metrics Do's and Don'ts - QAI-Quest 1 Hour Presentation
PPT
Ch13 system testexecution
PDF
ISTQB - CTFL Summary v1.0
PPT
Ruud Teunissen - Personal Test Improvement - Dealing with the Future
PPTX
David Hayman - The Future of Testing is in New Zealand
PPT
Defect analysis and prevention methods
PDF
Innovation day 2013 2.5 joris vanderschrick (verhaert) - embedded system de...
PPT
Chapter6
PPT
Software testing
PDF
Innovation day 2012 11. luc van goethem & frederik wouters - verhaert - 'r...
PDF
Training program BaffleSol academy of learning
PDF
Introduction to testing2
PPTX
Istqb foundation level day 1
Atos Origin - Testing - An Olympic Challenge
Software Engineering (Testing Activities, Management, and Automation)
L software testing
Michael Snyman - Software Test Automation Success
Unit 2 hci in software process
Unit3 software review control software
Software Quality Metrics Do's and Don'ts - QAI-Quest 1 Hour Presentation
Ch13 system testexecution
ISTQB - CTFL Summary v1.0
Ruud Teunissen - Personal Test Improvement - Dealing with the Future
David Hayman - The Future of Testing is in New Zealand
Defect analysis and prevention methods
Innovation day 2013 2.5 joris vanderschrick (verhaert) - embedded system de...
Chapter6
Software testing
Innovation day 2012 11. luc van goethem & frederik wouters - verhaert - 'r...
Training program BaffleSol academy of learning
Introduction to testing2
Istqb foundation level day 1
Ad

Similar to AiTi Education Software Testing Session 03 (20)

PPT
Iseb, ISTQB Static Testing
PPT
ISTQBCH3StaticxvvvbbbdghhhjvvTesting.ppt
PPT
ISTQB / ISEB Foundation Exam Practice
PPT
Static testing techniques
PPS
ISTQB Foundation - Chapter 3
PPT
Lecture 10 Static Testing.ppt
PPTX
Software Testing 4/5
PPTX
Static techniques
PPT
Reviews Checklists
PPTX
3.static techniques
PPT
Introduction to Software Review
PPTX
Chapter 3 Static Techniques
PPT
Sech1920 1200112979886874-3
PPTX
Chapter 3 Static Techniques
PPTX
Code Reviews
PPT
SECh1920
PPTX
Static Techniques (Chapter 3)
PPT
S_22.ppt verification and validation in software testing
PPTX
Software engineering
PPT
Verifcation &amp;validation
Iseb, ISTQB Static Testing
ISTQBCH3StaticxvvvbbbdghhhjvvTesting.ppt
ISTQB / ISEB Foundation Exam Practice
Static testing techniques
ISTQB Foundation - Chapter 3
Lecture 10 Static Testing.ppt
Software Testing 4/5
Static techniques
Reviews Checklists
3.static techniques
Introduction to Software Review
Chapter 3 Static Techniques
Sech1920 1200112979886874-3
Chapter 3 Static Techniques
Code Reviews
SECh1920
Static Techniques (Chapter 3)
S_22.ppt verification and validation in software testing
Software engineering
Verifcation &amp;validation
Ad

More from AiTi Education (20)

PPT
AiTi Education Profile
PPT
AiTi Education Software Testing Session 02 a
PPT
AiTi Education Software Testing Session 01 a
PDF
Vietnam mobile internet_2014_mwork_vietnam_mobile_day
PDF
[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...
PPTX
[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...
PDF
[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...
PPTX
[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...
PPTX
[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...
PPTX
[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...
PDF
[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...
PPTX
[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...
PPTX
[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - Ng...
PPTX
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...
PPT
[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014 - Nguyễn Thàn...
PDF
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
PDF
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
PPTX
[Vietnam Mobile Day 2014] Gamification and Mobile Learning - Nguyễn Hữu Ân -...
PDF
[Vietnam Mobile Day 2014] Cơ hội & thách thức cho Game Studio Việt trước tảng...
PPTX
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh – Cou...
AiTi Education Profile
AiTi Education Software Testing Session 02 a
AiTi Education Software Testing Session 01 a
Vietnam mobile internet_2014_mwork_vietnam_mobile_day
[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...
[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...
[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...
[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...
[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...
[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...
[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...
[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...
[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - Ng...
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...
[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014 - Nguyễn Thàn...
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Gamification and Mobile Learning - Nguyễn Hữu Ân -...
[Vietnam Mobile Day 2014] Cơ hội & thách thức cho Game Studio Việt trước tảng...
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh – Cou...

Recently uploaded (20)

PPTX
Cell Structure & Organelles in detailed.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Updated Idioms and Phrasal Verbs in English subject
PPTX
Cell Types and Its function , kingdom of life
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
RMMM.pdf make it easy to upload and study
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
Cell Structure & Organelles in detailed.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Updated Idioms and Phrasal Verbs in English subject
Cell Types and Its function , kingdom of life
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
UNIT III MENTAL HEALTH NURSING ASSESSMENT
RMMM.pdf make it easy to upload and study
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
History, Philosophy and sociology of education (1).pptx
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Anesthesia in Laparoscopic Surgery in India
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Orientation - ARALprogram of Deped to the Parents.pptx
Paper A Mock Exam 9_ Attempt review.pdf.
Microbial diseases, their pathogenesis and prophylaxis

AiTi Education Software Testing Session 03

  • 1. Static Testing Session 3 © AiTi Education 1
  • 2. Overview • Reviews and the test process • Types of review • Static analysis © AiTi Education 2
  • 3. People techniques • individual: – desk-checking, data-stepping, proof-reading • group: – Reviews (informal & formal): for consensus – Walkthrough: for education – Inspection (most formal): to find faults SSttaattiicc tteecchhnniiqquueess ddoo nnoott eexxeeccuuttee ccooddee © AiTi Education 3
  • 4. Benefits of reviews • Development productivity improvement • Reduced development timescales • Reduced testing time and cost • Lifetime cost reductions • Reduced fault levels • Improved customer relations • etc. © AiTi Education 4
  • 5. Reviews are cost-effective • 10 times reduction in faults reaching test, testing cost reduced by 50% to 80% – Freedman & Weinberg, Handbook of Walkthroughs, Inspections & Technical Reviews • reduce faults by a factor of 10 – Yourdon, Structured Walkthroughs • 25% reduction in schedules, remove 80% - 95% of faults at each stage, 28 times reduction in maintenance cost, many others – Gilb & Graham, Software Inspection © AiTi Education 5
  • 6. What can be Inspected? • policy, strategy, business plans, marketing or advertising material, contracts • system requirements, feasibility studies, acceptance test plans • test plans, test designs, test cases, test results • system designs, logical & physical • software code • user manuals, procedures, training material Anything written down Anything written down can be Inspected can be Inspected © AiTi Education 6
  • 7. What can be reviewed? • anything which could be Inspected – i.e. anything written down • plans, visions, “big picture”, strategic directions, ideas • project progress – work completed to schedule, etc. • “Should we develop this” marketing options © AiTi Education 7
  • 8. What to review / Inspect? Tests Tests Tests Tests © AiTi Education 8 RReeqquuirireemmeenntsts DDeessigignn CCooddee FFuunncctitoionnss InInteteggrraattioionn T Teesstt UUnniti tT Teesstt AAcccceeppt.t .T Teesstt SSyysstetemm T Teesstt
  • 9. Costs of reviews • Rough guide: 5%-15% of development effort – half day a week is 10% • Effort required for reviews – planning (by leader / moderator) – preparation / self-study checking – meeting – fixing / editing / follow-up – recording & analysis of statistics / metrics – process improvement (should!) © AiTi Education 9
  • 10. Overview • Reviews and the test process • Types of review • Static analysis © AiTi Education 10
  • 11. Types of review of documents Informal Review undocumented • widely viewed as useful and cheap (but no one can prove it!) A helpful first step for chaotic organisations. Technical Review: (or peer review) • includes peer and technical experts, no management participation. Normally documented, fault-finding. Can be rather subjective. Decision-making Review: • group discusses document and makes a decision about the content, e.g. how something should be done, go or no-go decision, or technical comments © AiTi Education 11
  • 12. Types of review of documents © AiTi Education 12 Walkthrough • author guides the group through a document and his or her thought processes, so all understand the same thing, consensus on changes to make Inspection: • formal individual and group checking, using sources and standards, according to generic and specific rules and checklists, using entry and exit criteria, Leader must be trained & certified, metrics required
  • 13. Reviews in general 1 • Objectives / goals – validation & verification against specifications & standards – achieve consensus (excluding Inspection) – process improvement (ideal, included in Inspection) © AiTi Education 13
  • 14. Reviews in general 2 • Activities – planning – overview / kickoff meeting (Inspection) – preparation / individual checking – review meeting (not always) – follow-up (for some types) – metrics recording & analysis (Inspections and sometimes reviews) © AiTi Education 14
  • 15. Reviews in general 3 • Roles and responsibilities – Leader / moderator - plans the review / Inspection, chooses participants, helps & encourages, conducts the meeting, performs follow-up, manages metrics – Author of the document being reviewed / Inspected – Reviewers / Inspectors - specialised fault-finding roles for Inspection – Managers - excluded from some types of review, need to plan project time for review / Inspection – Others: e.g. Inspection/ review Co-ordinator © AiTi Education 15
  • 16. Reviews in general 4 • Deliverables – Changes (edits) in review product – Change requests for source documents (predecessor documents to product being reviewed / Inspected) – Process improvement suggestions • to the review / Inspection process • to the development process which produced the product just reviewed / Inspected – Metrics (Inspection and some types of review) © AiTi Education 16
  • 17. Reviews in general 5 • Pitfalls (they don’t always work!) – lack of training in the technique (especially Inspection, the most formal) – lack of or quality of documentation - what is being reviewed / Inspected – Lack of management support - “lip service” - want them done, but don’t allow time for them to happen in project schedules – Failure to improve processes (gets disheartening just getting better at finding the same thing over again) © AiTi Education 17
  • 18. Inspection is different not just product, sources • the document to be reviewed is given out in advance • typically dozens of pages to review • instructions are "please review this" • some people have time to look through it and make comments before the meeting (which is difficult to arrange) • the meeting often lasts for hours • "I don't like this" • much discussion, some about technical approaches, some about trivia • don't really know if it was worthwhile, but we keep doing it chunk or sample training, roles entry criteria to meeting, may not be worth holding 2 max., often much shorter Rule violations, objective, not subjective no discussion, highly focused, anti-trivia only do it if value is proven (continually) © AiTi Education 18
  • 19. Inspection is more and better • entry criteria • training • optimum checking rate • prioritising the words • standards • process improvement • exit criteria • quantified estimates of remaining major faults per page © AiTi Education 19 typical review early Inspection mature Inspection effectiveness return on investment 10 - 20% unknown 30 - 40% 6 - 8 hrs / Insp hr 80 - 95% 8 - 30 hrs / Insp hr
  • 20. The Inspection Process Change Request © AiTi Education 20 Software Development Stage . Process Improvement . Planning Kick off Ind Chk Meet Edit Entry Next Software Development Stage Exit
  • 21. At first glance .. Here’s a document: review this (or Inspect it) © AiTi Education 21
  • 22. Reviews: time and size determine rate Time © AiTi Education 22 Checking Rate Size 2 hrs? 100 pages? Checking Rate 50 pages per hour
  • 23. Review “Thoroughness”? major minor ordinary “review” - finds some faults, one major, fix them, consider the document now corrected and OK © AiTi Education 23 minor
  • 24. Inspection: time and rate determine size Time Checking Rate Size © AiTi Education 24 2 hrs? Optimum: 1 page* per hour 2 pages (at optimum rate) * 1 page = 300 important words
  • 25. Inspection Thoroughness Inspection can find deep-seated faults: • all of that type can be corrected • but needs optimum checking rate © AiTi Education 25
  • 26. Inspection surprises • Fundamental importance of Rules – democratically agreed as applying – define major issues / faults • Slow checking rates • Strict entry & exit criteria • Fast logging rates • Amount of responsibility given to author © AiTi Education 26
  • 27. Overview • Reviews and the test process • Types of review • Static analysis © AiTi Education 27
  • 28. What can static analysis do? • A form of automated testing Remember: static techniques do not execute Remember: static techniques do not execute – check for violations of standards – check for things which may be a fault • Descended from compiler technology the code the code – a compiler statically analyses code, and “knows” a lot about it, e.g. variable usage; finds syntax faults – static analysis tools extend this knowledge – can find unreachable code, undeclared variables, parameter type mis-matches, uncalled functions & procedures, array bound violations, etc. © AiTi Education 28
  • 29. Data flow analysis • This is the study of program variables – variable defined* where a value is stored into it – variable used where the stored value is accessed – variable is undefined before it is defined or when it goes out of scope x = y + z IF a > b THEN read(S) x is defined, y and z are used a and b are used, S is defined *defined should not be confused with declared © AiTi Education 29
  • 30. Data flow analysis faults © AiTi Education 30 n := 0 read (x) n := 1 while x > y do begin read (y) write( n*y) x := x - n end Data flow anomaly: n is re-defined without being used Data flow fault: y is used before it has been defined (first time around the loop)
  • 31. Control flow analysis • Highlights: – nodes not accessible from start node – infinite loops – multiple entry to loops – whether code is well structured, i.e. reducible – whether code conforms to a flowchart grammar – any jumps to undefined labels – any labels not jumped to – cyclomatic complexity and other metrics © AiTi Education 31
  • 32. Unreachable code example • Macro definitions (different for different platforms the code runs on) Buffsize: 1000 Mailboxmax: 1000 IF Buffsize < Mailboxmax THEN Error-Exit © AiTi Education 32 ENDIF • Static Analysis finds the THEN clause unreachable, so will flag a fault
  • 33. Cyclomatic complexity • cyclomatic complexity is a measure of the complexity of a flow graph – (and therefore the code that the flow graph © AiTi Education 33 represents) • the more complex the flow graph, the greater the measure • it can most easily be calculated as: – complexity = number of decisions + 1
  • 34. Which flow graph is most complex? What is the cyclomatic complexity? © AiTi Education 34 1 2 3 5
  • 35. Example control flow graph Result = 0 Right = 0 DO WHILE more Questions IF Answer = Correct THEN Right = Right + 1 ENDIF END DO Result = (Right / Questions) IF Result > 60% THEN Print "pass" ELSE Print "fail” ENDIF init res © AiTi Education 35 Pseudo-code: do if r=r+1 end if pass fail end
  • 36. Other static metrics • lines of code (LOC) • operands & operators (Halstead’s metrics) • fan-in & fan-out • nesting levels • function calls • OO metrics: inheritance tree depth, number of methods, coupling & cohesion © AiTi Education 36
  • 37. Limitations and advantages • Limitations: – cannot distinguish "fail-safe" code from programming faults or anomalies (often creates overload of spurious error messages) – does not execute the code, so not related to operating conditions • Advantages: – can find faults difficult to "see" – gives objective quality assessment of code © AiTi Education 37
  • 38. Summary: Key Points • Reviews help to find faults in development and test documentation, and should be applied early • Types of review: informal, walkthrough, technical / peer review, Inspection • Static analysis can find faults and give information about code without executing it © AiTi Education 38
  • 39. Thank You AiTi Education published by www.aiti.edu.vn @aiti_aptech aiti.edu.vn © AiTi Education 39