MSBTE STE Chapter 1 PPTs I Scheme
MSBTE STE Chapter 1 PPTs I Scheme
YEAR
The aim of this course is to help the student to attain the following
industry identified competency through various teaching learning
experiences:
Apply types, levels and methods of software testing on
applications.
COURSE OUTCOMES (COs)
1. Apply various software testing methods.
2..Prepare test cases for different types and levels of testing.
3. Prepare test plan for an application.
4. Identify bugs to create defect report of given application.
5. Test software for performance measures using automated testing tools.
TEACHING AND EXAMINATION SCHEME
Unit 1: Basics of software Testing and testing methods
(14 Marks)
1.1 Software Testing, Objectives of Testing
1.3 Test Case, When to Start and Stop Testing of Software (Entry and Exit Criteria)
1.6 The box approach: White Box Testing: Inspections, Walkthroughs, Technical Reviews,
Functional Testing, Code Coverage Testing, Code Complexity Testing.
1.7 Black Box Testing: Requirement Based Testing, Boundary Value Analysis, Equivalence
Partitioning,
Unit 2 Types and levels of Testing (18 Marks)
1.3 Test Case, When to Start and Stop Testing of Software (Entry and Exit Criteria)
1.6 The box approach: White Box Testing: Inspections, Walkthroughs, Technical Reviews,
Functional Testing, Code Coverage Testing, Code Complexity Testing.
1.7 Black Box Testing: Requirement Based Testing, Boundary Value Analysis, Equivalence
Partitioning,
Software Testing background
Unit 1: Basics of software Testing and testing methods ( 14 marks)
What Is a Bug?
What Is a Bug?
I. Problem, error, and bug are probably the most generic terms used.
ii. Anomaly, incident, and variance don’t sound quite so negative and infer
more unintended operation than an all-out failure.
iii. Fault, failure, and defect tend to imply a condition that’s really severe,
maybe even dangerous. It doesn’t sound right to call an incorrectly colored
icon a fault. These words also tend to imply blame: “It’s his fault that the
software failed.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
v. As all the words sound the same they are distinguished based on the
severity and the area in which the software failure has occurred.
v. When we run a program the error that we get during execution is termed
on the basis of runtime error, compile time error, computational error, and
assignment error.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
vi. The error can be removed by debugging, if not resolved leads to a problem
vii. A bug can be defined as the initiation of error or a problem due to which fault,
failure, incident or an anomaly occurs.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Nature of errors
Categories of Software Errors:
● Design errors
● Documentation errors
● Architecture errors
● Module interface errors
● Performance error
● Logic errors such as calculation errors
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Why do defects occur in software?
Software is written by human beings
Who know something, but not everything
Who have skills, but aren’t perfect
Who don’t usually use rigorous methods
Who do make mistakes (errors)
Under increasing pressure to deliver to strict deadlines
No time to check, assumptions may be wrong
Systems may be incomplete
Software is complex, abstract and invisible
Hard to understand
Hard to see if it is complete or working correctly
No one person can fully understand large systems
Numerous external interfaces and dependencies
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Sources of defects
Education
Developers does not understand well enough what he or she is doing
Lack of proper education leads to errors in specification,design, coding, and testing
Communication
Developers do not know enough
Information does not reach all stakeholders
Information is lost
Oversight
Omitting to do necessary things
Transcription
Developer knows what to do but simply makes a mistake
Process
Process is not applicable for the actual situation Process places restrictions that cause errors
Unit 1: Basics of software Testing and testing methods ( 14 marks)
● Why do Bugs occur?
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Testing can be defined in simple words as “Performing Verification and Validation of the
Software Product” for its correctness and accuracy of working.
ii. The testing of software is an important means of assessing the software to determine its
quality.
iii. Since testing typically consumes 40% to 50% of development efforts, and consumes more
effort for systems that require higher levels of reliability, it is a significant part of the software
engineering.
Unit 1: Basics of software Testing and testing methods (14 marks)
Definition of Testing
iv. With the development of fourth generation languages (4GL), which speeds up the
implementation process, the proportion of time devoted to testing increased.
v. As the amount of maintenance and upgrade of existing systems grow, significant amount of
testing will also be needed to verify systems after changes are made.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Objectives of testing:
The objectives of testing can vary depending on the context and goals of the testing process, but
generally, they include:
1. Finding defects or bugs: One of the primary objectives of testing is to identify defects or bugs
in the software. This helps in ensuring that the software behaves as expected and meets the
specified requirements.
2. Ensuring quality: Testing aims to verify that the software meets the quality standards defined
for it. This includes reliability, usability, performance, security, and other aspects of quality.
3. Validation and verification: Testing helps to validate that the software meets the business
requirements and verify that the software is built according to the design specifications.
4. Improving reliability: By testing the software thoroughly, developers can ensure that it
functions reliably under different conditions and scenarios.
5. Risk mitigation: Testing helps in identifying and mitigating risks associated with the software,
such as potential failures or issues that could impact users or the organization.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Objectives of testing:
6. Confirmation of requirements: Testing ensures that the software meets the specified
requirements and that the implemented features work as intended.
7. Customer satisfaction: Testing contributes to customer satisfaction by ensuring that the
software meets their expectations and functions correctly.
8. Cost-effectiveness: Finding and fixing defects earlier in the development process is
generally less costly than addressing them later, making testing a cost-effective practice.
9 .Compliance: Testing ensures that the software complies with relevant standards, regulations,
and guidelines applicable to its domain.
10. Continuous improvement: Testing provides feedback to the development team, enabling
continuous improvement of the software and the development process itself.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
ii. Following are the aspects which should be considered to stop the testing:
● Testing Deadlines.
● Completion of test case execution.
● Completion of Functional and code coverage to a certain point.
● Bug rate falls below a certain level and no high priority bugs are identified.
● Management decision.
Test cases completed with certain percentage passed and test coverage is achieved.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
ii. All the planned and systematic activities implemented within the quality system that can
be demonstrated to provide confidence that a product or service will fulfill requirements
for quality.
Quality Assurance
iv. Quality Assurance is a system for evaluating performance, service of the quality of a
product against a system standard or specified requirement for customers.
Standards: Standards are the criteria’s to which the s/w product is compared.
● Design Standards: Specify forms and contents of design product. They provide
rules and methods for translating the s/w requirements into the s/w design.
● Code Standards: Specify the language in which code is to written and define any
restrictions on use of language features.
● They define legal language structures, style conversions, rules for data structure
and interface.
ii. The operational techniques and activities used to fulfill requirements for quality.
iii. Quality Control on the other hand is the physical verification that the product conforms to
these planned arrangements by inspection, measurement etc.
iv. Quality Control is the process involved within the system to ensure job management,
competence and performance during the manufacturing of the product or service to ensure
it meets the quality plan as designed.
v. Quality Control just measures and determines the quality level of products or services.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Verification
i. It makes sure that the product is designed to deliver all functionality to the customer.
Verification is done at the starting of the development process. It includes reviews and
meetings, walkthroughs, inspection, etc. to evaluate documents, plans, code, requirements
and specifications.
iv. Am I accessing the data right (in the right place; in the right way).
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Verification
V. It is a Low level activity
vi. Performed during development on key art facts, like walkthroughs, reviews
at each stage and between each stage of the development life cycle.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Validation
1. Determining if the system complies with the requirements and performs functions for
which it is intended and meets the organization’s goals and user needs.
2. Validation is done at the end of the development process and takes place after
verifications are completed.
4. Am I accessing the right data (in terms of the data required to satisfy the requirement).
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Validation
5. It is a High level activity.
6. Performed after a work product is produced against established criteria ensuring that the
product integrates correctly into the environment.
2. It does not involve executing the code. 2. It always involves executing the code.
4. Verification uses methods like inspections, 4. Validation uses methods like black box
reviews, walkthroughs, and Desk-checking etc. (functional) testing, gray box testing, and white
box (structural) testing etc.
In the V-Model software development life cycle different steps are followed however here
we will taking a most common type of V-model example. The V-model typically consist of
the following phases:
Unit Testing: Preparation of Unit Test Cases
Under V-model, the corresponding testing phase of the development phase is planned in
parallel. So there is verification on one side of V & validation phase on the other side of V
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Verification Phase:
1. Overall Business Requirement: In this first phase of the development cycle, the product
requirements are understood from customer perspective. This phase involves detailed
communication with the customer to understand his expectations and exact requirements. The
acceptance test design planning is done at this stage as business requirements can be used as
an input for acceptance testing.
2. Software Requirement: Once the product requirements are clearly known, the system can
be designed. The system design comprises of understanding & detailing the complete
hardware, software & communication set up for the product under development. System test
plan is designed based on system design. Doing this at earlier stage leaves more time for
actual test execution later
Unit 1: Basics of software Testing and testing methods ( 14 marks)
3. High level design: High level specification are understood & designed in this phase.
Usually more than one technical approach is proposed & based on the technical &
financial feasibility, the final decision is taken. System design is broken down further
into modules taking up different functionality.
4. Low level design: In this phase the detailed integral design for all the system modules
is specified. It is important that the design is compatible with the other modules in the
system & other external system. Components tests can be designed at this stage based on
the internal module design.
5. Coding: The actual coding of the system modules designed in the design phase is
taken up in the coding phase. The base suitable programming language is decided base
on requirements. Coding is done based on the coding guidelines & standards.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Validation phase :
1. Unit Testing: Unit testing designed in coding are executed on the code during this
validation phase. This helps to eliminate bugs at an early stage.
2. Components testing: This is associated with module design helps to eliminate defects in
individual modules.
3. Integration Testing: It is associated with high level design phase & it is performed to test
the coexistence & communication of the internal modules within the system
4. System Testing: It is associated with system design phase. It checks the entire system
functionality & the communication of the system under development with external systems.
Most of the software & hardware compatibility issues can be uncovered using system test
execution.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
5. Acceptance Testing: It is associated with overall & involves testing the product in
user environment. These tests uncover the compatibility issues with the other systems
available in the user environment. It also uncovers the non-functional issues such as
load & performance defects in the actual user environment.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
1. Not suitable for the projects where requirements are at a moderate to high risk of
changing.
2. If any changes happen in midway, then the test documents along with
requirement documents has to be updated.
3. Software is developed during the implementation phase, so no early
prototypes of the software are produced.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Methods of testing:
1. Static Testing :
● Static testing is the testing of the software work products manually, or with a set of
tools, but they are not executed.
● It starts early in the Life cycle and so it is done during the verification process. It
does not need computer as the testing of program is done without executing the
program.
● For example: reviewing, walk through, inspection, etc. Static testing consists of
following methods 1) Walkthrough 2) Inspection 3) Technical Review.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
● Since static testing can start early in the life cycle, early feedback on quality issues
can be established.
● By detecting defects at an early stage, rework costs are most often relatively low.
Since rework effort is substantially reduced, development productivity figures are
likely to increase.
● The evaluation by a team has the additional advantage that there is an exchange of
information between the participants.
● Static tests contribute to an increased awareness of quality issues.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Dynamic testing
Formal Review
● Identify Problems: The goal of the review is to find problems with the
software—not just items that are wrong, but missing items as well.
● Follow Rules. A fixed set of rules should be followed. They may set the amount of
code to be reviewed (usually a couple hundred lines), how much time will be
spent (a couple hours), what can be commented on, and so on.
● Prepare. Each participant is expected to prepare for and contribute to the review.
Depending on the type of review, participants may have different roles.
● Write a Report. The review group must produce a written report summarizing
the results of the review and make that report available to the rest of the
product development team.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Advantages
● As the tester has knowledge of the source code. It becomes very easy to find out which
type of data can help in testing the application effectively.
● Extra lines of code can be removed which can bring in hidden defects.
● It helps in optimizing the code.
● Due to the tester's knowledge about the code, maximum coverage is attained during
writing test cases.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Disadvantages
● Due to the fact that a skilled tester is needed to perform.
● Necessity to create full range of inputs to test each path and condition make the white
box testing method time-consuming.
● Some conditions might be untested as it is not realistic to test every single one.
● Specialized tools like code analysers and debugging tools are required.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
● The tester is unaware to the system architecture and does not have access to the
source code.
● Tester interact with the system's user interface by providing inputs .
● Examining outputs without knowing how and where the inputs are worked upon.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Advantages
● Well suited and efficient for large code segments.
● Code Access not required.
● Test is performed from a user’s point-of-view and not of the designer’s.
● Tester is free from any pressure of knowledge of specific programming languages to
test the functionality of an application.
● Test cases can be designed as soon as the specifications are complete.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Disadvantages
● Blind Coverage, since the tester cannot target specific code segments or error prone
areas.
● Testing every possible input stream is not possible because it is time-consuming.
● Inefficient testing, due to the fact that the tester only has limited knowledge about an
application.
● The test cases are difficult to design.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Peer Reviews
● The least formal method.
● The programmer and one or two other programmers or testers acting as
reviewers.
● Small group simply reviews the code together
● The review is highly effective
● The four key elements of a formal review are in place:
○Look for problems,
○follow rules,
○prepare for the review, and
○write a report.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
A test plan is a systematic approach to testing a system i.e. software. The plan typically
contains a detailed understanding of what the eventual testing workflow will be.
It will include:
• Test Data
Unit 1: Basics of software Testing and testing methods ( 14 marks)
● With black-box testing, tester only know the value of the variable is at the
beginning and at the end.
print(“Average=%d”,c);
}
o/p:- Enter values of a and b 2 4 Average=3
a=2
b=4
C=6
C=3
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Data coverage
Data includes all the variables, constants, arrays, data structures, keyboard
and mouse input, files and screen input and output, and I/O to other devices
such as modems, networks, and so on.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
The declaration of data is complete with the assignment statement and the
variable declaration statements. All the variable declared are properly
utilized.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Program Statement and Line Coverage (Code Coverage Testing)
With line coverage the tester tests the code line by line.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
example of the Visual Basic debugger in operation.
If you test this program with the goal of 100% statement coverage, need to run only a single
test case with the Date$ variable set to January 1, 2000.
The program would then execute the following path: Lines 1, 2, 3, 4, 5, 6, 7
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Branch Coverage
Need to try a test case for a date that’s not January 1,2000.
If you did, the program would execute the other path through the program: Lines
1, 2, 5, 6, 7
Most code coverage analyzers report both statement coverage and branch
coverage results separately
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Branch Coverage
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Condition Coverage (Code Coverage Testing)
An extra condition is added to the IF statement in line 2 that checks the time as well
as the date.
Condition coverage testing takes the extra conditions on the branch statements into
account.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Condition Coverage
● For example, if source code contains no control flow statement then its cyclomatic
complexity will be 1 and source code contains a single path in it.
● Similarly, if the source code contains one if condition then cyclomatic complexity
will be 2 because there will be two paths one for true and the other for false.
● M= P + 1
Where P = Number of predicate nodes (node that contains condition)
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Cyclomatic complexity (Code Complexity Testing)
The cyclomatic complexity calculated for above code will be from the control flow graph.
The graph shows seven shapes(nodes), seven lines(edges), hence cyclomatic complexity is
7-7+2 = 2.Or M= P + 1, Where P = Number of predicate nodes (node that contains condition)
M=1+1= 2.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Cyclomatic complexity
Use of Cyclomatic Complexity:
1. Determining the independent path executions thus proven to be very helpful for
Developers and Testers.
2. It can make sure that every path has been tested at least once.
3. Thus help to focus more on uncovered paths.
4. Code coverage (condition coverage testing) can be improved.
5. Risk associated with the program can be evaluated.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
if(a>b)
if(a>c)
print a;
else
print c;
else
print b;
Unit 1: Basics of software Testing and testing methods ( 14 marks)
M= E-N+2 M= 8-7+2=3
M=P+1 M=2+1=3
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Find Cyclomatic complexity
if(a>b)
print a;
else
if(c>b)
if(c>a)
print c;
else
print b;
else
print a;
Unit 1: Basics of software Testing and testing methods ( 14 marks)
M= E-N+2
M= 11-9+2
M=4
M=P+1
M=3+1
M=4
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Positive Testing
● Positive Testing is testing process where the system validated against the valid
input data.
● In this testing tester always check for only valid set of values and check if
an application behaves as expected with its expected inputs.
● The main intention - to check whether software application not showing
error when not supposed to & showing error when supposed to.
● Keeping positive point of view & only execute the positive scenario.
● Positive Testing always tries to prove that a given product and project
always meets the requirements and specifications.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Positive Testing
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Negative Testing
● Negative Testing is testing process where the system validated against
the invalid input data.
● Such testing is to be carried out keeping negative point of view & only
execute the test cases for only invalid set of input data.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Negative Testing
● The main reason behind Negative testing is to check the stability
of the software application against the different variety of incorrect
data.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Sub-Boundary Conditions
Equivalence Partitioning
● Divides the input domain of the program into classes of data from which the test
cases can be divided.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Equivalence Partitioning
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Test condition:-
● Any Number greater than 10 entered in the Order Book field is considered
invalid.
● Any Number less than 1 , then it is considered invalid.
● Numbers 1 to 10 are considered valid.
● Accept only two digit number.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
● Consider the possibility for entering the filename in standard Save As dialog box
● A Windows filename can contain any characters except \ / : * ? “ < > and |.
● Filenames can have from 1 to 255 characters. If you’re creating test cases for filenames,
you will have equivalence partitions for valid characters, invalid characters, valid length
names, names that are too short, and names that are too long.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Unit 1: Basics of software Testing and testing methods ( 14 marks)
-100 is invalid.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
State Testing
Windows Paint program in the pencil drawing state.This is the initial state in
which the software starts. Notice that the pencil tool is selected, the cursor looks
like a pencil, and a fine line is used to draw on screen.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
The same program in the airbrush state. In this state, the airbrush tool
is selected, airbrush sizes are provided, the cursor looks like a
spray-paint can, and drawing results in a spray-paint look.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
The state transition diagram should be easily understandable and should be able to explain
clearly about the various stages the software passes through.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
● The input or condition that takes it from one state to the next.
Example
Shopping website
● Searching items without login
● Searching items with login
● Payment
● Logout
● Order details
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Responsibility is to cover all the parts that makeup the entire software
product.
It’s possible that the people writing the documentation aren’t experts in what
the software does.
3. Condition Entries: In the condition entries portion of the decision table, we have
a number of columns and each column represents a rule. Values entered in this
upper right portion of the table are known as inputs.
4. Action Entries: Each entry in the action entries portion has some associated
action or set of actions in this lower right portion of the table. These values
are known as outputs and are dependent upon the functionality of the program.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Decision Tables
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Decision Tables
Now, let's see how a decision table is created for the login function in which we
can log in by using email and password. Both the email and the password are the
conditions, and the expected result is action.
Unit 1: Basics of software Testing and testing methods ( 14 marks)
Decision Tables
Example:
Three types of customers are defined:
Regular customer,
Silver customer,
Gold customer
Data flow modeling – nodes are data objects and links are
transformations from one data object to another.
Unit 1: Basics of software Testing and testing methods ( 14 marks)