Unit 4 Software Coding and Testing
Unit 4 Software Coding and Testing
INTRODUCTION - CODING
The objective of coding phase is to transform the
design of a system into code in a high-level language,
and then to unit test this code.
A good software development organizations require
their programmers to adhere to some well-defined and
standard style of coding which they call their coding
standard.
The main advantages of adhering to a standard style of
coding are the following:
A coding standard gives a uniform appearance to the codes
written by different engineers.
It facilitates code understanding. 2
1
08-05-2024
2
08-05-2024
CODE REVIEW
Code review for a module is undertaken after the
module successfully compiles.
That is , all the syntax errors have been eliminated
form the module.
By: Mr. Jigar Patel
3
08-05-2024
CODE WALKTHROUGH
CODE INSPECTION
During code inspection, the code is examined for the
presence of some common programming errors.
By: Mr. Jigar Patel
4
08-05-2024
CODE WALKTHROUGH
Code walkthrough is an informal code analysis
technique.
By: Mr. Jigar Patel
5
08-05-2024
SOFTWARE DOCUMENTATION
When a software product is developed, in addition to
the executable files and the source code, several
kinds of documents such as users’ manual, SRS
document, design document, test document,
By: Mr. Jigar Patel
6
08-05-2024
External Documentation:
These are the supporting documents that
usually accompany a software product. 13
INTERNAL DOCUMENTATION
Internal documentation is provided in the source
code itself.
Internal documentation can be provided in the code
in several forms.
By: Mr. Jigar Patel
7
08-05-2024
EXTERNAL DOCUMENTATION
External documentation is provided through various
types of supporting documents such as users’
manual, SRS document, design document, test
document etc.
TESTING
The aim of program testing is to identify all defects in
a program.
However, in practice, even after satisfactory
completion of the testing phase, it is not possible to
By: Mr. Jigar Patel
8
08-05-2024
Validation Vs Verification
Verification : Verification is the process of determining
whether the output of one phase of software development
Error correction
TESTING PROCESS
By: Mr. Jigar Patel
18
9
08-05-2024
TESTING METHODS
There are two main approaches to design test
cases:
20
10
08-05-2024
21
classes.
The partitioning is done such that for every
input data belonging to the same equivalence
class, the program behaves similarly.
Equivalence classes for a program can be
designed by examining the input data and
output data.
22
11
08-05-2024
12
08-05-2024
26
13
08-05-2024
Coverage-based testing
A coverage-based testing strategy attempts to
By: Mr. Jigar Patel
28
14
08-05-2024
Statement Coverage:
The statement coverage-based strategy aims to
design test cases so as to execute every statement
in a program at least once.
29
{
while(x!=y)
{
if(x>y) then
x=x-y;
else
y=y-x;
}
30
}
15
08-05-2024
31
Branch Coverage:
Branch coverage-based testing requires test cases to
be designed so as to make each branch condition in
By: Mr. Jigar Patel
16
08-05-2024
Path Coverage:
Path coverage-based testing strategy requires designing
test cases such that all linearly independent paths in the
program are executed at least once.
Example:
Sequence:
1. a=5;
By: Mr. Jigar Patel
2. b = a*2 -1
Selection:
1. if(a>b)
2. c=3;
3. else c=5;
4. c=c*c;
34
17
08-05-2024
Iteration:
1. while(a>b) {
35
ALPHA TESTING
Alpha testing involves both the white box and black box
testing.
Alpha testing is performed by testers who are usually
By: Mr. Jigar Patel
18
08-05-2024
BETA TESTING
Beta testing commonly uses black-box testing.
Beta testing is performed by clients who are not part of the
organization.
UNIT TESTING
Unit testing is undertaken after a module has
been coded and successfully reviewed.
Unit testing (or module testing) is the testing of
By: Mr. Jigar Patel
19
08-05-2024
40
20
08-05-2024
INTEGRATION TESTING
Integration testing is the second level of the
software testing process comes after unit testing.
41
21
08-05-2024
TESTING DOCUMENTATION
Test documentation refers to the collection of
documents created during the software testing
process.
By: Mr. Jigar Patel
22
08-05-2024
45
ADVANTAGE
It promote systematic approach in software
testing.
By: Mr. Jigar Patel
46
23
08-05-2024
DISADVANTAGE
Poor documentation directly affect the quality of
the software product.
47
24