SlideShare una empresa de Scribd logo
1 de 23
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

Más contenido relacionado

La actualidad más candente

Black box testing or behavioral testing
Black box testing or behavioral testingBlack box testing or behavioral testing
Black box testing or behavioral testing
Slideshare
 
Input Space Partitioning
Input Space PartitioningInput Space Partitioning
Input Space Partitioning
Riyad Parvez
 

La actualidad más candente (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 a Coding and testing In Software Engineering

Software testing
Software testingSoftware testing
Software testing
Bala Ganesh
 
Unit testing
Unit testingUnit testing
Unit testing
medsherb
 
lec-11 Testing.ppt
lec-11 Testing.pptlec-11 Testing.ppt
lec-11 Testing.ppt
debjani12
 
software testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblbsoftware testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblb
jeyasrig
 
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
 

Similar a 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
 

Último

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 

Último (20)

data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 

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.