0% found this document useful (0 votes)
16 views91 pages

Chapter1 Final

kbhbbbbjb

Uploaded by

Xenon Y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views91 pages

Chapter1 Final

kbhbbbbjb

Uploaded by

Xenon Y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 91

Unit 1 : Basic Of Software

Testing &
Testing Methods( 14 Marks)
By:Vijaya Chavan
Basics of Software Testing :
 Software testing is the process of identifying the correctness and quality of
software program.
 Software testing is a process with intending to find defects.
 Software testing is done by software tester.
 Developer can also make error.

Basics of Software Testing & Software Method 10/23/2024 2


s
What is Software Testing
 Finding defects  Measuring performance,
 Trying to break the system
reliability, …
 Finding and reporting defects  Evaluating and measuring
 Demonstrating correct
quality
functionality  Proving the software correct
 Demonstrating incorrect  Executing pre-defined test cases
functionality  Automatic error detection
 Demonstrating robustness,

reliability, security, maintainability

Basics of Software Testing & Software Method 10/23/2024 3


s
Objectives of Software Testing :
 Finding defects.
 Creating high quality test cases.
 Quality Improvement
 Satisfying Customer Requirements
 Reliability & Quality
 To find defects before they cause a production system to fail.
 To bring the tested software, after correction of the identified defects
and retesting, to an acceptable level of quality.
 To perform the required tests efficiently and effectively, within the
limits budgetary and scheduling limitation.
 To compile a record of software errors for use in error prevention (by corrective and
preventive actions) Basics of Software Testing & Software Method 10/23/2024 4
s
Definition Of Software Testing
 Testing is the process of executing a program or software with the intent
of finding errors validating against requirements.
 Testing is a the process of exercising a software component

using a selected set of test cases, with the intent of revealing defects
and evaluating quality.
 Software testing is a technical investigation of a product, i.e.

an empirical search for quality-related information of value to a


project’s stakeholders

Basics of Software Testing & Software Method 10/23/2024 5


s
Testing Terminology
 A person makes an Error
 That creates a fault in software
 That can cause a failure in operation

Error

Fault

Bug

Failure

Defect

Basics of Software Testing & Software Method 10/23/2024 6


s
Bug, Fault & Failure
 Error : An error is a human action that produces the incorrect result that
results in a fault.
 Bug : The presence of error at the time of execution of the software.
 Fault : State of software caused by an error.
 Failure : Deviation of the software from its expected result. It is an event.
 Defect :A defect is an error or a bug, in the application which is created.
A programmer while designing and building the software can make
mistakes or error. These mistakes or errors mean that there are flaws in
the software. These are called defects.
 In Software a mistake in coding is called ERROR, Error found by tester
is called DEFECT , Defect accepted by development team then is called
BUG, Bug does not meet the requirement then is called FAILURE.
Basics of Software Testing & Software Method 10/23/2024 7
s
Nature of errors:
Categories of Software Errors:  Requirements errors
• User interface errors such as output errors  Design errors
or incorrect user messages.  Documentation errors
 Function errors  Architecture errors
 Hardware defects  Module interface errors
 Incorrect program version  Performance errors
 Logic errors such as
calculation errors

Basics of Software Testing & Software Method 10/23/2024 8


s
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

Basics of Software Testing & Software Method 10/23/2024 9


s
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

Basics of Software Testing & Software Method 10/23/2024 10


s
Who is a Software Tester??..

 Software Tester is the one who performs testing and find bugs, if they
exist in the tested application.

Basics of Software Testing & Software Method 10/23/2024 11


s
Skills Required for Tester
 Testers are explorers
 They must be troubleshooter
 They are relentless(keeps trying)
 They are creative
 They are perfectionist
 They exercise good judgements
 They are tactful and diplomatic
 Communication skills, Domain knowledge, Desire to learn
 Technical skills,Analytical skills,Planning,Integrity,Curiosity
 Thinking from users perspective

Basics of Software Testing & Software Method 10/23/2024 12


s
When to start and stop Testing?(ENTRY & EXIT CRITERIA)
(It is not possible to test the software at any time during its cycle)
When to start Testing:
1.Testing starts right from requirement phase and continues till end of SDLC.
2.An early start to testing reduces the cost ,time to rework and error free software that
is delivered to the client.
3. In SDLC testing can be started from gathering phase and lasts in the deployment
phase.
It also depends on development model that it being used.
4.Testing is done in different forms at every phase of SDLC.
5.Reviewing the design in the design phase is also considered as testing
6.Testing performed by a developer in coding phase also considered as unit testing

Basics of Software Testing & Software Method 10/23/2024 13


s
When to start and stop Testing?(ENTRY & EXIT CRITERIA)
(It is difficult to determine when to stop testing as testing is never ending process &no one can say
software is 100% tested)
When to stop Testing:
1.Testing deadlines
2. Completion of test execution
3.Completion of functional and code coverage to a certain point
Management decision

Basics of Software Testing & Software Method 10/23/2024 14


s
Test Plan
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.

Test Case
A test case is a specific procedure of testing a particular requirement.
It will include:
• Identification of specific requirement tested
• Test case success/failure criteria
• Specific steps to execute test
• Test Data

Basics of Software Testing & Software Method 10/23/2024 15


s
Test Case
Test Scenario:-Verify the login functionality.(what to test)

Test case:- ( How to test)

Case 1:Enter valid username and valid password.

Case 2:Enter valid username and invalid password.

Case 3:Enter invalid username and valid password.

Case 4:Enter invalid username and invalid password.

Basics of Software Testing & Software Method 10/23/2024 16


s
Test Case
Test Case ID: Test Designed By:<Name>

Test Priority(Low/Medium/High) Test Designed Date:<Date>

Module Name: Test Executed By:<Name>


Test Title: Test Execution Date:<Date>
Description:
Pre-Conditions:

Step Test Steps Test Data Expected Actual Status(Pass/


Result Result Fail)

Basics of Software Testing & Software Method 10/23/2024 17


s
Test Case (Example)
Test Case ID:10 Test Designed By:<Mr.ABC>

Test Priority: Medium Test Designed Date:<16/05/1984>

Module Name: Login Screen Test Executed By:<Mr.XYZ>


Test Title: Verify login with valid username & Test Execution Date:<16/6/1984>
password
Description: Test Login page
Pre-Conditions: user has valid username &
password

Basics of Software Testing & Software Method 10/23/2024 18


s
Test Case (Example)
Step Test Steps Test Data Expected Result Actual Status(Pass/
Result Fail)

1 Navigate to - - - -
login page
2 Provide valid Username=exampl Shall accept the Accepts the Pass
user name [email protected] username username
3 Provide valid Password=1234 Shall accept the Accepts the Pass
user password password
password

4 Click on Press Submit User should be User success Pass


Login button Button able to login full-logged
in

Basics of Software Testing & Software Method 10/23/2024 19


s
Validation and Verification
The idea of catching defects within each phase without letting them reach the
testing phase leads to Verification and Validation

1.Both V&V activities are two branches of software testing


2.They are complementary to each other
3. They are completely dependent on each other
4. Verification & validation is the generic name given to checking processes
which ensures that the software conforms to its specification and meets the
needs of the customer

Basics of Software Testing & Software Method 10/23/2024 20


s
Process of Verification & Validation(V&V)

Basics of Software Testing & Software Method 10/23/2024 21


s
Verification
 Definition : The process of evaluating software to determine whether the
products of a given development phase satisfy the conditions imposed at the
start of that phase.

 Verification is a static practice of verifying documents, design, code and


program. It includes all the activities associated with producing high quality
software: inspection, design analysis and specification analysis. It is a
relatively objective process.

 Verification is also called ‘static technique’ as is does not involve execution


of any code, program or work product

Basics of Software Testing & Software Method 10/23/2024 22


s
Workbench of Verification

Basics of Software Testing & Software Method 10/23/2024 23


s
Advantages of Verification
 Early and frequent verification reduces the number of bugs and defects that
may show up in later stages.
 By verifying at each stage, devs, product managers, and stakeholders can get
more insight into what the product may need to be developed better in the
coming stages.
 Even if they can’t solve all bugs immediately, verifying helps QAs estimate
the emerging issues and help them better prepare to handle those when they
appear.
 Verification helps keep software closely aligned with customers and business
requirements at every stage. This ensures that devs have to put in less
unnecessary work as development continues.

Basics of Software Testing & Software Method 10/23/2024 24


s
Disadvantages of Verification
 The most significant limitation of verification is the cost, as it can be time-
consuming. It's also susceptible to errors because of higher reliance on
manual checking, which can impact accuracy
 Actual working software may not be accessed by verification.
 Verification can not show whether the developed software is correct or not.

Basics of Software Testing & Software Method 10/23/2024 25


s
What is Validation?

 Definition: The process of evaluating software during or at the end of the


development process to determine whether it satisfies specified
requirements.

 Validation is the process of evaluating the final product to check whether


the software meets the customer expectations and requirements. It is a
dynamic mechanism of validating and testing the actual product.

Basics of Software Testing & Software Method 10/23/2024 26


s
Advantages of Validation

 Any bugs missed during verification will be detected while running


validation tests.
 If specifications were incorrect and inadequate, validation tests would

reveal their inefficacy. Teams will have to spend time and effort fixing
them, but it will prevent a bad product from hitting the market.
 Validation tests ensure that the product matches and adheres to customer

demands, preferences, and expectations under different conditions (slow


connectivity, low battery, etc.)

Basics of Software Testing & Software Method 10/23/2024 27


s
Disadvantages of Validation

 Validation may result into redundant testing.


 If defects are not found by conducting the defined test cases we can only

conclude that there is no defect in the set of transactions actually


executed.There can be many more defects not captured by these test cases

Basics of Software Testing & Software Method 10/23/2024 28


s
Workbench of Validation

Basics of Software Testing & Software Method 10/23/2024 29


s
Difference between Verification & Validation

Basics of Software Testing & Software Method 10/23/2024 30


s
V-Model

Basics of Software Testing & Software Method 10/23/2024 31


s
V-Model:

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:

1. Unit Testing: Preparation of Unit Test Cases

2. Integration Testing: Preparation of Integration Test Cases

3. System Testing: Preparation of System test cases

4. Acceptance Testing: Preparation of Acceptance Test Cases

Basics of Software Testing & Software Method 10/23/2024 32


s
Advantages of V-Model
 This is a highly disciplined model and Phases are completed one at a time.
 V-Model is used for small projects where project requirements are clear.
 Simple and easy to understand and use.
 This model focuses on verification and validation activities early in the life cycle thereby enhancing the
probability of building an error-free and good quality product.
 It enables project management to track progress accurately.
 Clear and Structured Process: The V-Model provides a clear and structured process for software
development, making it easier to understand and follow.
 Emphasis on Testing: The V-Model places a strong emphasis on testing, which helps to ensure the
quality and reliability of the software.
 Improved Traceability: The V-Model provides a clear link between the requirements and the final
product, making it easier to trace and manage changes to the software.
 Better Communication: The clear structure of the V-Model helps to improve communication between
the customer and the development team.

Basics of Software Testing & Software Method 10/23/2024 33


s
Disadvantages of V-Model

 High risk and uncertainty.


 It is not good for complex and object-oriented projects.
 It is not suitable for projects where requirements are not clear and contain a high risk of
changing.
 This model does not support iteration of phases.
 It does not easily handle concurrent events.
 Inflexibility: The V-Model is a linear and sequential model, which can make it difficult to
adapt to changing requirements or unexpected events.
 Time-Consuming: The V-Model can be time-consuming, as it requires a lot of documentation
and testing.
 Overreliance on Documentation: The V-Model places a strong emphasis on documentation,
which can lead to an overreliance on documentation at the expense of actual development
work.

Basics of Software Testing & Software Method 10/23/2024 34


s
Software Quality Fundamentals

Quality : Quality means consistently meeting customer needs in terms of


requirement, Cost and delivery schedule.

Quality of s/w is reasonably bug free, delivered on time and within budget,
meets requirements and exceptions and is maintainable.

Software quality is the degree of conformance to explicit or implicit


requirements and expectations.

Basics of Software Testing & Software Method 10/23/2024 35


s
Quality Assurance & Quality Control
1.Quality Assurance: It is a process of determining whether
products/services meet customer’s expectations.
A set of activities designed to ensure that the development process is
adequate to ensure a system will meet its goals.
((prevention)
2.Quality Control: The goal of a software tester is to find bugs, find them as
early as possible and make sure they get fixed.
A set of activities designed to evaluate a developed work product. (Detection)
3.Testing: The process of executing a system with the intent of finding
defects

Basics of Software Testing & Software Method 10/23/2024 36


s
Quality Assurance (QA): consist of Auditing and reporting procedure which are
used to provide necessary data to management. In order to make decision.
● Goal of Quality Assurance is to provide adequate confidence that a product or
services is of and quality expected by the customer.
● If the data provided through quality assurance identify problems, then it is
management’s responsibility to address the problems & apply the necessary
resources to resole quality issues.
● S/w Quality Assurance is planned and systematic way to evaluate quality of
s/w product standards processes and procedures.
● SQA consists of a means of monitoring the s/w engineering process and
methods used to insure quality ”

Basics of Software Testing & Software Method 10/23/2024 37


s
Software Quality Assurance
 QA is the process of determining whether products/services meet
customers expectations/requirements

Basics of Software Testing & Software Method 10/23/2024 38


s
Quality Control:
 The goal of a software tester is to find bugs, find them as early as possible,

and make sure they get fixed.


 Quality Control (QC) is the observation techniques and activities used to

fulfill requirements for quality


 Quality Control (QC) can be defined as "the processes and methods used to

monitor work and observe whether requirements are met".


 It includes the following activities:
 1. Reviews: (i) Requirement Review (ii) Design Review (iii) Code Review

(iv) Deployment Plan Review (v) Test Plan Review (vi) Test Cases Review
 2. Testing: (i) Unit Testing (ii) Integration Testing (iii) System Testing (iv)

Acceptance Testing

Basics of Software Testing & Software Method 10/23/2024 39


s
Difference between Quality Assurance (QA)& Quality (QC)
Control

Basics of Software Testing & Software Method 10/23/2024 40


s
Methods of Testing:

Black White Black White


Box Box Box Box
Testing Testing Testing Testing

Basics of Software Testing & Software Method 10/23/2024 41


s
Basics of Software Testing & Software Method 10/23/2024 42
s
Cost Of Quality
Cost of Quality is the total amount the company spends to achieve quality of
product.
Quality of cost is divided into cost associate with prevention, appraisal and
failure.
1. Prevention Cost: Quality Panning, Formal Technical reviews, test equipments,
staff training.
2. Appraisal Cost: Equipment Maint. Testing.In process and Inter process
Inspection.
3. Failure Cost : It will not consider if there is no defect before shipping.
Basics of Software Testing & Software Method 10/23/2024 43
s
Basics of Software Testing & Software Method 10/23/2024 44
s
White Box Testing

Executable
Program

Basics of Software Testing & Software Method 10/23/2024 45


s
White Box Testing
 White box testing is a form of application testing that provides the tester with
complete knowledge of the application being tested, including access to
source code and design documents.
 White Box testing is performed to test the programs internal structure.
 White box testing is also called Structural Testing, Glass Box Testing Clear
Testing ,Transparent Testing .
 White box testing is called so because it takes an inward look at the internal
framework and components of a software application to test the internal
structure and design of the software.
 Example: A tester studies the implementation code, determines all valid and
invalid inputs and verifies the outputs against the expected outcomes.
Basics of Software Testing & Software Method 10/23/2024 46
s
Classification of White Box Testing

Basics of Software Testing & Software Method 10/23/2024 47


s
Classification of White Box Testing
1. Static White–Box Testing: It is a type of testing in which the program
source code is tested without running it. Code is only reviewed and examined
only.
2. Structural Testing: It involves testing by running program. Here we test
the internal logic of the program.

Basics of Software Testing & Software Method 10/23/2024 48


s
Advantages of White Box Testing

 Thorough Testing: White box testing is thorough as the entire code and structures are tested.
 Code Optimization: It results in the optimization of code removing errors and helps in
removing extra lines of code.
 Early Detection of Defects: It can start at an earlier stage as it doesn’t require any interface as
in the case of black box testing.
 Integration with SDLC: White box testing can be easily started in Software Development
Life Cycle.
 Detection of Complex Defects: Testers can identify defects that cannot be detected through
other testing techniques.
 Comprehensive Test Cases: Testers can create more comprehensive and effective test cases
that cover all code paths.
 Testers can ensure that the code meets coding standards and is optimized for performance.

Basics of Software Testing & Software Method 10/23/2024 49


s
Disadvantages of White Box Testing

 Programming Knowledge and Source Code Access: Testers need to have programming
knowledge and access to the source code to perform tests.
 Overemphasis on Internal Workings: Testers may focus too much on the internal workings
of the software and may miss external issues.
 Bias in Testing: Testers may have a biased view of the software since they are familiar with
its internal workings.
 Test Case Overhead: Redesigning code and rewriting code needs test cases to be written
again.
 Dependency on Tester Expertise: Testers are required to have in-depth knowledge of the
code and programming language as opposed to black-box testing.
 Inability to Detect Missing Functionalities: Missing functionalities cannot be detected as the
code that exists is tested.
 Increased Production Errors: High chances of errors in production.

Basics of Software Testing & Software Method 10/23/2024 50


s
Static Testing
 Static testing is an approach to testing the software application without
executing the actual code. This is performed at the early stage of
development to identify the issues in the project documents in multiple
ways, namely reviews, walkthroughs, and inspections.
 Static white Box testing gives the team of black box testers ideas for test

cases to apply when they receive the software for testing.


 In some teams the programmers are the ones who organize and run reviews

and in other teams the software testers are the ones who performs this task
and asking the programmer who wrote the code

Basics of Software Testing & Software Method 10/23/2024 51


s
Static Testing

Static Testing

Formal Reviews
1. Reviews

Informal Reviews
2. Inspection

3. Walkthroughs

4. Technical
Reviews

Basics of Software Testing & Software Method 10/23/2024 52


s
1. Reviews :
 1. Informal Reviews : Not based on formal /documented
procedure.
 2. Formal Reviews: It can range from simple meeting

between two programmers to a detailed inspection of the


software’s design or its code
 Four essential elements to a formal review:
 A) Identify Problems
 B) Follow Rules
 C) Prepare
 D) Write a Report

Basics of Software Testing & Software Method 10/23/2024 53


s
2. Inspections
 These are the most formal way of static testing.
 They are highly structured and require training for each

participant.
 Inspections are different from peer reviews and

walkthroughs in that the person who presents the code, the


presenter or reader is not the original programmer
 A dedicated moderator initiates the process and conducts a

complete formal review by scheduling a meeting.


 Proper documentation has been prepared before and after

the meeting, and peer reviews will happen to understand


the product.

Basics of Software Testing & Software Method 10/23/2024 54


s
3.Structured Walkthroughs
A structured walkthrough, a static testing technique
performed in an organized manner between a group of
peers to review and discuss the technical aspects of
software development process.
 The main objective in a structured walkthrough is to find

defects in order to improve the quality of the product.

Basics of Software Testing & Software Method 10/23/2024 55


s
Benefits of Structured
Walkthroughs
 It saves time and money by finding and correcting errors
earlier in the life cycle.
 It is one of the strongest Quality Assurance technique,

which aims at detecting all the discrepancies and errors in


the software as well as to improve its quality
 This provides value added comments from reviewers with

different technical backgrounds and experience.

Basics of Software Testing & Software Method 10/23/2024 56


s
4.Technical Review
 A software technical review is examined by a team of
qualified software engineers for the suitability of the
software product.
 This process can also be defined as a critical evaluation of

an object in the software.


 Through the software technical review process, we can

identify the errors or defects in the software product in the


early phase itself.

Basics of Software Testing & Software Method 10/23/2024 57


s
5.Coding Standards
Guidelines contains recommendations to do the things in proper way.
Generic code review checklist:
 Data reference Errors
 Data Declaration Errors
 Computation Errors
 Comparison Errors
 Control Flow Errors
 I/O Errors

Basics of Software Testing & Software Method 10/23/2024 58


s
Structural/Dynamic White Box Testing
 White box testing is a dynamic testing technique that tests the internal
structure or design of the software code. It requires the tester to have
knowledge of the software code, logic, and algorithms.
 This testing is done by running the program
 Structural Testing does following type of testing

1.Code Functional Testing


2.Code Coverage Testing
3.Code Complexity Testing

Basics of Software Testing & Software Method 10/23/2024 59


s
1.Code Functional Testing

 Functional testing is a type of software testing that verifies the functionality


of a software system or application.
 It focuses on ensuring that the system behaves according to the specified

functional requirements and meets the intended business needs.


Code Functional Testing can be done by several methods:
a. Obvious Tests: Knows i/p and expected o/p
b. Debug Version: By putting i/ps checking whether program passes
through right loops and iterations the right number of times
c. Final Check : Checks final code is totally error free

Basics of Software Testing & Software Method 10/23/2024 60


s
2.Code Coverage Testing:
 In software engineering, code coverage, also called test coverage, is a
percentage measure of the degree to which the source code of a program is
executed when a particular test suite is run.
 It requires knowledge and access to code.
 Coverage=(Number of coverage items exercised/Total no of coverage

items)*100 %
 E.g. Compilers Debugger(Code coverage Analyzer)

Basics of Software Testing & Software Method 10/23/2024 61


s
Types of Code Coverage
 1. Statement Coverage
 2. Branch Coverage (Decision Coverage)
 3. Function Coverage
 4. Condition Coverage (Predicate Coverage)
 5. Path Coverage
 6. Line Coverage

Basics of Software Testing & Software Method 10/23/2024 62


s
Types of Code Coverage
1. Statement Coverage
 Measures whether each line of code is executed.

 Ensures that all code statements are tested at least once.

Example: If a function has ten lines of code, statement coverage ensures each line is executed
during testing.
Statement Coverage=(Number of coverage Statements exercised/Total no of
Statements)*100 %

2. Branch Coverage (Decision Coverage)


 Measures whether each possible branch (true/false) from each decision point is executed.

 Ensures that all branches of control structures (like if-else statements) are tested.

Example: If a program has an if-else statement, both the if and the else branches should be tested.
Branch Coverage=(Number of decision outcomes exercised/Total no of decision
outcomes )*100 %

Basics of Software Testing & Software Method 10/23/2024 63


s
Types of Code Coverage
3. Function Coverage
 Measures whether each function or subroutine in the code is called.
 Ensures that all functions in the code are invoked during testing.

Example: In a class with multiple methods, function coverage ensures each method is
called at least once.
Function Coverage=(Number of Functions exercised/Total no of Functions )*100 %

4. Condition Coverage (Predicate Coverage)


 Measures whether each Boolean sub-expression is evaluated to both true and false.
 Ensures that each condition in a decision has been tested for both true and false outcomes.

Example: In a compound condition like if (A && B), both A and B should be tested for
true and false values.
Condition Coverage=(Number of decisions exercised/Total no of decisions )*100 %

Basics of Software Testing & Software Method 10/23/2024 64


s
Types of Code Coverage
5. Path Coverage
 Measures whether all possible paths through the code are executed.
 Ensures that all possible execution paths are tested.

Example: For a function with multiple nested loops and conditionals, path
coverage would ensure all possible execution routes are tested.
Path Coverage=(Number of paths exercised/Total no of paths )*100 %

6. Line Coverage
 Measures the number of executed lines divided by the total number of lines.
 Provides a straightforward metric of how much of the codebase is executed.

Example: If a file has 100 lines and 80 lines are executed during testing, line
coverage would be 80%.

Basics of Software Testing & Software Method 10/23/2024 65


s
Types of Code Coverage
7. Loop Coverage
 Measures whether loops are executed and how many times.
 Ensures that loops are tested with zero, one, and multiple iterations.

Example: For a loop that processes items in a list, loop coverage ensures the
loop is tested with an empty list, a single-item list, and a multiple-item list.
Loop Coverage=(Number of Loops exercised/Total no of Loops )*100 %

Basics of Software Testing & Software Method 10/23/2024 66


s
3.Code Complexity Testing
 Code complexity testing is necessary to ensure the integrity and quality of a
software system. It provides an opportunity to check various aspects of code, like
its length, structures, logic paths, etc.
 Cyclomatic complexity, developed by Thomas McCabe
 It measures the complexity of a program by counting its decision points.
 It measures the number of unique paths through the code, indicating how

complex the logic is.


 Uses:

A. Gives no. of recommended tests.


B. It is used during all phases of SDLC
C. It is based on structure of software's control flow graph.

Basics of Software Testing & Software Method 10/23/2024 67


s
3.Code Complexity Testing
 Types:
A. Flow Graph notations
B. Compound Logic
C. Independent Program Paths
D. Cyclomatic Complexity
E. Limiting V(G)

Basics of Software Testing & Software Method 10/23/2024 68


s
A. Flow Graph notations
 A flow graph shows logical control flow using notations.
 Each circle is a flow graph node represents one or more statements
 A sequence of process boxes and decision diamond can map in single node.
 Arrows called edges represents flow of control
 An edge must end at node
 Areas bounded by edges and nodes are called regions.

Fig. Flow Graph Notations

Basics of Software Testing & Software Method 10/23/2024 69


s
Conversion of Flow chart to Flow Graph

Flow Chart Flow Graph

Basics of Software Testing & Software Method 10/23/2024 70


s
2.Compound Logic

 Both Compound Logic and Comparison operators test for the truth of their operands. They return a
true or false rather than a quantity. Compound Logic operators, such as AND, NOT, OR, are used to
link expressions together when creating a constraint. For example: (Condition A AND Condition B)
requires Item C.
 From Fig separate node is created for each condition (IF a or b)
 A and b are predicate nodes
 If a or b then procedure X,else procedure Y and ENDIF

Basics of Software Testing & Software Method 10/23/2024 71


s
3. Independent program Paths:

 An independent program path is any path through the program that introduces at least new one set of
processing statements
 An independent path in the control flow graph is the one which introduces at least one new edge that
has not been traversed before the path is defined.
 Path 1: 1-11 
 Path 2: 1-2-3-4-5-10-1-11 
 Path 3: 1-2-3-6-8-9-10-1-11 
 Path 4: 1-2-3-6-7-9-10-1-11

Basics of Software Testing & Software Method 10/23/2024 72


s
3. Cyclomatic Complexity

 Cyclomatic complexity is used to measure amount of decision logic in the program module
 Cyclomatic complexity indicates the difficulty of understanding and maintaining a program and
identifies areas of code that may be particularly prone to bugs and errors.
 A higher cyclomatic complexity value indicates a more complex program and, therefore, a higher risk
of bugs and errors
 Cyclomatic Complexity V(G)= E – N + 2P, where E corresponds to edges, N to nodes, and P to
connected components.
 Counting decision points: Cyclomatic Complexity V(G)= Number of decision points + 1.
 Summing up predicate nodes: Cyclomatic Complexity = Sum of all predicate nodes + 1.

Basics of Software Testing & Software Method 10/23/2024 73


s
4.Limiting V(G)

 The program module having V(G) greater than 10 considered to be complex.

Cyclomatic Complexity Complexity Level


1-10 A simple Program
11-20 More complex
21-50 More Complex
Greater than 50 Very Complex and very high risk

Basics of Software Testing & Software Method 10/23/2024 74


s
Black Box Testing
 Black-box testing is a type of software testing in which the tester is not
concerned with the software’s internal knowledge or implementation details
 In this testing tester only knows what the software is supposed to do he can

not see in the box how it operates.


 Black Box Testing is also known as Behavioral Testing.
 Example: Website.
 Black box Testing helps in various activities:

1.It is done based on requirements


2.It addresses stated requirements as well as implied requirements
3.It handles valid and invalid inputs

Basics of Software Testing & Software Method 10/23/2024 75


s
Black Box Testing

Basics of Software Testing & Software Method 10/23/2024 76


s
Advantages of Black Box Testing

 The tester does not need to have more functional knowledge or


programming skills to implement the Black Box Testing.
 It is efficient for implementing the tests in the larger system.
 Tests are executed from the user’s or client’s point of view.
 Test cases are easily reproducible.
 It is used to find the ambiguity and contradictions in the functional

specifications.

Basics of Software Testing & Software Method 10/23/2024 77


s
Disadvantages of Black Box Testing

 There is a possibility of repeating the same tests while implementing the


testing process.
 Without clear functional specifications, test cases are difficult to implement.
 It is difficult to execute the test cases because of complex inputs at different
stages of testing.
 Sometimes, the reason for the test failure cannot be detected.
 Some programs in the application are not tested.
 It does not reveal the errors in the control structure.
 Working with a large sample space of inputs can be exhaustive and
consumes a lot of time.

Basics of Software Testing & Software Method 10/23/2024 78


s
Techniques for Black Box Testing

Black Box Testing

Static Testing Dynamic Testing


Positive & Negative
Requirement based Testing
testing Boundary value
Analysis
Decision Tables
Equivalance
Partitioning
User Documentation
Testing
Graph Based Testing

Basics of Software Testing & Software Method 10/23/2024 79


s
Requirements based Testing
 Requirements-based testing is a testing approach in which test cases, conditions
and data are derived from requirements.
 It includes functional tests and also non-functional attributes such as performance,
reliability or usability.
 Requirement testing deal with validating the requirements in SRS format
 Once the test case creation completes RTM( Requirements Tracking Matrix)
helps in identifying relationship between requirements and Test Case
Following Combinations are possible:
a. One to One
b. One to Many
c. Many to one
d. Many to Many
e. One to none

Basics of Software Testing & Software Method 10/23/2024 80


s
Stages in Requirements based Testing:

 Defining Test Completion Criteria - Testing is completed only when all the
functional and non-functional testing is complete.
 Design Test Cases - A Test case has five parameters namely the initial state or
precondition, data setup, the inputs, expected outcomes and actual outcomes.
 Execute Tests - Execute the test cases against the system under test and
document the results.
 Verify Test Results - Verify if the expected and actual results match each other.
 Verify Test Coverage - Verify if the tests cover both functional and non-
functional aspects of the requirement.
 Track and Manage Defects - Any defects detected during the testing process
goes through the defect life cycle and are tracked to resolution. Defect
Statistics are maintained which will give us the overall status of the project.

Basics of Software Testing & Software Method 10/23/2024 81


s
Requirements Testing process:

 Testing must be carried out in a timely manner.


 Testing process should add value to the software life cycle, hence it needs

to be effective.
 Testing the system exhaustively is impossible hence the testing process

needs to be efficient as well.


 Testing must provide the overall status of the project, hence it should be

manageable.

Basics of Software Testing & Software Method 10/23/2024 82


s
Positive & Negative Testing:
1.Positive Testing:
Positive testing is a type of software testing that is performed by assuming
everything will be as expected. It is performed with the assumption that only
valid and relevant things will occur. data set and all other functionalities will
be as expected.
Example − In an app, there is a text field that can only receive digits. The
system will receive values up to 99999, and any additional numbers must not
be accepted. To do positive testing, alter the valid input values from 0 to
99999 and see if the system accepts the inputs.

Basics of Software Testing & Software Method 10/23/2024 83


s
2. Negative Testing:

Negative testing is a type of software testing that is performed to check the


system for unexpected conditions. Negative testing plays a much important
role in high-performance software development. It checks whether on such
unexpected conditions what will be the behavior of the software.
Example − Negative testing can be carried out by inputting characters
ranging from A to Z or from a to z. Either the software system must reject the
values, or it should provide an error message in response to these erroneous
data inputs.

Basics of Software Testing & Software Method 10/23/2024 84


s
Difference between Positive & Negative
Testing Positive Testing Negative Testing

It is performed only for expected conditions. It is performed for unexpected conditions.

It doesn’t cover all possible cases. It covers all possible cases.

It doesn’t ensure a good quality product. It ensures a good quality product.

It is less important as compared to Negative testing. It is more important as compared to Positive testing.

It can be performed by people having less knowledge. It can only be performed by professionals.

It takes less time. It takes more time.

It is performed on every application. It is performed where are chances of unexpected conditions.

It ensures software is normal. It ensures 100% defect free software.

Basics of Software Testing & Software Method 10/23/2024 85


s
Boundary Value Analysis
 This is a software testing methodology in which test cases are written with values at
the border in mind. Positive testing occurs when the input data is used inside the
boundary value limitations. Negative Testing occurs when the input data is selected
outside of the boundary value limitations.
 Example − A system can take numeric values ranging from 0 to 10. All other digits
are null and void. The boundary values -1,0,1 and 9,10,11 will be examined using this
methodology.
 BVA is based on testing the boundary values of valid and invalid partitions. The
behavior at the edge of the equivalence partition is more likely to be incorrect than
the behavior within the partition, so boundaries are an area where testing is likely to
yield defects.
 It checks for the input values near the boundary that have a higher chance of error.
Every partition has its maximum and minimum values and these maximum and
minimum values are the boundary values of a partition.

Basics of Software Testing & Software Method 10/23/2024 86


s
Boundary Value Analysis
 A boundary value for a valid partition is a valid boundary value.
 A boundary value for an invalid partition is an invalid boundary value.
 For each variable we check-

◦ Minimum value.
◦ Just above the minimum.
◦ Nominal Value.
◦ Just below Max value.
◦ Max value.

Basics of Software Testing & Software Method 10/23/2024 87


s
Boundary Value Analysis
 Example: Consider a system that accepts ages from 18 to
56. Boundary Value Analysis(Age accepts 18 to 56)

Invalid Valid Invalid


(min-1) (min, min + 1, nominal, max – 1, max) (max + 1)

17 18, 19, 37, 55, 56 57

Valid Test cases: Valid test cases for the above can be any value entered greater than 17 and less than 57.
Enter the value- 18.
Enter the value- 19.
Enter the value- 37.
Enter the value- 55.
Enter the value- 56.
Invalid Test cases: When any value less than 18 and greater than 56 is entered.
Enter the value- 17.
Enter the value- 57.

Basics of Software Testing & Software Method 10/23/2024 88


s
Equivalence Partitioning

 It is a type of Black Box Testing that can be applied to all levels


of software testing. In this technique, input data are divided into the
equivalent partitions that can be used to derive test cases-
 In this input data are divided into different equivalence data classes.
 It is applied when there is a range of input values.
 Example: Below is the example to combine Equivalence Partitioning and

Boundary Value.
 Consider a field that accepts a minimum of 6 characters and a maximum of

10 characters. Then the partition of the test cases ranges 0 – 5, 6 – 10, 11 –


14.

Basics of Software Testing & Software Method 10/23/2024 89


s
Diffrence between Black box Testing and White Box
Testing

Basics of Software Testing & Software Method 10/23/2024 90


s
Thank You

Basics of Software Testing & Software Method 10/23/2024 91


s

You might also like