0% found this document useful (0 votes)
11 views19 pages

Unit 3

Uploaded by

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

Unit 3

Uploaded by

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

UNIT III

TEST CASE DESIGN Testing as an Engineering Activity – Testing Fundamentals – Defects –


Strategies and Methods for Black Box Test Case Design – Strategies and Methods for White-
Box Test Case Design – Test Adequacy Criteria – Evaluating Test Adequacy Criteria – Levels of
Testing and different Types of Testing
Test Case Design
 Definition of Software Testing: The process of identifying the correctness of software
by evaluating its attributes such as reliability, scalability, portability, reusability, and
usability. This involves executing software components to find bugs or defects.
 What is a Test Case?: A test case is a set of conditions used by a tester to determine
if a software application functions according to customer requirements. It includes
preconditions, the case name, input conditions, and expected results. A test case is
derived from test scenarios.
 Purpose of a Test Case: Test cases provide detailed information on testing strategies,
processes, preconditions, and expected outputs. They help verify if the application
performs as intended and aid in defect reporting by linking defects with test case IDs.
Test cases serve as a safeguard for the testing team, catching issues that may have
been missed during development.
When to Write a Test Case?
1. When the customer provides business needs: Developers start developing, with an
estimated timeline (e.g., 3.5 months to build the product).
2. Simultaneous Test Case Writing: The testing team begins writing test cases
concurrently with development.
3. Review Process: Once the test cases are drafted, they are sent to the Test Lead for
review.
4. Product Handover: After development, the product is handed over to the testing
team.
5. Continuous Testing: Test engineers do not rely on requirements; testing is an ongoing
process that does not depend on the test engineer's mood but on quality standards.
Reasons for Writing Test Cases:
1. To require consistency in the test case execution
2. To make sure a better test coverage.
3. It depends on the process rather than on a person
4. To avoid training for every new test engineer on the product
Writing Test Case Design:
 After Requirements Approval: Once the software project's requirements are
approved, the test case design phase begins.
 Collaboration: System analysts, system engineers, and software engineers work
together to prepare the system requirements and software requirements. The test
team then determines the appropriate test strategy and updates the test plans
accordingly.
 Test Case Creation: While system and software developers handle preliminary and
detailed design, the test team starts creating test cases.

Flow of Test Case Design:


Different stages of software development and the corresponding test cases:
1. Requirements: Lead to the preparation of acceptance test cases.
2. System Requirements: Involve creating system test cases.
3. Design: Results in integration test cases.
4. Detailed Design: Leads to unit test cases.
5. Execution: Each type of test case (acceptance, system, integration, and unit) is
executed to validate the software application.

*********************************************************************************
Engineers' Role:
 Engineers validate each requirement with one or multiple test cases.
 At least one test case should be written for each requirement to ensure the
developed software meets all its specifications.
 A test case is an input used to demonstrate that a particular part of the program
works,or that a requirement is verified, necessary steps taken, and the test has
yielded the expected result

Testing as an Engineering Activity


Software Development as an Engineering Activity: Software systems are becoming more
complex and vital in our society, leading to an increased focus on quality to prevent
catastrophic failures.New methods, techniques, and tools are becoming available to support
development and maintenance tasks. Because software now has such an important role in
our lives both economically and socially, there is pressure for software professional to focus
on quality issues.
Engineering Approach to Software Development: To achieve high-quality software
products, software development should follow an engineering approach, which includes:
 A well-understood development process.
 Proper project planning.
 Defined and adhered lifecycle models.
 Standards for products and processes.
 Measurements to evaluate product and process quality.
 Reuse of components.
 Validation and verification processes.
 Proper education, training, and certification for engineers.
**********************************************************************************

Test Fundamentals
"Testing fundamentals" refer to the basic principles, objectives, and activities involved in
testing software to ensure its quality, reliability, and functionality

Test Characteristics
The following are the attributes of a "good" test:
1. High Probability of Finding an Error: A good test should effectively detect errors in
the software.
2. Not Redundant: A good test should not duplicate the purpose of another test.
3. Best of Breed: A good test should represent the most effective or optimal way to find
errors.
4. Appropriate Complexity: A good test should be balanced—neither too simple nor
too complex.
Types of Software Testing Fundamentals
1. Software Quality: The degree to which the software conforms to explicit and implicit
requirements and expectations.
2. Dimensions of Quality: Software quality encompasses dimensions like accessibility,
compatibility, concurrency, and efficiency.
3. Software Quality Assurance (SQA): Activities focused on ensuring quality in software
engineering processes; it is process-focused and prevention-oriented.
4. Software Quality Control (SQC): Activities aimed at ensuring quality in software
products; it is product-focused and detection-oriented.
5. SQA and SQC Differences: SQA is process-focused and prevention-oriented and SQC
is product-focused and detection-oriented.
6. Software Development Life Cycle: Software development life cycle defines the
steps/stages/phases in the building software.
7. Definition of Test: Defines as a critical examinations, observation, or evaluation.

Roles of software testing in the SDLC (Software Development Life Cycle):


1. Early Detection of Problems and Errors: Testing examines the code/program to
discover problems and errors early in the system.
2. Simulation of System/Application Operations: Testing involves simulating real-world
operations to validate that the system or application performs correctly under
different scenarios.
3. Evaluation of Software Capabilities: Testing evaluates the capabilities of the code or
program across the entire product, ensuring it meets the requirements and functions
as expected.
4. Reviewing Requirements and Design: Testing plays a crucial role in reviewing
requirements and design and executing the code to ensure that both align with user
needs and specifications.
5. Measuring Functionality and Quality: Testing measures the functionality and quality
of the system or application, ensuring that the product/project meets the desired
standards.
6. Reducing Maintenance Costs: Testing helps lower the maintenance cost of the
software by identifying defects early and ensuring the software is more stable and
reliable.

***************************************************************

DEFECTS
A defect is a flaw or imperfection in a product or system that causes it to fail to meet the
required specifications, standards, or user expectations. In the context of software
development or product manufacturing, a defect is any deviation from the desired or
intended output, behavior, or quality of a product.

Two Categories of Defects


Defects can be broadly categorized into two main types based on their origin or cause:
1. Defects from Product Specification:
These defects arise when the product does not conform to the documented
specifications or requirements defined during its design and development phase.
This means the product fails to meet the pre-established criteria set by developers,
engineers, or stakeholders.
Examples:
o A feature that was specified in the product's requirements document but was
not implemented correctly.
2. Defects as Variance from Customer Expectations:
These defects occur when the product does not meet the customer's needs,
expectations, or preferences, even if it technically adheres to the product
specifications. This kind of defect is more subjective and can result from a
misalignment between the product’s capabilities and the customer's understanding
or needs.
Examples:
o A product feature that technically works as designed but is difficult for users
to understand or use.
o A customer expecting a certain level of performance or quality not explicitly
stated in the specifications but commonly assumed
**********************************************************************************

BLACK BOX TESTING


Black box testing is a software testing technique where the tester is not aware of the internal
structure, design, or implementation of the application under test. The purpose is to analyze
the application’s functionality rather than its internal workings. This method helps test client
requirements, specifications, and high-level design strategies. During the testing, a tester
selects valid and invalid input sets and code execution conditions to check for valid output
responses. This type of testing is also known as functional testing or closed-box testing.

Software testing evaluates a system to find bugs and ensure it meets its requirements.
Testing measures the system’s overall quality, including correctness, completeness, usability,
performance, and other functional and non-functional attributes.
Tools like QTP or Selenium, while non-functional tests can be performed using LoadRunner
or JMeter.

Types Of Black Box Testing


The following are the several categories of black box testing:
1. Functional Testing
2. Regression Testing
3. Nonfunctional Testing (NFT)

Black box techniques


1.Equivalence Partitioning
Equivalence partitioning, also known as equivalence class partitioning (ECP), is a black box
testing technique that divides the input data of a software unit into partitions of equivalent
data. The primary purpose of this technique is to reduce the number of test cases to a
manageable size while still ensuring the coverage of the application.
Example:

2. Boundary Value Testing


This strategy tests boundary values to evaluate whether a specific range of values would be
acceptable to the system. It minimizes the required test cases and is most suitable for
systems where input lies within certain ranges.
Ex:

3.Decision Table Testing


Decision table testing is a systematic and organized black box testing technique used to deal
with complex systems. Various input combinations & their respective system behaviour are
captured in tabular format
Ex: Gmail account

4.Error Guessing
It is based on the experience of the tester, where tester uses experiences to guess the
problematic are of software.
Example: Divide by zero,Handling Null values in text field, accepting the submit button
without any value,File upload without any attachment, File upload with less than or more
than the limit size.
5.State Transition Testing
It is used to capture behaviour of the software application when different input values are
given to the same function.
Applies to those type of application that provides specific number of attempts to access
application.
6.All Pairing Testing
It is used to check all possible discrete combination values.
This combinational method is used for testing the application that uses checkboxes,radio
buttons,input field,list box,text box etc.

Advantages
 Black box testing enables testing from a user’s point of view, making it easy to
identify discrepancies.
 Black box testers do not need any programming knowledge.
 Also, black box testing does not require knowledge of how the software has been
implemented.
 Testers can design test cases as soon as the specifications are complete, making the
testing process more efficient.

Disadvantages
 Since Black Box Testing does not require technical or programming knowledge, there
is a possibility of ignoring all valid and possible conditions that need to be tested.
 Time constraints may lead to less testing or ignorance of possible inputs and their
outputs.
 Complete test coverage may not be possible for complex and large projects, making
it difficult to test the system thoroughly
***************************************************************************
Differences Between Black Box and White Box Testing
Black Box Testing White Box Testing

The internal structure or the program/code is unknown to The tester knows the internal structure of the software.
the tester.

Usually done by software testers. Usually done by software developers.

No knowledge of implementation is essential. Knowledge of implementation is essential.

Also called Also called:

 Outer/external software testing  Inner/internal software testing

 Behavioural testing  Clear or glass box testing

Black box testing is the functional test of the software. White box testing is the structural test of the software.

Initiated based on the requirement specifications Initiated after a detailed design document.
document.

No knowledge of programming language is required. Compulsory to know at least one programming language.

Behaviour testing of the software. Basic logic testing of the software.

Mostly applicable to the higher levels of testing. Mainly applicable to the lower levels of testing.

Black box testing is less time-consuming. White box testing is more time-consuming.
Black Box Testing White Box Testing

Not appropriate for algorithm testing. Appropriate for algorithm testing.

Accomplished by trial and error methods. Inner or internal boundaries of data, along with its domain,
can be tested thoroughly.

For instance, searching something on Google with the help For instance, using inputs to check and verify for loops.
of keywords.

What is White Box Testing, techniques and type


White Box Testing, or glass box testing, is a software testing technique that focuses on the
software’s internal logic, structure, and coding. It provides testers with complete application
knowledge, including access to source code and design documents, enabling them to inspect
and verify the software’s inner workings, infrastructure, and integrations.
Test cases are designed using an internal system perspective and methodologies.
Tools : Junit,Nunit,TestNG

Why perform White Box Testing?


 Early Bug Detection: White Box Testing allows for detecting bugs and errors early in
development. This early detection can save time, effort, and resources, as fixing bugs
later in the development process can be more complex and costly.
 Code Optimization: Identify redundant code and software areas that can be
optimized. This leads to more efficient and streamlined software.
 Security: By examining the internal structure of the software, testers can identify
potential security risks and ensure that security best practices have been followed.
 Thoroughness: This thoroughness ensures that every part of the code is tested and
validated
 Quality Assurance:By testing the software’s internal structure, White Box Testing
ensures that the software functions as expected and meets the required standards.

White Box Testing Techniques


1. Data Flow Testing: This testing technique involves examining the control flow of programs
to analyze the sequence of variables and their occurrences in the program.
2. Control Flow Testing: This technique focuses on determining the order of execution of
statements or instructions within a program using its control structure. The technique helps
develop test cases by selecting specific parts of the program and analyzing the control graph.
3. Branch Testing: This coverage technique ensures all possible branches of the control flow
graph are tested. It covers all potential outcomes (true or false) of each decision point within
the code.
4. Statement Testing: This technique involves creating test cases to ensure all statements in
the source code are executed at least once. It is used to compute the total number of
executed statements compared to the total number present in the source code.
5. Decision Testing: This technique evaluates the true or false outcomes of Boolean
expressions in the code, such as conditions in loops or conditional statements. It considers
each decision point where the result can be true or false.
Advantages of White-Box Testing
1. White-box testing helps to optimize code by identifying hidden errors.
2. Test cases for white-box testing can be easily automated.
3. This testing method is more comprehensive than other approaches, as it covers all
code paths.
4. White-box testing can be initiated during the Software Development Life Cycle (SDLC)
phase, even before a Graphical User Interface (GUI) is available.
Disadvantages of White-Box Testing:
1. It can be very time-consuming, especially for large-scale applications.
2. White-box testing is often expensive and complex.
3. If not detailed properly by developers, it could lead to errors in production.
4. It needs experienced professional programmers who understand the internal
workings of the application.
*********************************************************************************

What are the levels of Software Testing and different types


of Testing?
Testing levels are the procedure for finding the missing areas and avoiding overlapping and
repetition between the development life cycle stages. We have already seen the various
phases such as Requirement collection, designing, coding testing, deployment, and
maintenance of SDLC (Software Development Life Cycle).
Different Levels of Testing
The levels of software testing involve the different methodologies, which can be used while
we are performing the software testing.
In software testing, we have four different levels of testing, which are as discussed below:
1. Unit Testing
2. Integration Testing
3. System Testing
4. Acceptance Testing
1.Unit Testing
Unit testing involves the testing of each unit or an individual component of the software
application. It is the first level of functional testing. The aim behind unit testing is to validate
unit components with its performance.
A unit is a single testable part of a software system and tested during the development
phase of the application software.
The purpose of unit testing is to test the correctness of isolated code. A unit component is
an individual function or code of the application. White box testing approach used for unit
testing and usually done by the developers.

Advantages of unit testing


o Unit testing uses module approach due to that any part can be tested without
waiting for completion of another parts testing.
o The developing team focuses on the provided functionality of the unit and how
functionality should look in unit test suits to understand the unit API.

Disadvantages of unit testing


o It cannot identify integration or broad level error as it works on units of the code.
o In the unit testing, evaluation of all execution paths is not possible, so unit testing is
not able to catch each and every error in a program.
o It is best suitable for conjunction with other testing activities.
2. Integration testing
Integration testing is the second level of the software testing process comes after unit
testing. In this testing, units or individual components of the software are tested in a group.
The focus of the integration testing level is to expose defects at the time of interaction
between integrated components or units.
Unit testing uses modules for testing purpose, and these modules are combined and tested
in integration testing. The Software is developed with a number of software modules that
are coded by different coders or programmers. The goal of integration testing is to check the
correctness of communication among all the modules.

Once all the components or modules are working independently, then we need to check the
data flow between the dependent modules is known as integration testing.
Advantages:
o It is convenient for small size software systems.
Disadvantages:
o Identification of defects is difficult because finding the error where it came from is a
problem, and we don't know the source of the bug.
o Time provided for testing is very less.
o We may miss to test some of the interfaces

3: System Testing
System Testing is a type of software testing that is performed on a completely integrated
system to evaluate the compliance of the system with the corresponding requirements. In
system testing, integration testing passed components are taken as input.
System Testing is carried out on the whole system in the context of either system
requirement specifications or functional requirement specifications or the context of both.
System testing tests the design and behavior of the system and also the expectations of the
customer
It has both functional and non-functional testing. System Testing is a black-box testing .
System Testing is performed after the integration testing and before the acceptance testing.

Advantages of System Testing


 The testers do not require more knowledge of programming to carry out this testing.
 It will test the entire product or software so that we will easily detect the errors or
defects which cannot be identified during the unit testing and integration testing.

Disadvantages of System Testing


 This testing is time consuming process than another testing techniques since it
checks the entire product or software.
 The cost for the testing will be high since it covers the testing of entire software.

4: Acceptance Testing
The last and fourth level of software testing is acceptance testing, which is used to evaluate
whether a specification or the requirements are met as per its delivery.
The software has passed through three testing levels (Unit Testing, Integration Testing,
System Testing). Some minor errors can still be identified when the end-user uses the
system in the actual scenario.
In simple words, we can say that Acceptance testing is the squeezing of all the testing
processes that are previously done.
The acceptance testing is also known as User acceptance testing (UAT) and is done by the
customer before accepting the final product.
Advantages of Acceptance Testing
1. It brings confidence and satisfaction to the clients as they are directly involved in
the testing process.
2. It is easier for the user to describe their requirement.

Disadvantages of Acceptance Testing

1. Users should have basic knowledge about the product or application.


2. Sometimes, users don’t want to participate in the testing process

**********************************************************************************

Types of Testing

1. Functional Testing
 Unit Testing: Testing individual units or components of the software to ensure they
work as expected.
 Integration Testing: Testing the combination of two or more units or components to
verify they work together.
 System Testing: Testing the complete and integrated software to evaluate the
system's compliance with its requirements.
 User Acceptance Testing (UAT): Testing conducted by end-users to validate that the
software meets their needs and requirements.
2. Non-Functional Testing
 Performance Testing: Testing to determine the speed, responsiveness, and stability
of the system under load. This includes:
o Load Testing: Assessing performance under expected user loads.
o Stress Testing: Evaluating how the system behaves under extreme conditions.
o Scalability Testing: Testing the application's ability to scale up or down in
response to user load.
 Security Testing: Identifying vulnerabilities, threats, and risks in the software and
ensuring that it is secure from attacks.
 Usability Testing: Evaluating the software's user-friendliness, ease of use, and overall
user experience.
 Compatibility Testing: Checking if the software works across different devices,
operating systems, browsers, etc.
 Accessibility Testing: Ensuring that the software is accessible to users with
disabilities.
3. Maintenance Testing
 Regression Testing: Re-testing the application after changes (e.g., bug fixes,
enhancements) to ensure existing functionality is unaffected.
 Sanity Testing: A quick check to determine if a particular function or bug fix works
without conducting a full regression test.
 Smoke Testing: A basic test to ensure that the most critical functions of a program
are working.
4. Specialized Testing
 Exploratory Testing: Informal testing where testers explore the software without
predefined test cases to discover potential issues.
 Compliance Testing: Verifying whether the software complies with relevant laws,
regulations, standards, and guidelines.
5. Automated Testing
 Test Automation: Using automated tools to run tests, reduce human effort, and
increase efficiency, typically used in regression, load, performance, and functional
testing.
***************************************************************************

Evaluating Test Adequacy Criteria


Evaluating test adequacy criteria involves assessing how well a set of test cases covers the
software under test. Here are some key points to consider:
1. Purpose of Test Adequacy Criteria:
o Identify Inadequacies: Criteria help identify gaps in test coverage, ensuring
that all parts of the software are tested.
o Measure Thoroughness: They provide a measure of how thoroughly the
software has been tested1.
2. Common Test Adequacy Criteria:
o Code Coverage: Measures the extent to which the source code is executed by
the test suite. Types include:
 Statement Coverage: Ensures each statement in the code is executed
at least once.
 Branch Coverage: Ensures each branch (true/false) of control
structures is executed.
 Path Coverage: Ensures all possible paths through the code are
executed2.
o Data Flow Coverage: Focuses on the points at which variables receive values
and where these values are used3.
o Mutation Testing: Involves modifying the program’s source code in small
ways to check if the test suite can detect the changes4.
3. Limitations of Test Adequacy Criteria:
o Undecidability: It’s impossible to prove that a test suite is completely
adequate, as this would require proving the program’s correctness without
testing1.
o Practical Constraints: Adequacy criteria can highlight inadequacies but do not
guarantee the detection of all faults2.
4. Improving Test Adequacy:
o Use Multiple Criteria: Combining different adequacy criteria can provide a
more comprehensive assessment.
o Continuous Evaluation: Regularly update and evaluate test cases to adapt to
changes in the software5.

You might also like