Unit-5 System Testing
Unit-5 System Testing
Upper Bound:
Maximum valid age = 60
Boundary values to test: 60 (on the boundary),
61 (just above the upper bound)
Equivalence Class Testing
The idea is that all values within an equivalence class should be treated
the same by the system, so testing just one value from the class should
be enough to verify the system’s behavior for the entire class.
Key Concepts
Equivalence Class:
A set of input values that are treated the same way by the system.
Valid Class:
A range of input values that are expected to be accepted by the system.
Invalid Class:
A range of input values that are expected to be rejected or handled as errors
by the system.
Steps in Equivalence Class Testing:
Reduces Redundancy:
Instead of testing all possible inputs, testers only need to check one value
from each class, significantly reducing the number of test cases.
Better Coverage:
Ensures that all classes of input are tested, both valid and invalid.
Improves Efficiency:
Helps testers focus on critical input variations, improving the testing process's
efficiency.
Decision Table based Testing
Actions:
These are the outcomes or results based on the conditions.
Rules:
These represent the combination of conditions that lead to a specific action.
When to Use Decision Table Testing?
When you need to ensure that all possible combinations of inputs are
covered.
Steps in Decision Table Testing
Identify all the input conditions that can affect the system’s behavior.
Identify the corresponding actions for each set of conditions.
Create a decision table where each column represents a unique
combination of conditions.
Identify test cases that cover all the rules from the table.
Example: Loan Approval System
Test Case 1: High credit score, high income, employed → Loan should be
approved.
Test Case 2: Low credit score, high income, employed → Loan should be
conditionally approved.
Test Case 3: Low credit score, low income, employed → Loan should be
rejected.
Test Case 4: High credit score, low income, employed → Loan should be
conditionally approved.
Test Case 5: High credit score, high income, unemployed → Loan should
be rejected.
Test Case 6: Low credit score, low income, unemployed → Loan should be
rejected.
Benefits of Decision Table Testing
Comprehensive Coverage:
Ensures that all possible combinations of inputs are considered, helping to
prevent missing out on edge cases.
Structured Approach:
Organizes complex business rules into a clear, manageable structure, making
it easier to understand the relationships between inputs and outputs.
Effective for Complex Logic:
Particularly useful when there are multiple conditions leading to different
actions, as it helps systematically check each possibility.
Cause Effect Graphing Technique
Graph: A visual representation where causes and effects are nodes, and
edges represent the relationships between them.
Steps in Cause-Effect Graphing
Identify Causes and Effects: List all the possible inputs (causes) and
their expected outcomes (effects).
Develop a Cause-Effect Graph: Create a graph connecting causes to
effects, showing how different inputs influence the system's behavior.
Convert the Graph into a Decision Table: Translate the graph into a
decision table to identify all possible test cases.
Generate Test Cases: Create test cases based on the decision table,
ensuring that all cause-effect combinations are tested.
Example: ATM Withdrawal System
An ATM system where a user can withdraw cash based on the following
conditions:
1. Valid PIN: The PIN entered is correct.
2. Sufficient Balance: The account has sufficient balance.
3. Daily Limit Not Exceeded: The withdrawal does not exceed the daily
limit.
C1
AND
E1
C2 ^
C3
Notations used in the Cause-Effect Graph
Causes are:
C1 - Character in column 1 is A
C2 - Character in column 1 is B
C3 - Character in column 2 is digit!
Effects:
E1 - Update made (C1 OR C2) AND C3
E2 - Displays Massage X (NOT C1 AND NOT C2)
E3 - Displays Massage Y (NOT C3)
Cont..
Step 3: Convert the Graph into a
Decision Table
Effect 1: Dispense Effect 2: Display
Causes
Cash Error Message
Valid PIN Yes No
Sufficient Balance Yes No
Daily Limit Exceeded No Yes
Step 4: Generate Test Cases
Test Case 1: Valid PIN, Sufficient Balance, Daily Limit Not Exceeded →
Result: Dispense Cash.
Test Case 2: Invalid PIN → Result: Display Error Message.
Test Case 3: Valid PIN, Insufficient Balance → Result: Display Error
Message.
Test Case 4: Valid PIN, Sufficient Balance, Daily Limit Exceeded →
Result: Display Error Message.
Benefits of Cause-Effect Graphing
1. Regression 7. Usability
2. Performance 8. Installability
3. Scalability and Resource Utilisation 9. Maintainability
4. Security 10. Localisation
5. Recovery 11. Reliability
6. Compatibility
Regression Testing
Definition:
Regression testing verifies that recent code changes have not negatively
affected the existing functionality of the system.
It ensures that new features or bug fixes don’t introduce new defects.
Example:
In a social media app, after adding a new feature like "stories," regression
testing ensures that the core features such as posting updates, liking, and
commenting still work without issues after the update.
Performance Testing
Definition: This type of testing checks the system's performance under
expected and peak loads, ensuring it meets performance criteria such as
response time, throughput, and resource utilization.
Types of Performance Testing:
Load Testing: Determines how the system performs under expected load.
Stress Testing: Examines the system’s behavior under extreme load
conditions (overload).
Scalability Testing: Tests the system’s ability to scale up or down based on
user load.
Example:
In a ticket booking system for concerts, performance testing ensures the
website remains responsive when thousands of users attempt to buy tickets
simultaneously during a sale.
Security Testing
Definition:
Security testing identifies vulnerabilities in the system that may expose it to
attacks.
It ensures that the application is secure from threats like unauthorized access,
data breaches, or cyberattacks.
Example:
In an online banking application, security testing would validate features like
encryption of sensitive data (e.g., customer information and financial
transactions), secure login with multi-factor authentication, and proper access
control.
Recovery Testing
Definition:
This type of testing checks the system’s ability to recover from crashes,
hardware failures, or other critical issues.
It ensures the system can return to a stable state after an unexpected failure.
Example:
In a cloud-based data storage service, recovery testing would verify whether
the system can recover user data in the event of a server crash, network
failure, or accidental data deletion. Backup and restoration processes are key
aspects of recovery testing.
Compatibility Testing
Definition:
Compatibility testing ensures that the system works across different
environments, including various operating systems, browsers, hardware
configurations, and network environments.
Example:
A video conferencing app like Zoom must be tested across different platforms
(Windows, macOS, Android, iOS), browsers (Chrome, Firefox, Safari), and
hardware setups (laptops, tablets, smartphones) to ensure consistent
functionality and user experience.
Usability Testing
Definition:
This testing focuses on evaluating the user interface (UI) and overall user
experience (UX).
It checks how easy and intuitive it is for users to interact with the system.
Example:
For a food delivery app, usability testing may involve assessing whether users
can quickly navigate menus, place orders, and track their deliveries with
minimal effort.
It tests the app’s ease of use, design, and user satisfaction.
Installation Testing
Definition:
Installation testing checks whether the system can be installed and
uninstalled correctly.
It ensures that the installation process is smooth and that the system works
as expected after installation.
Example:
When installing a video editing software like Adobe Premiere, installation
testing ensures that the software installs correctly, all necessary files are
copied, and the program functions after installation without errors.
Localization Testing
Definition:
Localization testing ensures that the system works correctly in different
regions with various languages, date formats, currencies, and cultural
settings.
Example:
A global e-commerce platform like Amazon would undergo localization testing
to ensure the UI correctly displays in multiple languages, supports various
currencies, and handles local payment methods in each region it serves (e.g.,
Europe, Asia, North America).
Performance testing
Performance testing is a testing measure that evaluates the speed,
responsiveness and stability of a computer, network, software program or
device under a workload.
The goal of performance testing is to evaluate the application’s performance
with respect to real world scenarios.
The following issues must be addressed during performance testing:
(i) Performance of the system during peak hours (response time, reliability and
availability).
(ii) Points at which the system performance degrades or system fails.
(iii) Impact of the degraded performance on the customer loyalty, sales and
profits.
Several factors that may influence performance include:
(i) Response time
(ii) Memory available
(iii) Network bandwidth
(iv) Number of users
(v) User type
(vi) Time to download
(vii) Varied client machine configurations
Types of Performance testing
1) Load testing
Checks the application’s ability to perform under anticipated user loads.
The objective is to identify performance bottlenecks before the software application goes
live.
2) Stress testing
Involves testing an application under extreme workloads to see how it handles high traffic
or data processing.
The objective is to identify the breaking point of an application.
3) Endurance testing
Used to make sure the software can handle the expected load over a long period of time.
Load Testing
Evaluate Stability: Ensure that the system can recover gracefully after
encountering extreme conditions.
Stress Test Goal: Simulate the peak load of users placing orders,
searching for products, and processing payments.
Apache Jmeter
LoadRunner
Gatling
BlazeMeter
Benefits of Stress Testing
Techniques Used:
Penetration testing is done to simulate attacks like brute force login
attempts or injection attacks.
Vulnerability scanning is used to identify weak configurations or unpatched
software.
Encryption testing ensures that all financial and personal data is properly
encrypted, both in transit and at rest.
Outcome: The bank ensures that all user accounts and transactions are
secure, minimizing the risk of fraudulent activity or data breaches.
Security Testing Tools
Functional Testing:
UI/UX Testing: Ensure that all user interface elements (buttons, forms,
navigation) function as expected.
Form Validation: Check that all form inputs handle data correctly, provide
feedback, and reject invalid inputs.
Database Testing: Validate that data storage, retrieval, and integrity in the
backend database are functioning correctly.
Cross-Browser Testing:
Test the application in different browsers and versions to ensure consistent
behavior and appearance.
Cont..
Security Testing:
Conduct penetration testing and vulnerability scans.
Ensure proper user authentication, data encryption (HTTPS), and secure
session management.
Performance and Load Testing:
Use tools like Apache JMeter or LoadRunner to simulate user loads and test
the web app's ability to handle peak traffic.
Measure response time, throughput, and server resource usage.
Usability and Accessibility Testing:
Test against accessibility standards (WCAG 2.0/2.1) using screen readers and
keyboard navigation to ensure that users with disabilities can access the
website.
Test cases
Functional Testing:
Navigation Flow: Ensure that users can navigate through the app smoothly,
with no broken links or dead ends.
Feature Testing: Test features like camera integration, file uploads, or push
notifications.
Offline Mode: Test app functionality without an internet connection or with
intermittent connectivity.
Device Compatibility Testing:
Perform testing on a range of real devices (or emulators) with different OS
versions, screen sizes, and hardware capabilities.
Cont..
Performance Testing:
Measure how well the app performs under different conditions, such as low
memory, heavy CPU load, and poor network connectivity.
Test battery consumption and resource usage while using the app.
Network Connectivity Testing:
Simulate different network conditions (slow, fast, intermittent) to test how
well the app handles poor connectivity.
Verify how the app handles network transitions (switching between Wi-Fi and
mobile data).
Cont..
Security Testing:
Test for vulnerabilities specific to mobile apps (e.g., insecure data storage,
improper session management, weak encryption).
Verify secure communication over HTTPS and proper encryption of sensitive
data stored on the device.
Interrupt Testing:
Test how the app behaves during interruptions like incoming calls, SMS, or low
battery alerts.
Test Cases
Test the app's behavior when the device switches from Wi-Fi to mobile
data.
Verify how the app handles location services (GPS) when they are
disabled.
Measure app response times under different network conditions (4G, 3G,
or offline).
System Test Suite Design for IoT
Applications
Key Considerations:
Device Interoperability: IoT systems consist of a network of devices,
sensors, gateways, and cloud platforms that need to communicate
effectively.
Real-Time Data Processing: The system must handle large volumes of
real-time data and ensure that communication between devices is accurate
and timely.
Network Latency: IoT devices often operate in environments with varying
network stability and connectivity (Wi-Fi, Bluetooth, Zigbee).
Security and Privacy: Ensuring secure communication between IoT
devices, preventing data tampering, and maintaining user privacy are
critical.
Scalability: The system should be able to scale efficiently with the
addition of new devices without performance degradation.
Components of the Test Suite
Functional Testing:
Device Connectivity: Test whether devices connect correctly to the network
and communicate as expected.
Data Flow: Verify that data collected by sensors or devices is transmitted
and processed accurately by the cloud or backend.
Command Execution: Ensure that commands sent from the app or cloud to
devices are executed correctly.
Interoperability Testing:
Test the ability of different devices, using different communication protocols
(e.g., MQTT, HTTP, CoAP), to work together seamlessly.
Validate cross-device functionality, such as controlling one device via another.
Cont..
Scalability Testing:
Simulate adding more devices to the IoT ecosystem and observe how the
system handles the increased load.
Test the system’s ability to handle large amounts of data being sent from
multiple devices simultaneously.
Network and Connectivity Testing:
Test device connectivity under various conditions, such as weak signals,
network drops, or high latency.
Validate how the system handles network congestion or device
disconnections.
Test cases