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 (20)

PPTX
The role of the parser and Error recovery strategies ppt in compiler design
Sadia Akter
 
PPTX
SQL commands
GirdharRatne
 
PPT
Regular Grammar
Ruchika Sinha
 
PPTX
Regular expressions
Ratnakar Mikkili
 
PPTX
1.10. pumping lemma for regular sets
Sampath Kumar S
 
PPTX
SQL - Structured query language introduction
Smriti Jain
 
PPTX
Queues in C++
Vineeta Garg
 
PPTX
Regular expressions in Python
Sujith Kumar
 
PPTX
Looping statement in python
RaginiJain21
 
PPTX
Unit I Database concepts - RDBMS & ORACLE
DrkhanchanaR
 
DOC
DBMS Practical File
Dushmanta Nath
 
PDF
How to use Map() Filter() and Reduce() functions in Python | Edureka
Edureka!
 
PPTX
File handling in Python
Megha V
 
PPTX
Array in c++
Mahesha Mano
 
PPT
12. Indexing and Hashing in DBMS
koolkampus
 
PDF
UNIT II LINEAR DATA STRUCTURES – STACKS, QUEUES
Kathirvel Ayyaswamy
 
PPTX
Syntax-Directed Translation into Three Address Code
sanchi29
 
PPTX
push down automata
Christopher Chizoba
 
PPT
Indexing and Hashing
sathish sak
 
PPTX
Dbms Introduction and Basics
SHIKHA GAUTAM
 
The role of the parser and Error recovery strategies ppt in compiler design
Sadia Akter
 
SQL commands
GirdharRatne
 
Regular Grammar
Ruchika Sinha
 
Regular expressions
Ratnakar Mikkili
 
1.10. pumping lemma for regular sets
Sampath Kumar S
 
SQL - Structured query language introduction
Smriti Jain
 
Queues in C++
Vineeta Garg
 
Regular expressions in Python
Sujith Kumar
 
Looping statement in python
RaginiJain21
 
Unit I Database concepts - RDBMS & ORACLE
DrkhanchanaR
 
DBMS Practical File
Dushmanta Nath
 
How to use Map() Filter() and Reduce() functions in Python | Edureka
Edureka!
 
File handling in Python
Megha V
 
Array in c++
Mahesha Mano
 
12. Indexing and Hashing in DBMS
koolkampus
 
UNIT II LINEAR DATA STRUCTURES – STACKS, QUEUES
Kathirvel Ayyaswamy
 
Syntax-Directed Translation into Three Address Code
sanchi29
 
push down automata
Christopher Chizoba
 
Indexing and Hashing
sathish sak
 
Dbms Introduction and Basics
SHIKHA GAUTAM
 

Similar to Coding and testing In Software Engineering (20)

PPTX
SWE-6 TESTING.pptx
prashant821809
 
PPT
Seii unit6 software-testing-techniques
Ahmad sohail Kakar
 
PDF
Block 1 ms-034 unit-1
Nirmal Jasmatiya
 
PPTX
SE2023 0401 Software Coding and Testing.pptx
Bharat Chawda
 
PPT
Newsoftware testing-techniques-141114004511-conversion-gate01
Mr. Jhon
 
PPT
Testing
nazeer pasha
 
PPT
CS8494 SOFTWARE ENGINEERING Unit-4
SIMONTHOMAS S
 
PPT
AutoTest.ppt
PrashanthJanakiraman
 
PPT
AutoTest.ppt
Rohit846825
 
PPT
AutoTest.ppt
CHANDUKAYALA
 
PPT
New software testing-techniques
Fincy V.J
 
PPTX
dynamic testing for polytechnic students
antonylinda1
 
PPT
Chapter 14 software testing techniques
SHREEHARI WADAWADAGI
 
PPT
AutoTest for software engineering for automated testing
VishnuVardhan909561
 
PPT
Automation testing basics and tools presentation
areebjafriv
 
PPT
Testing
Sonali Chauhan
 
PPT
testing(2).pptjjsieieo2i33kejjskskosowwiwk
mhuzaifasultan8
 
PPT
<p>Software Testing</p>
Atul Mishra
 
PPT
An overview to Software Testing
Atul Mishra
 
PPS
Lesson 2....PPT 1
bhushan Nehete
 
SWE-6 TESTING.pptx
prashant821809
 
Seii unit6 software-testing-techniques
Ahmad sohail Kakar
 
Block 1 ms-034 unit-1
Nirmal Jasmatiya
 
SE2023 0401 Software Coding and Testing.pptx
Bharat Chawda
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Mr. Jhon
 
Testing
nazeer pasha
 
CS8494 SOFTWARE ENGINEERING Unit-4
SIMONTHOMAS S
 
AutoTest.ppt
PrashanthJanakiraman
 
AutoTest.ppt
Rohit846825
 
AutoTest.ppt
CHANDUKAYALA
 
New software testing-techniques
Fincy V.J
 
dynamic testing for polytechnic students
antonylinda1
 
Chapter 14 software testing techniques
SHREEHARI WADAWADAGI
 
AutoTest for software engineering for automated testing
VishnuVardhan909561
 
Automation testing basics and tools presentation
areebjafriv
 
testing(2).pptjjsieieo2i33kejjskskosowwiwk
mhuzaifasultan8
 
<p>Software Testing</p>
Atul Mishra
 
An overview to Software Testing
Atul Mishra
 
Lesson 2....PPT 1
bhushan Nehete
 
Ad

Recently uploaded (20)

PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PDF
Design Thinking basics for Engineers.pdf
CMR University
 
PPTX
Presentation 2.pptx AI-powered home security systems Secure-by-design IoT fr...
SoundaryaBC2
 
PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PDF
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PDF
Data structures notes for unit 2 in computer science.pdf
sshubhamsingh265
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
Design Thinking basics for Engineers.pdf
CMR University
 
Presentation 2.pptx AI-powered home security systems Secure-by-design IoT fr...
SoundaryaBC2
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Data structures notes for unit 2 in computer science.pdf
sshubhamsingh265
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
Ad

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.