0% found this document useful (0 votes)
9 views29 pages

BoundaryValueTesting, NullCaseTesting, NegativeTesting (1336,1339)

Uploaded by

Minahil Ismail
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)
9 views29 pages

BoundaryValueTesting, NullCaseTesting, NegativeTesting (1336,1339)

Uploaded by

Minahil Ismail
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/ 29

Boundary Value testing

Negative testing
Null Case testing

Minahil Ismail (21-NTU-CS-1339)


Maria Anees (21-NTU-CS-1336)
Introduction to Boundary Value Testing

Boundary Value Testing, a black-box testing method, evaluates


data at the edges or limits of specified ranges. It follows
equivalence class partitioning and concentrates on values at
boundaries, such as start and end points or minimum and
maximum limits. By systematically testing extremes after class
partitioning, this approach efficiently identifies potential software
errors.
What is Boundary Value Testing?
• Boundary Value Testing complements equivalence testing by
analyzing defects at partition boundaries, addressing
challenges that equivalence testing alone may struggle with.
This method, often applied to numeric data with ordered
partitions, identifies extreme boundaries—minimum and
maximum values. It primarily serves to analyze partition
boundaries, detect anomalies, and pinpoint errors or threats at
boundary values, emphasizing the edges of valid or invalid
partitions over the center of input data.
Test Case
Range ( 21 – 65)

BOUNDARY VALUE TEST CASE

INVALID TEST CASE VALID TEST CASES INVALID TEST CASE

(Min Value – 1) (Min, Min+1, Max, Max-1) (Max Value + 1)

20 21, 22, 65, 64 66


Test Case
• The minimum boundary value is given as 21.
• The maximum boundary value is given as 65.
• The valid inputs for testing purposes are 21, 22, 64 and 65.
• The invalid inputs for test cases are 20 and 66.
Test Case Scenario
• 1. Input: Enter the value of age as 20 (21-1)
• Output: Invalid
• 2. Input: Enter the value of age as 21
• Output: Valid
• 3. Input: Enter the value of age as 22 (21+1)
• Output: Valid
• 4. Input: Enter the value of age as 65
• Output: Valid
• 5. Input: Enter the value of age as 64 (65-1)
• Output: Valid
• 6. Input: Enter the value of age as 66 (65+1)
• Output: Invalid
(Min Value – 1) (Max Value + 1)
(Min Value ) (Max Value)
(Min Value+1) (Max Value-1)
Limitations
• It assumes that defects are concentrated near the boundaries, which
may not always be the case.
• It may not uncover defects that occur due to interactions between
multiple input variables.
• The technique does not consider internal system behavior, focusing
solely on input ranges.
Negative Testing
Negative testing ensures that your application can gracefully handle
invalid input or unexpected user behavior. For example, if a user tries
to type a letter in a numeric field, the correct behavior in this case
would be to display the “Incorrect data type, please enter a number”
message. The purpose of negative testing is to detect such situations
and prevent applications from crashing. Also, negative testing helps
you improve the quality of your application and find its weak points.
Objectives of Negative Testing
• Functions as a critical component of software quality
assurance, helping to validate that the system behaves as
expected and meets customer requirements.
• It ensures that the system behaves gracefully when faced with
invalid inputs, providing a better user experience and
reducing the risk of user frustration or system failure.
• It helps identify and fix stability issues that may not have been
discovered through positive testing.
Types of Negative Testing
• Boundary value testing: It involves testing the system with inputs that
are at the minimum or maximum limits of the input range.
• Input validation testing: You can test the system’s handling of invalid
inputs, like invalid data types, out-of-range values, and invalid characters.
• Exception testing: It focuses on testing the system’s handling of
exceptional conditions, such as missing data, unexpected shutdowns, and
other exceptional events.
• Load testing: It involves testing the system’s behavior under heavy load
or stress, such as high traffic conditions or high-volume data processing.
• Compatibility testing: This negative testing checks the system’s
compatibility with different hardware, software, and network
configurations.
Designing Negative Test Case
• Identify potential negative scenarios: Review the system requirements,
use cases, and functionalities to identify potential scenarios where the
system may not work as expected.
• Determine the expected outcome: For each negative scenario,
determine what the expected outcome should be. For example, an error
message or a system shutdown.
• Choose the inputs: Based on the negative scenarios identified, choose
the inputs that will trigger the negative behavior. These can be invalid
data, incorrect input values, or unexpected inputs.
• Design the test cases: Create test cases that describe the steps to follow
to perform the negative testing. The test cases should include the inputs,
expected outcomes, and any other relevant information.
Examples of Negative Testing
• Testing a website’s login page: You can input incorrect username
and password combinations to verify that the website displays the
appropriate error message and prevents unauthorized access.
• Testing an ATM machine: Try to withdraw more money than the
account balance or insert an invalid card to verify that the machine
handles these scenarios correctly and prevents unauthorized
transactions.
• Testing an eCommerce site’s payment gateway: Enter invalid
credit card information or try to exceed the maximum order value to
verify that the site handles these scenarios correctly and prevents
fraudulent transactions.
Advantages Disadvantages
 Negative testing identifies  Negative testing is time-consuming,
unexpected system behaviors focusing on edge cases and invalid
with invalid inputs, revealing inputs. Automation poses challenges
weaknesses and improving in accurately representing and
overall software quality. interpreting results for negative test
 It exposes security cases.
vulnerabilities, highlighting  Coverage is limited, unable to
flaws in input validation. encompass all potential invalid
 Conducted under adverse scenarios.
conditions, negative testing  Resource-intensive, it may
enhances confidence in the necessitate additional hardware or
system's real-world software for managing invalid inputs.
functionality.
Null Case testing
• Null case testing might refer to the testing
of scenarios where a null value or an
absence of data is expected or possible.
It involves validating that the software
behaves as intended when faced with null
inputs or when certain expected values
are missing. The primary goal of null testing is to
verify that the software can
gracefully handle scenarios where
certain data is missing or
undefined.
Aspects Considered in Null Case Testing
• Handling Null Values:
• Verify how the software handles null values in input fields, variables, or parameters.
• Check whether the application gracefully handles scenarios where expected data is
missing or undefined.
• Boundary Conditions:
• Evaluate how the system behaves at the boundaries of null or empty values.
• Test for scenarios where fields or variables are expected to be null, empty, or
undefined.
• Error Handling:
• Confirm that the application provides appropriate error messages or handles
exceptions when encountering null values.
• Ensure that the error messages are informative and guide users or developers to
understand and address the issue.
Aspects Considered in Null Case testing

• Database Interactions:
• If the software interacts with a database, verify how it handles situations where null
values are stored or retrieved.
• Check for appropriate handling of null constraints in database schema.
• API Testing:
• For APIs, test how they respond to requests with null parameters or missing data.
• Confirm that the API returns meaningful responses or error codes.
• User Interfaces:
• Check the user interface for clear and user-friendly messages when required data
is missing or null.
• Verify that the UI elements behave as expected in the absence of data.
Aspects Considered in Null Case testing

Integration Testing:
In integration testing, ensure that null values are appropriately handled
when different components or systems interact with each other.
Examples of Null Case Testing
• Scenario 1: A function calculates the average of an array of numbers.
• Null Case Testing: Call the function with a null array. Confirm that the function
handles the null array appropriately, avoiding any runtime errors and providing a
meaningful response (e.g., returning an error code or a default value).

• Scenario 2: A database query retrieves user information based on a provided


user ID.
• Null Case Testing: Execute the query with a null user ID. Check that the
application doesn't crash and returns a suitable response, such as an indication
that the user ID is required.
Any
Queries
?
Thank
You!

You might also like