SlideShare a Scribd company logo
Software
Coding and Testing
by:
Dr. Bharat V. Chawda
Computer Engineering Department,
BBIT, VVNagar, Gujarat, India
1
Overview
 Introduction
 Code Review
 Software Documentation
 Testing
 Test Documentation
(As per GTU Curriculum – Diploma in Computer/IT Engineering)
Based on Books:
1. Fundamentals of Software Engineering – by Rajib Mall
2. Software Engineering: A Practitioner’s Approach – by Roger Pressman
2
Introduction: Coding
 When?
 After:
 Design phase is complete, and
 Design docs are successfully reviewed
 Objective
 Design of System  Code in high-level lang
 Unit test this code
 Coding Standards
 Coding Guidelines
3
Code Review
 When?
 After: Module successfully compiles
 All the syntax errors have been eliminated
 Code review v/s Testing
 CR: Cost-effective strategy for error elimination
 CR: Direct detects errors
 T: Detects failures only: diff i/p, circumstances
 Testing: Requires efforts: Debugging – locate
errors; Error Correction – fix the bug
 CR: Two Types
 Code Walkthrough, Code Inspection
4
Code Walkthrough
 Informal code analysis technique
 When to review?
 After: Module is Coded, Compiled, and Syntax Errors
are eliminated
 How?
 Few members of dev team are assigned this task
 Each member selects some test cases
 Simulate execution of code by hand
 (Trace execution through different Statements and
Instructions of the code)
 Note down findings; Discuss with coder in WT meeting
5
Code Walkthrough (cont)
 Objective
 Discover the algorithmic and logical errors in
the code
 Guidelines
 Team size: Not too big, not too small: 3-7
member
 Focus on discovery of errors, not on how to fix
them
 Managers should not attend WT meeting – To
avoid feeling: engineers are being evaluated
6
Code Inspection
 Code is examined for the presence of some
common/classical programming
errors
 Use of uninitialized variables
 Incompatible assignments
 Non terminating loops; Jumps into loops;
Improper modification of loop variables
 Mismatch in arguments in procedure (fun) calls
 Array indices out of bounds
 Improper storage allocation and de-allocation
 Use of incorrect logical operators; Precedence
 Comparison of equality of floating point values 7
Code Inspection (cont)
 Objective:
 Check for the common types of errors
 Check whether coding standard have been
adhered to
 SW companies can maintain list of
commonly committed error  check list for
code inspection
8
Software Documentation
 SW Product
 Executable files + Source Code + Documents
 Documents: Users’ manual, SRS doc, Design
doc, Test doc, Installation manual, etc
 Why required?
 Enhances understandability of SW product;
Reduces effort & time required 4 maintenance
 Help users to und & effectively use the system
 Help in effectively tackling manpower turnover
 Help manager to effectively track progress
9
SW: Internal Documentation
 Code comprehension features: provided in
the source code itself
 Comments embedded in the source code
 Use of meaningful variable names
 Module and function headers
 Code indentation
 Code structuring (modules + functions)
 Use of constant identifiers
 Use of enumerated types
 Use of user-defined data types
10
SW: External Documentation
 Contains various types of supportive docs
 Users’ manual
 SRS doc
 Design doc
 Test doc
 Installation manual…
 Features: Good external documentation
 Consistency
 Understandability
11
Gunning’s Fog Index
 Metric to measure the readability of a document
 Fog(D) = [0.4 * words/sentences] +
[% of words having >=3 syllables]
 Example: “The Gunning’s fog index is based on
the premise that use of short sentences and
simple words makes a document easy to
understand”
 Fog(D) = [0.4 * 23 / 1] + [4 / 23 * 100]
= 26
 Indicates the no. of years of formal education
required to comfortably understand document
12
Testing: Introduction
 Testing:
 Aim: Identify all defects in a program
 Error / Defect / Bug / Fault:
 Mistake committed by development team
during any of the development phases.
 Failure:
 Manifestation of an error
 Symptom of an error
 Test case: Triplet [I, S, O]: I/P, State, O/P
 Test suite: Set of all test cases…
13
Testing: Levels/Stages
 Unit Testing
 Integration Testing
 System Testing
14
Unit Testing
 When?
 After: Module has been coded and reviewed
 How?
 Design test cases
 Develop Environment
 Do testing
 Environment
 Driver + Module + Stub
(Stub: Dummy procedures with simplified behavior)
(Driver: Non-local data str + Code to call fun of module)
15
Driver
Stub
Module under Test
Global
Data
Black Box Testing
16
int find_max(int x, int y)
{
int max;
if (x>y)
max = x;
else
max = y;
return max;
}
x
y
max
find_max
Black Box Testing
 Concept
 Based on functional specification of SW
 Based on functional behavior: Inputs/Outputs
 Also known as: Functional Testing
 No knowledge of design & code is required
 Two main approaches
 Equivalence Class Partitioning
 Boundary Value Analysis
17
Black Box Testing: Example
 SW: Computes square root of integer
values in the range of 0 and 5000.
 Test Cases: Equivalence Class Partitioning
 {-5, 500, 6000}
 Test Cases: Boundary Value Analysis
 {-1, 0, 5000, 5001}
18
White Box Testing
19
int find_max(int x, int y)
{
int max;
if (x>y)
max = x;
else
max = y;
return max;
}
x
y
max
find_max
White Box Testing
 Concept
 Based on analysis of code
 Based on structure of the implementation
 Also known as: Structural Testing
 Knowledge of design & code is required
 Two Types
 Fault based: Targets: detect certain types of F
 Coverage based: Targets: execute (cover)
certain elements of a program
20
White Box T: Coverage based
 Strategies
 Statement Coverage
 Each statement should be executed at least once
 Branch Coverage
 Each branch : traversed at least once
 Condition Coverage
 Each condition : True at least once and false at least
once
 Path Coverage
 Each linearly independent path : executed at least
once
21
White Box T: Example
int test (int x, int y)
{ int z;
z = -1;
if (x>0 && y>0)
z = x;
return z;
}
22
Statement Coverage:
{(x=1,y=1)}
Branch Coverage:
{(1,1), (0,0)}
Condition Coverage:
{(0,0), (0,1), (1,0), (1,1)}
White Box T: Path Coverage
 Concept
 All linearly independent paths in the program
are executed at least once
 CFG: Control Flow Graph
 Directed graph – consisting of a set of Nodes
(N) and Edges (E) where
 Nodes (N): corresponds to a unique program
statement
 Edges (E): Transfer of control From one node
to another node
23
White Box T: Path Coverage
 Example:
int gcd (int x, int y)
{
while (x!=y)
{
if (x>y)
x=x-y;
else
y=y-x;
}
return x;
}
24
White Box T: Path Coverage
 Example:
int gcd (int x, int y)
{
1. while (x!=y)
{
2. if (x>y)
3. x=x-y;
else
4. y=y-x;
5. }
6. return x;
}
25
1
2
3 4
5
6
 CFG:
Cyclomatic Complexity Metric
 V(G) = E – N + 2
 V(G) = Total number of Non-overlapping
Bounded Areas + 1
 V(G) = Total number of Non-overlapping
Areas
 V(G) = Decision Points + 1
 V(G) = Predicate Nodes + 1
26
Cyclomatic Complexity of previous example of GCD: 3
Test Documentation
 When: Towards end of testing
 Represents: Test summary report
 Specifies:
 Total number of tests: applied to a sub-system
 How many tests were successful
 How many tests were unsuccessful; and at
which extent (degree): totally or partially
27
Thank-U…!!!
28

More Related Content

What's hot

Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects
yndaravind
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
R. Sosa
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)Jay Patel
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
Ajit Nayak
 
SQA - chapter 13 (Software Quality Infrastructure)
SQA - chapter 13 (Software Quality Infrastructure)SQA - chapter 13 (Software Quality Infrastructure)
SQA - chapter 13 (Software Quality Infrastructure)
uma sree
 
McCall Software Quality Model in Software Quality Assurance
McCall Software Quality Model in Software Quality Assurance McCall Software Quality Model in Software Quality Assurance
McCall Software Quality Model in Software Quality Assurance
sundas Shabbir
 
Corba introduction and simple example
Corba introduction and simple example Corba introduction and simple example
Corba introduction and simple example Alexia Wang
 
Advanced topics in software engineering
Advanced topics in software engineeringAdvanced topics in software engineering
Advanced topics in software engineering
Rupesh Vaishnav
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
Zahoorali Khan
 
A Brief Introduction to Software Configuration Management
A Brief Introduction to Software Configuration ManagementA Brief Introduction to Software Configuration Management
A Brief Introduction to Software Configuration Management
Md Mamunur Rashid
 
Java Programming
Java ProgrammingJava Programming
Java Programming
Anjan Mahanta
 
Mc call's software quality model
Mc call's software quality modelMc call's software quality model
Mc call's software quality model
Yatharth Aggarwal
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginnerAjailal Parackal
 
V model presentation
V model presentationV model presentation
V model presentation
Niat Murad
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-conceptsmedsherb
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and typesConfiz
 
What is Integration Testing? | Edureka
What is Integration Testing? | EdurekaWhat is Integration Testing? | Edureka
What is Integration Testing? | Edureka
Edureka!
 
UML (Unified Modeling Language)
UML (Unified Modeling Language)UML (Unified Modeling Language)
UML (Unified Modeling Language)
Nguyen Tuan
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing FundamentalsChankey Pathak
 

What's hot (20)

Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
 
SQA - chapter 13 (Software Quality Infrastructure)
SQA - chapter 13 (Software Quality Infrastructure)SQA - chapter 13 (Software Quality Infrastructure)
SQA - chapter 13 (Software Quality Infrastructure)
 
McCall Software Quality Model in Software Quality Assurance
McCall Software Quality Model in Software Quality Assurance McCall Software Quality Model in Software Quality Assurance
McCall Software Quality Model in Software Quality Assurance
 
Corba introduction and simple example
Corba introduction and simple example Corba introduction and simple example
Corba introduction and simple example
 
Advanced topics in software engineering
Advanced topics in software engineeringAdvanced topics in software engineering
Advanced topics in software engineering
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 
A Brief Introduction to Software Configuration Management
A Brief Introduction to Software Configuration ManagementA Brief Introduction to Software Configuration Management
A Brief Introduction to Software Configuration Management
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Mc call's software quality model
Mc call's software quality modelMc call's software quality model
Mc call's software quality model
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
 
V model presentation
V model presentationV model presentation
V model presentation
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-concepts
 
Testing
TestingTesting
Testing
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
 
What is Integration Testing? | Edureka
What is Integration Testing? | EdurekaWhat is Integration Testing? | Edureka
What is Integration Testing? | Edureka
 
UML (Unified Modeling Language)
UML (Unified Modeling Language)UML (Unified Modeling Language)
UML (Unified Modeling Language)
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
 

Similar to SE2023 0401 Software Coding and Testing.pptx

CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdgCS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
RahithAhsan1
 
Chapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docxChapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docx
keturahhazelhurst
 
Coding and testing in Software Engineering
Coding and testing in Software EngineeringCoding and testing in Software Engineering
Coding and testing in Software Engineering
Abhay Vijay
 
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
Parasoft .TEST, Write better C# Code Using  Data Flow Analysis Parasoft .TEST, Write better C# Code Using  Data Flow Analysis
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
Engineering Software Lab
 
Software Testing - Day One
Software Testing - Day OneSoftware Testing - Day One
Software Testing - Day OneGovardhan Reddy
 
Testing
TestingTesting
Testing
Muni Ram
 
Testing material (1).docx
Testing material (1).docxTesting material (1).docx
Testing material (1).docx
KVamshiKrishna5
 
Manual Testing Interview Questions & Answers.docx
Manual Testing Interview Questions & Answers.docxManual Testing Interview Questions & Answers.docx
Manual Testing Interview Questions & Answers.docx
ssuser305f65
 
Software testing
Software testingSoftware testing
Software testingBala Ganesh
 
Software Testing interview - Q&A and tips
Software Testing interview - Q&A and tipsSoftware Testing interview - Q&A and tips
Software Testing interview - Q&A and tips
Pankaj Dubey
 
Software testing (2)
Software testing (2)Software testing (2)
Software testing (2)
dhanalakshmisai
 
Object oriented sad 6
Object oriented sad 6Object oriented sad 6
Object oriented sad 6
Bisrat Girma
 
Ensuring code quality
Ensuring code qualityEnsuring code quality
Ensuring code quality
MikhailVladimirov
 
Software testing strategies
Software testing strategiesSoftware testing strategies
Software testing strategiesKrishna Sujeer
 
Anders Claesson - Test Strategies in Agile Projects - EuroSTAR 2010
Anders Claesson - Test Strategies in Agile Projects - EuroSTAR 2010Anders Claesson - Test Strategies in Agile Projects - EuroSTAR 2010
Anders Claesson - Test Strategies in Agile Projects - EuroSTAR 2010
TEST Huddle
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Babul Mirdha
 
pccf unit 1 _VP.pptx
pccf unit 1 _VP.pptxpccf unit 1 _VP.pptx
pccf unit 1 _VP.pptx
vishnupriyapm4
 
Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow Testing
Hirra Sultan
 
Gcs day1
Gcs day1Gcs day1
Gcs day1
Sriram Angajala
 
SWE-6 TESTING.pptx
SWE-6 TESTING.pptxSWE-6 TESTING.pptx
SWE-6 TESTING.pptx
prashant821809
 

Similar to SE2023 0401 Software Coding and Testing.pptx (20)

CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdgCS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
 
Chapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docxChapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docx
 
Coding and testing in Software Engineering
Coding and testing in Software EngineeringCoding and testing in Software Engineering
Coding and testing in Software Engineering
 
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
Parasoft .TEST, Write better C# Code Using  Data Flow Analysis Parasoft .TEST, Write better C# Code Using  Data Flow Analysis
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
 
Software Testing - Day One
Software Testing - Day OneSoftware Testing - Day One
Software Testing - Day One
 
Testing
TestingTesting
Testing
 
Testing material (1).docx
Testing material (1).docxTesting material (1).docx
Testing material (1).docx
 
Manual Testing Interview Questions & Answers.docx
Manual Testing Interview Questions & Answers.docxManual Testing Interview Questions & Answers.docx
Manual Testing Interview Questions & Answers.docx
 
Software testing
Software testingSoftware testing
Software testing
 
Software Testing interview - Q&A and tips
Software Testing interview - Q&A and tipsSoftware Testing interview - Q&A and tips
Software Testing interview - Q&A and tips
 
Software testing (2)
Software testing (2)Software testing (2)
Software testing (2)
 
Object oriented sad 6
Object oriented sad 6Object oriented sad 6
Object oriented sad 6
 
Ensuring code quality
Ensuring code qualityEnsuring code quality
Ensuring code quality
 
Software testing strategies
Software testing strategiesSoftware testing strategies
Software testing strategies
 
Anders Claesson - Test Strategies in Agile Projects - EuroSTAR 2010
Anders Claesson - Test Strategies in Agile Projects - EuroSTAR 2010Anders Claesson - Test Strategies in Agile Projects - EuroSTAR 2010
Anders Claesson - Test Strategies in Agile Projects - EuroSTAR 2010
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)
 
pccf unit 1 _VP.pptx
pccf unit 1 _VP.pptxpccf unit 1 _VP.pptx
pccf unit 1 _VP.pptx
 
Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow Testing
 
Gcs day1
Gcs day1Gcs day1
Gcs day1
 
SWE-6 TESTING.pptx
SWE-6 TESTING.pptxSWE-6 TESTING.pptx
SWE-6 TESTING.pptx
 

More from Bharat Chawda

SE2023 0301 Software Project Management.pptx
SE2023 0301 Software Project Management.pptxSE2023 0301 Software Project Management.pptx
SE2023 0301 Software Project Management.pptx
Bharat Chawda
 
SE2023 0207 Software Architectural Design.pptx
SE2023 0207 Software Architectural Design.pptxSE2023 0207 Software Architectural Design.pptx
SE2023 0207 Software Architectural Design.pptx
Bharat Chawda
 
SE2023 0206 Use Case Diagram.pptx
SE2023 0206 Use Case Diagram.pptxSE2023 0206 Use Case Diagram.pptx
SE2023 0206 Use Case Diagram.pptx
Bharat Chawda
 
SE2023 0205 Activity Diagram.pptx
SE2023 0205 Activity Diagram.pptxSE2023 0205 Activity Diagram.pptx
SE2023 0205 Activity Diagram.pptx
Bharat Chawda
 
SE2023 0204 Data Modeling.pptx
SE2023 0204 Data Modeling.pptxSE2023 0204 Data Modeling.pptx
SE2023 0204 Data Modeling.pptx
Bharat Chawda
 
SE2023 0203 Inventory System.pptx
SE2023 0203 Inventory System.pptxSE2023 0203 Inventory System.pptx
SE2023 0203 Inventory System.pptx
Bharat Chawda
 
SE2023 0202 DFD.pptx
SE2023 0202 DFD.pptxSE2023 0202 DFD.pptx
SE2023 0202 DFD.pptx
Bharat Chawda
 
SE2023 0201 Software Analysis and Design.pptx
SE2023 0201 Software Analysis and Design.pptxSE2023 0201 Software Analysis and Design.pptx
SE2023 0201 Software Analysis and Design.pptx
Bharat Chawda
 
Book Store Management System - Functional Requirements - 2021
Book Store Management System - Functional Requirements - 2021Book Store Management System - Functional Requirements - 2021
Book Store Management System - Functional Requirements - 2021
Bharat Chawda
 
Book Store Management System - Database Design - 2021
Book Store Management System - Database Design - 2021Book Store Management System - Database Design - 2021
Book Store Management System - Database Design - 2021
Bharat Chawda
 
ECHM - Ecology and environment
ECHM - Ecology and environmentECHM - Ecology and environment
ECHM - Ecology and environment
Bharat Chawda
 

More from Bharat Chawda (11)

SE2023 0301 Software Project Management.pptx
SE2023 0301 Software Project Management.pptxSE2023 0301 Software Project Management.pptx
SE2023 0301 Software Project Management.pptx
 
SE2023 0207 Software Architectural Design.pptx
SE2023 0207 Software Architectural Design.pptxSE2023 0207 Software Architectural Design.pptx
SE2023 0207 Software Architectural Design.pptx
 
SE2023 0206 Use Case Diagram.pptx
SE2023 0206 Use Case Diagram.pptxSE2023 0206 Use Case Diagram.pptx
SE2023 0206 Use Case Diagram.pptx
 
SE2023 0205 Activity Diagram.pptx
SE2023 0205 Activity Diagram.pptxSE2023 0205 Activity Diagram.pptx
SE2023 0205 Activity Diagram.pptx
 
SE2023 0204 Data Modeling.pptx
SE2023 0204 Data Modeling.pptxSE2023 0204 Data Modeling.pptx
SE2023 0204 Data Modeling.pptx
 
SE2023 0203 Inventory System.pptx
SE2023 0203 Inventory System.pptxSE2023 0203 Inventory System.pptx
SE2023 0203 Inventory System.pptx
 
SE2023 0202 DFD.pptx
SE2023 0202 DFD.pptxSE2023 0202 DFD.pptx
SE2023 0202 DFD.pptx
 
SE2023 0201 Software Analysis and Design.pptx
SE2023 0201 Software Analysis and Design.pptxSE2023 0201 Software Analysis and Design.pptx
SE2023 0201 Software Analysis and Design.pptx
 
Book Store Management System - Functional Requirements - 2021
Book Store Management System - Functional Requirements - 2021Book Store Management System - Functional Requirements - 2021
Book Store Management System - Functional Requirements - 2021
 
Book Store Management System - Database Design - 2021
Book Store Management System - Database Design - 2021Book Store Management System - Database Design - 2021
Book Store Management System - Database Design - 2021
 
ECHM - Ecology and environment
ECHM - Ecology and environmentECHM - Ecology and environment
ECHM - Ecology and environment
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 

SE2023 0401 Software Coding and Testing.pptx

  • 1. Software Coding and Testing by: Dr. Bharat V. Chawda Computer Engineering Department, BBIT, VVNagar, Gujarat, India 1
  • 2. Overview  Introduction  Code Review  Software Documentation  Testing  Test Documentation (As per GTU Curriculum – Diploma in Computer/IT Engineering) Based on Books: 1. Fundamentals of Software Engineering – by Rajib Mall 2. Software Engineering: A Practitioner’s Approach – by Roger Pressman 2
  • 3. Introduction: Coding  When?  After:  Design phase is complete, and  Design docs are successfully reviewed  Objective  Design of System  Code in high-level lang  Unit test this code  Coding Standards  Coding Guidelines 3
  • 4. Code Review  When?  After: Module successfully compiles  All the syntax errors have been eliminated  Code review v/s Testing  CR: Cost-effective strategy for error elimination  CR: Direct detects errors  T: Detects failures only: diff i/p, circumstances  Testing: Requires efforts: Debugging – locate errors; Error Correction – fix the bug  CR: Two Types  Code Walkthrough, Code Inspection 4
  • 5. Code Walkthrough  Informal code analysis technique  When to review?  After: Module is Coded, Compiled, and Syntax Errors are eliminated  How?  Few members of dev team are assigned this task  Each member selects some test cases  Simulate execution of code by hand  (Trace execution through different Statements and Instructions of the code)  Note down findings; Discuss with coder in WT meeting 5
  • 6. Code Walkthrough (cont)  Objective  Discover the algorithmic and logical errors in the code  Guidelines  Team size: Not too big, not too small: 3-7 member  Focus on discovery of errors, not on how to fix them  Managers should not attend WT meeting – To avoid feeling: engineers are being evaluated 6
  • 7. Code Inspection  Code is examined for the presence of some common/classical programming errors  Use of uninitialized variables  Incompatible assignments  Non terminating loops; Jumps into loops; Improper modification of loop variables  Mismatch in arguments in procedure (fun) calls  Array indices out of bounds  Improper storage allocation and de-allocation  Use of incorrect logical operators; Precedence  Comparison of equality of floating point values 7
  • 8. Code Inspection (cont)  Objective:  Check for the common types of errors  Check whether coding standard have been adhered to  SW companies can maintain list of commonly committed error  check list for code inspection 8
  • 9. Software Documentation  SW Product  Executable files + Source Code + Documents  Documents: Users’ manual, SRS doc, Design doc, Test doc, Installation manual, etc  Why required?  Enhances understandability of SW product; Reduces effort & time required 4 maintenance  Help users to und & effectively use the system  Help in effectively tackling manpower turnover  Help manager to effectively track progress 9
  • 10. SW: Internal Documentation  Code comprehension features: provided in the source code itself  Comments embedded in the source code  Use of meaningful variable names  Module and function headers  Code indentation  Code structuring (modules + functions)  Use of constant identifiers  Use of enumerated types  Use of user-defined data types 10
  • 11. SW: External Documentation  Contains various types of supportive docs  Users’ manual  SRS doc  Design doc  Test doc  Installation manual…  Features: Good external documentation  Consistency  Understandability 11
  • 12. Gunning’s Fog Index  Metric to measure the readability of a document  Fog(D) = [0.4 * words/sentences] + [% of words having >=3 syllables]  Example: “The Gunning’s fog index is based on the premise that use of short sentences and simple words makes a document easy to understand”  Fog(D) = [0.4 * 23 / 1] + [4 / 23 * 100] = 26  Indicates the no. of years of formal education required to comfortably understand document 12
  • 13. Testing: Introduction  Testing:  Aim: Identify all defects in a program  Error / Defect / Bug / Fault:  Mistake committed by development team during any of the development phases.  Failure:  Manifestation of an error  Symptom of an error  Test case: Triplet [I, S, O]: I/P, State, O/P  Test suite: Set of all test cases… 13
  • 14. Testing: Levels/Stages  Unit Testing  Integration Testing  System Testing 14
  • 15. Unit Testing  When?  After: Module has been coded and reviewed  How?  Design test cases  Develop Environment  Do testing  Environment  Driver + Module + Stub (Stub: Dummy procedures with simplified behavior) (Driver: Non-local data str + Code to call fun of module) 15 Driver Stub Module under Test Global Data
  • 16. Black Box Testing 16 int find_max(int x, int y) { int max; if (x>y) max = x; else max = y; return max; } x y max find_max
  • 17. Black Box Testing  Concept  Based on functional specification of SW  Based on functional behavior: Inputs/Outputs  Also known as: Functional Testing  No knowledge of design & code is required  Two main approaches  Equivalence Class Partitioning  Boundary Value Analysis 17
  • 18. Black Box Testing: Example  SW: Computes square root of integer values in the range of 0 and 5000.  Test Cases: Equivalence Class Partitioning  {-5, 500, 6000}  Test Cases: Boundary Value Analysis  {-1, 0, 5000, 5001} 18
  • 19. White Box Testing 19 int find_max(int x, int y) { int max; if (x>y) max = x; else max = y; return max; } x y max find_max
  • 20. White Box Testing  Concept  Based on analysis of code  Based on structure of the implementation  Also known as: Structural Testing  Knowledge of design & code is required  Two Types  Fault based: Targets: detect certain types of F  Coverage based: Targets: execute (cover) certain elements of a program 20
  • 21. White Box T: Coverage based  Strategies  Statement Coverage  Each statement should be executed at least once  Branch Coverage  Each branch : traversed at least once  Condition Coverage  Each condition : True at least once and false at least once  Path Coverage  Each linearly independent path : executed at least once 21
  • 22. White Box T: Example int test (int x, int y) { int z; z = -1; if (x>0 && y>0) z = x; return z; } 22 Statement Coverage: {(x=1,y=1)} Branch Coverage: {(1,1), (0,0)} Condition Coverage: {(0,0), (0,1), (1,0), (1,1)}
  • 23. White Box T: Path Coverage  Concept  All linearly independent paths in the program are executed at least once  CFG: Control Flow Graph  Directed graph – consisting of a set of Nodes (N) and Edges (E) where  Nodes (N): corresponds to a unique program statement  Edges (E): Transfer of control From one node to another node 23
  • 24. White Box T: Path Coverage  Example: int gcd (int x, int y) { while (x!=y) { if (x>y) x=x-y; else y=y-x; } return x; } 24
  • 25. White Box T: Path Coverage  Example: int gcd (int x, int y) { 1. while (x!=y) { 2. if (x>y) 3. x=x-y; else 4. y=y-x; 5. } 6. return x; } 25 1 2 3 4 5 6  CFG:
  • 26. Cyclomatic Complexity Metric  V(G) = E – N + 2  V(G) = Total number of Non-overlapping Bounded Areas + 1  V(G) = Total number of Non-overlapping Areas  V(G) = Decision Points + 1  V(G) = Predicate Nodes + 1 26 Cyclomatic Complexity of previous example of GCD: 3
  • 27. Test Documentation  When: Towards end of testing  Represents: Test summary report  Specifies:  Total number of tests: applied to a sub-system  How many tests were successful  How many tests were unsuccessful; and at which extent (degree): totally or partially 27