SlideShare a Scribd company logo
Dr. Satya Bhushan Verma
Assistant Professor
 Coding Standard and Guidelines
 Code Review
 Code walk-through
 Code inspection
 Testing
 Design of Test Cases
 Black-box testing
 White Box testing
 Good software development organization usually develop there own coding
standard and guidelines depending on what beat suit their needs and the types of
products they develop.
 Do not use coding style that is too clever or too difficult to understand.
 Avoid obscure side effect.
 Do not use an identifier for multiple purpose
 The code should be well documented.
 Do not used GOTO statement.
 Code review for a module is carried out after the module is successfully compiled
and all the syntax errors eliminated. Code reviews are extremely cost-effective
strategies for reduction in coding errors in order to produce high quality code.
1. Code walk-through
2. Code inspection
 Code walk-through is an informal code analysis technique. In this technique, after
a module has been coded, it is successfully compiled and all syntax errors are
eliminated.
 The main objectives of the walk-through are to discover the algorithmic and
logical errors in the code.
 the aim of code inspection is to discover some common types of errors caused due
to oversight and improper programming.
 The following is a list of some programming errors which can be checked
during code inspection:
 Use of uninitialized variables
 Jumps into loops
 Nonterminating loops
 Incompatible assignments
 Array indices out of bounds
 Improper storage allocation and deallocation
 Mismatches between actual and formal parameters in procedure calls
 Use of incorrect logical operators or incorrect precedence among operators
 Testing a program consists of subjecting the program to a set of test inputs (or test
cases) and observing if the program behaves as expected.
 The following are some commonly used terms associated with testing.
1. A failure is a manifestation of an error (or defect or bug). But the mere presence
of an error may not necessarily lead to a failure.
2. A test case is the triplet [I, S, O], where I is the data input to the system, S is
the state of the system at which the data is input, and O is the expected output
of the system.
3. A test suite is the set of all test cases with which a given software product is to
be tested.
 Following is simple programming error.
If (x>y) max = x;
else max = x;
 The test suite ((x = 3. y = 2); (x = 2, y = 3)) can detect the error
 whereas a larger test suite ( (x = 3, y = 2); (x = 4, y = 3); (x = 5, y = 1)] does not
detect the error.
 Two main approaches to systematically designing test cases
1. Black-box approach
2. White-box (or glass-box) approach
 In black-box testing test cases are designed from an examination of the
input/output values only and no knowledge of design or code is required.
 The following are the two main approaches to designing black-box test cases.
1. Equivalence class partitioning
2. Boundary value analysis
 The following are some general guidelines for designing the equivalence classes
1. If the input data values to a system can be specified by a range of values, then
one valid and two invalid equivalence classes should be defined.
2. If the input data assumes values from a set of discrete members of some
domain, then one equivalence class for valid input values and another for
invalid input values should be defined.
 For a software that computes the square root of an input integer which can
assume values between 0 and 5000, there are three equivalence classes: The set of
negative integers, the set of integers in the range between 0 and 5000, and the
integers larger than 5000. Therefore the test cases must include representative
values from each of the three equivalence classes and a possible test set can
therefore be: [-5, 500, 6000)
 Boundary testing is the process of testing between extreme ends or boundaries
between partitions of the input values.
 Extreme ends like Start- End, Lower- Upper, Maximum-Minimum, Just Inside-
Just Outside values are called boundary values and the testing is called
"boundary testing".
1. Minimum
2. Just near the minimum
3. Just near the maximum
4. Maximum
 For a function that computes the square root of integer values in the range
between 0 and 5000.
 The test ceases are ( 0, -1, 1, 5000, 4999, 5001 ).
 There are several white box testing strategies. Each testing strategy is based on
some heuristic.
 The statement coverage strategy aims to design test cases so that every statement
in a program is executed at least once.
 The principal idea governing the statement coverage strategy is that unless we
execute a statement, we have no way of determining if an error exists in that
statement. Unless a statement is executed, we cannot observe whether it causes
failure due to some illegal memory access, wrong result computation, etc.
int compute_gcd (x, y)
int x, y;
{
while (x != y){
if (xx>y) then
x=x-y
else y=y-x;
}
return x;
}
By choosing the test set ( (x=3, y=3).(x=4. y=3), (x=3, y=4) ). we can exercise the program
such that all statements are executed at least once.
 In the branch coverage-based testing strategy, test cases are designed to make
each branch condition assume true and false values in turn.
 Branch testing is also known as edge testing as in this testing scheme, each edge
of a program's control flow graph is traversed at least once.
 Testcases for branch Coverage [(x=3, y=3).(x=3. y=2), (x=4, y=3). (x=3, y=4))
 The path coverage-based testing strategy requires us to design test cases such
that a linearly independent paths in the program are executed at least once. A
linearly independent path can be defined in terms of the control flow graph (CFG)
of a program.
Coding and testing In Software Engineering
Coding and testing In Software Engineering
Coding and testing In Software Engineering

More Related Content

What's hot

Software Verification, Validation and Testing
Software Verification, Validation and TestingSoftware Verification, Validation and Testing
Software Verification, Validation and Testing
Dr Sukhpal Singh Gill
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
niharika5412
 
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Ryan Tran
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
Gregory Solovey
 
Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniques
Khuong Nguyen
 
Black box testing or behavioral testing
Black box testing or behavioral testingBlack box testing or behavioral testing
Black box testing or behavioral testingSlideshare
 
Fundamental Test Design Techniques
Fundamental Test Design TechniquesFundamental Test Design Techniques
Fundamental Test Design Techniques
TechWell
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing Fundamentals
Kiran Kumar
 
White Box Testing V0.2
White Box Testing V0.2White Box Testing V0.2
White Box Testing V0.2
Nivetha Padmanaban
 
Software Quality Testing
Software Quality TestingSoftware Quality Testing
Software Quality Testing
Kiran Kumar
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
Bipul Roy Bpl
 
Black box testing
Black box testingBlack box testing
Black box testing
Nakul Sharma
 
Boundary and equivalnce systematic test design
Boundary and equivalnce   systematic test designBoundary and equivalnce   systematic test design
Boundary and equivalnce systematic test design
Ian McDonald
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
Alisha Roy
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
Kiran Kumar
 
Input Space Partitioning
Input Space PartitioningInput Space Partitioning
Input Space PartitioningRiyad Parvez
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
Testbytes
 
Black box testing
Black box testingBlack box testing
Black box testing
Abdul Basit
 
Blackbox
BlackboxBlackbox
Blackbox
GuruKrishnaTeja
 

What's hot (20)

Software Verification, Validation and Testing
Software Verification, Validation and TestingSoftware Verification, Validation and Testing
Software Verification, Validation and Testing
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
 
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniques
 
Black box testing or behavioral testing
Black box testing or behavioral testingBlack box testing or behavioral testing
Black box testing or behavioral testing
 
Fundamental Test Design Techniques
Fundamental Test Design TechniquesFundamental Test Design Techniques
Fundamental Test Design Techniques
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing Fundamentals
 
White Box Testing V0.2
White Box Testing V0.2White Box Testing V0.2
White Box Testing V0.2
 
Software Quality Testing
Software Quality TestingSoftware Quality Testing
Software Quality Testing
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Boundary and equivalnce systematic test design
Boundary and equivalnce   systematic test designBoundary and equivalnce   systematic test design
Boundary and equivalnce systematic test design
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
 
Input Space Partitioning
Input Space PartitioningInput Space Partitioning
Input Space Partitioning
 
Whitebox
WhiteboxWhitebox
Whitebox
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Blackbox
BlackboxBlackbox
Blackbox
 

Similar to Coding and testing In Software Engineering

5.Black Box Testing and Levels of Testing.ppt
5.Black Box Testing and Levels of Testing.ppt5.Black Box Testing and Levels of Testing.ppt
5.Black Box Testing and Levels of Testing.ppt
SyedAhmad732853
 
SWE-6 TESTING.pptx
SWE-6 TESTING.pptxSWE-6 TESTING.pptx
SWE-6 TESTING.pptx
prashant821809
 
Software testing
Software testingSoftware testing
Software testingBala Ganesh
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
bhushan Nehete
 
Unit testing
Unit testingUnit testing
Unit testingmedsherb
 
Paper 06
Paper 06Paper 06
Paper 06
Sunil Pandey
 
White-box testing.pptx
White-box testing.pptxWhite-box testing.pptx
White-box testing.pptx
halaalz3by
 
ISTQB Advanced Study Guide - 4
ISTQB Advanced Study Guide - 4ISTQB Advanced Study Guide - 4
ISTQB Advanced Study Guide - 4
Yogindernath Gupta
 
Testing
TestingTesting
Testing
Mohammed
 
Software testing strategy
Software testing strategySoftware testing strategy
Software testing strategy
ijseajournal
 
lec-11 Testing.ppt
lec-11 Testing.pptlec-11 Testing.ppt
lec-11 Testing.ppt
debjani12
 
Unit2 for st
Unit2 for stUnit2 for st
Unit2 for st
Poonkodi Jayakumar
 
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
Khizra Sammad
 
software testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblbsoftware testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblb
jeyasrig
 
Software testing definition
Software testing definitionSoftware testing definition
Software testing definition
Hiro Mia
 
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
 
Testing
TestingTesting
Testing
Muni Ram
 

Similar to Coding and testing In Software Engineering (20)

5.Black Box Testing and Levels of Testing.ppt
5.Black Box Testing and Levels of Testing.ppt5.Black Box Testing and Levels of Testing.ppt
5.Black Box Testing and Levels of Testing.ppt
 
SWE-6 TESTING.pptx
SWE-6 TESTING.pptxSWE-6 TESTING.pptx
SWE-6 TESTING.pptx
 
Software testing
Software testingSoftware testing
Software testing
 
Testing
TestingTesting
Testing
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
 
Unit testing
Unit testingUnit testing
Unit testing
 
Paper 06
Paper 06Paper 06
Paper 06
 
Black box software testing
Black box software testingBlack box software testing
Black box software testing
 
White-box testing.pptx
White-box testing.pptxWhite-box testing.pptx
White-box testing.pptx
 
ISTQB Advanced Study Guide - 4
ISTQB Advanced Study Guide - 4ISTQB Advanced Study Guide - 4
ISTQB Advanced Study Guide - 4
 
Testing
TestingTesting
Testing
 
Software testing strategy
Software testing strategySoftware testing strategy
Software testing strategy
 
lec-11 Testing.ppt
lec-11 Testing.pptlec-11 Testing.ppt
lec-11 Testing.ppt
 
Unit2 for st
Unit2 for stUnit2 for st
Unit2 for st
 
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
 
software testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblbsoftware testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblb
 
Block 1 ms-034 unit-1
Block 1 ms-034 unit-1Block 1 ms-034 unit-1
Block 1 ms-034 unit-1
 
Software testing definition
Software testing definitionSoftware testing definition
Software testing definition
 
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
 
Testing
TestingTesting
Testing
 

Recently uploaded

ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 

Coding and testing In Software Engineering

  • 1. Dr. Satya Bhushan Verma Assistant Professor
  • 2.  Coding Standard and Guidelines  Code Review  Code walk-through  Code inspection  Testing  Design of Test Cases  Black-box testing  White Box testing
  • 3.  Good software development organization usually develop there own coding standard and guidelines depending on what beat suit their needs and the types of products they develop.
  • 4.  Do not use coding style that is too clever or too difficult to understand.  Avoid obscure side effect.  Do not use an identifier for multiple purpose  The code should be well documented.  Do not used GOTO statement.
  • 5.  Code review for a module is carried out after the module is successfully compiled and all the syntax errors eliminated. Code reviews are extremely cost-effective strategies for reduction in coding errors in order to produce high quality code. 1. Code walk-through 2. Code inspection
  • 6.  Code walk-through is an informal code analysis technique. In this technique, after a module has been coded, it is successfully compiled and all syntax errors are eliminated.  The main objectives of the walk-through are to discover the algorithmic and logical errors in the code.
  • 7.  the aim of code inspection is to discover some common types of errors caused due to oversight and improper programming.  The following is a list of some programming errors which can be checked during code inspection:  Use of uninitialized variables  Jumps into loops  Nonterminating loops  Incompatible assignments  Array indices out of bounds  Improper storage allocation and deallocation  Mismatches between actual and formal parameters in procedure calls  Use of incorrect logical operators or incorrect precedence among operators
  • 8.  Testing a program consists of subjecting the program to a set of test inputs (or test cases) and observing if the program behaves as expected.  The following are some commonly used terms associated with testing. 1. A failure is a manifestation of an error (or defect or bug). But the mere presence of an error may not necessarily lead to a failure. 2. A test case is the triplet [I, S, O], where I is the data input to the system, S is the state of the system at which the data is input, and O is the expected output of the system. 3. A test suite is the set of all test cases with which a given software product is to be tested.
  • 9.  Following is simple programming error. If (x>y) max = x; else max = x;  The test suite ((x = 3. y = 2); (x = 2, y = 3)) can detect the error  whereas a larger test suite ( (x = 3, y = 2); (x = 4, y = 3); (x = 5, y = 1)] does not detect the error.
  • 10.  Two main approaches to systematically designing test cases 1. Black-box approach 2. White-box (or glass-box) approach
  • 11.  In black-box testing test cases are designed from an examination of the input/output values only and no knowledge of design or code is required.  The following are the two main approaches to designing black-box test cases. 1. Equivalence class partitioning 2. Boundary value analysis
  • 12.  The following are some general guidelines for designing the equivalence classes 1. If the input data values to a system can be specified by a range of values, then one valid and two invalid equivalence classes should be defined. 2. If the input data assumes values from a set of discrete members of some domain, then one equivalence class for valid input values and another for invalid input values should be defined.
  • 13.  For a software that computes the square root of an input integer which can assume values between 0 and 5000, there are three equivalence classes: The set of negative integers, the set of integers in the range between 0 and 5000, and the integers larger than 5000. Therefore the test cases must include representative values from each of the three equivalence classes and a possible test set can therefore be: [-5, 500, 6000)
  • 14.  Boundary testing is the process of testing between extreme ends or boundaries between partitions of the input values.  Extreme ends like Start- End, Lower- Upper, Maximum-Minimum, Just Inside- Just Outside values are called boundary values and the testing is called "boundary testing". 1. Minimum 2. Just near the minimum 3. Just near the maximum 4. Maximum
  • 15.  For a function that computes the square root of integer values in the range between 0 and 5000.  The test ceases are ( 0, -1, 1, 5000, 4999, 5001 ).
  • 16.  There are several white box testing strategies. Each testing strategy is based on some heuristic.
  • 17.  The statement coverage strategy aims to design test cases so that every statement in a program is executed at least once.  The principal idea governing the statement coverage strategy is that unless we execute a statement, we have no way of determining if an error exists in that statement. Unless a statement is executed, we cannot observe whether it causes failure due to some illegal memory access, wrong result computation, etc.
  • 18. int compute_gcd (x, y) int x, y; { while (x != y){ if (xx>y) then x=x-y else y=y-x; } return x; } By choosing the test set ( (x=3, y=3).(x=4. y=3), (x=3, y=4) ). we can exercise the program such that all statements are executed at least once.
  • 19.  In the branch coverage-based testing strategy, test cases are designed to make each branch condition assume true and false values in turn.  Branch testing is also known as edge testing as in this testing scheme, each edge of a program's control flow graph is traversed at least once.  Testcases for branch Coverage [(x=3, y=3).(x=3. y=2), (x=4, y=3). (x=3, y=4))
  • 20.  The path coverage-based testing strategy requires us to design test cases such that a linearly independent paths in the program are executed at least once. A linearly independent path can be defined in terms of the control flow graph (CFG) of a program.