0% found this document useful (0 votes)
4 views14 pages

Software Testing

Chapter 3 discusses software testing, defining it as the process of checking software for errors before release. It outlines the roles of engineers in testing, the importance of a structured testing strategy, and the distinction between verification and validation. The chapter also covers various testing methods, including unit, integration, and system testing, as well as specific strategies for web and mobile applications.

Uploaded by

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

Software Testing

Chapter 3 discusses software testing, defining it as the process of checking software for errors before release. It outlines the roles of engineers in testing, the importance of a structured testing strategy, and the distinction between verification and validation. The chapter also covers various testing methods, including unit, integration, and system testing, as well as specific strategies for web and mobile applications.

Uploaded by

shaptar0820
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 3: Software Testing

Question 1: What is Software Testing?


Ans: Software Testing means checking a software program to find and
fix errors before giving it to users.

 After writing the code, it must be tested to find as many mistakes


as possible.
 The goal of a software engineer is to create test cases that can
easily detect errors.
 Testing helps find mistakes that happened during design and
development.

Question 2 : How do engineers conduct software tests?


 Engineers need to decide if they should make a proper (formal)
test plan.
 They must choose whether to test the whole program at once or
test small parts separately.
 They should check if old tests need to be run again when new
parts are added.
 They also decide when to involve the customer in testing.

Question 3: Who performs Software Testing?


 The testing plan is usually made by the project manager, software
engineers, and testing experts.
 In the beginning, software engineers do the testing themselves.
 Later, as testing becomes more detailed, specialized testers
(testing experts) also take part.

Software testing strategy


 A testing strategy is like a roadmap that shows the steps to follow
during testing.
 It includes:
o Test planning
o Test case design
o Test execution
o Collecting and analyzing results

A good strategy should be:

o Flexible → so it can be adjusted when needed


o Structured → so proper planning and tracking can be done

Generic characteristics of software testing stategy


 Review before testing:
Do technical reviews first to remove many errors early.
 Step-by-step testing:
Start testing small parts (components), then move to the whole
system.
 Different methods:
Use different testing techniques at different stages.
 Who tests:
Testing is done by developers and sometimes by independent
testers (especially in big projects).
 Testing vs Debugging:

o Testing = finding errors


o Debugging = fixing errors
Both are different but connected.

Verification and Validation


• Software testing is one element of a broader topic that is often
referred to as verification and validation (V&V).

• Verification refers to the set of tasks that ensure that software


correctly implements a specific function.
Or,
Checks whether the software is built correctly according to design.

• Validation refers to a different set of tasks that ensure that the


software that has been built is traceable to customer
requirements.

Or,
Checks whether the software meets user/customer requirements.

• Boehm states this another way:


• Verification: “Are we building the product right?”
• Validation: “Are we building the right product?”
• The definition of V&V encompasses many software quality

Software Testing Process

Software Testing process


 The software process can be seen like a spiral model.
 At the beginning:
o System engineering defines the role of software
o Then comes requirement analysis (what the software
should do, performance, constraints, etc.)
 After that, the process moves inward:

o Design
o Coding (implementation)
Software Testing Strategy
 Software testing can be understood using a spiral model.
 Testing starts from the center (small parts) and moves outward
(whole system) step by step.

Steps of Testing of Spiral :

1. Unit Testing

o Starts at the center (vortex)


o Tests small individual units (like components, classes)

2. Integration Testing

o Next step outward


o Combines units and checks how they work together

3. Validation Testing

o Checks if the software meets user requirements

4. System Testing

o Final step
o Tests the entire system as a whole

Software Testing Steps:

Software testing is done in four main steps, one after another:


[Link] testing

 Test each small part (component) separately


 Make sure each part works correctly
 Focuses on checking different paths and functions inside the code

2. Integration Testing

 Combine different parts together


 Check if they work properly as a group
 Helps find problems in connections between components

3. High order test

 Done after full integration


 Tests the overall system behavior

[Link] tests

 Final step of testing


 Checks if the software meets all requirements
(function, behavior, performance)

Goal of software testing


 The main goal of software testing is to find errors (bugs) in the
software.
 A good test case is one that has a high chance of detecting errors.

Importants points :

 Software should be designed in a way that makes it easy to test


(this is called testability).
 Test cases should be designed to find as many errors as possible
with less effort.
 Testing helps improve the quality and reliability of the software.
Characteristics of a testable software
 Operability
If the software works well, it becomes easier to test. Fewer bugs
mean testing can run smoothly without interruptions.
 Observability
We can easily see what the software is doing. Inputs give clear
outputs, errors are visible, and internal data can be checked.
 Controllability
Testers can control the system easily. Different inputs can produce
all outputs, and tests can be repeated and automated.
 Decomposability
The software is divided into small modules. Each part can be
tested separately, making it easier to find problems.
 Simplicity
Simple software is easier to test. It has fewer features, a clean
structure, and easy-to-understand code.
 Stability
The software does not change frequently. Less change means
fewer testing problems and more reliable results.
 Understandability
The system is easy to understand. Good documentation and clear
design help testers perform better testing.

Attributes of a good software test


 High chance of finding errors
A good test is designed to find bugs. The tester should understand
the software and think about where it might fail.
 Not redundant
Tests should not repeat the same thing. Each test must have a
different purpose to save time and effort.
 Best of breed
Among similar tests, choose the one that is most effective in
finding many types of errors.
 Neither too simple nor too complex
Tests should be clear and balanced. Too simple tests may miss
errors, and too complex tests may hide them. It’s better to test
things separately.
Internal vs External views of Testing

Software can be tested in two main ways:

1. Black-Box Testing(External view)

 Focuses on what the software does (its functions).


 Tester does not know the internal code.
 Checks if all features work correctly.
 Finds errors by giving inputs and observing outputs.

[Link] -Box testing (Internal view)

 Focuses on how the software works internally.


 Tester knows the code, logic, and structure.
 Checks if all internal operations and paths work correctly.
 Ensures every part of the code is tested.

Black-box testing vs white -box testing

 Black-box Testing
o Focuses on software interface and functionality
o Does not consider internal code or logic
o Tests whether the system works correctly from the user’s
point of view
o Input is given → Output is checked
o Also called functional testing

 White-box Testing
o Focuses on internal code and logic
o Examines program structure, conditions, and loops
o Tests all possible paths and interactions inside the system
o Also called structural testing or glass-box testing
Model - Based testing
 Model-Based Testing (MBT) is a type of black-box testing.
 It uses the software’s requirement model (design/behavior) to
create test cases.

Steps of Model - based Testing :

1. Create or analyze a model


Make or study a model that shows how the software behaves.
2. Find inputs
Choose inputs that move the system from one state to another.
3. Identify expected outputs
Note what output should come at each step.
4. Run test cases
Execute the tests on the software.
5. Compare results
Check if actual output matches expected output and fix errors if
needed.

Patterns for Software Testing


 Testing patterns are common problems and their solutions in
software testing.
 They help testers handle testing tasks more effectively.

Common Testing patterns :

1. Pair Testing

 Two testers work together to design and run tests.


 Similar to pair programming.
 Can be used in unit, integration, and validation testing.

2. Separate Test Interface

 Used to test internal classes (which are not visible outside).


 A special test interface is created to test these hidden parts.
3. Scenario Testing

 Tests the software from the user’s point of view.


 Checks if the system works correctly in real-life situations.
 Failure means the software does not meet user requirements.

Simple idea: Test like a real user.

Testing Object Oriented System

Testing in object-oriented systems is a continuous activity throughout the


software development process. It ensures that the system works correctly
at different stages.

There are three levels of testing in object-oriented systems:

1. unit testing,
2. subsystem testing,
3. and system testing.

Unit Testing: Unit testing focuses on testing individual classes. It checks


whether the class attributes, methods, and interfaces are implemented
correctly and are free from errors. This level of testing is usually
performed by the developer or application engineer.

Subsystem testing :Subsystem testing involves testing a group of related


classes or a module. It verifies the interactions among classes within the
subsystem and also checks how the subsystem interacts with other parts
of the system. This testing is typically the responsibility of the subsystem
lead and can also be reused as regression tests.

System Testing:System testing is the final level, where the entire system
is tested as a whole. It ensures that all components work together properly
and meet the required specifications. This testing is carried out by the
quality assurance (QA) team and is often used again when new versions
of the software are released.
OR,

Testing Object Oriented System


 Testing is a continuous process during software development.
 In object-oriented systems, testing is done in three levels:
1. Unit Testing
2. Subsystem Testing
3. System Testing

[Link] Testing

 Tests individual classes.


 Checks:
o Attributes (data members)
o Methods (functions)
o Interfaces
 Done by the developer/programmer.

Simple idea: Test each class separately.

2. Subsystem testing

Tests a module or group of classes (subsystem).

 Checks:

o Interaction between classes inside the subsystem


o Interaction with other parts of the system
 Done by the subsystem lead.
 Can be reused as regression tests.

Simple idea: Test how classes work together.

3. System Testing

 Tests the entire system as a whole.


 Ensures everything works correctly together.
 Done by the QA (quality assurance) team.
 Also used for regression testing when new versions are released.

Simple idea: Test the complete software.


Web Application Testing :
Web application testing means checking a website or web app for errors
or problems before it is made live and used by the public.

It ensures that the website works properly and is safe and user-friendly. It
mainly checks: functionality, usability, security, compatibility, and
performance.

In software engineering, different types of testing are used for web


applications depending on requirements. The main steps include:

Functionality testing – checks if all features work correctly


Usability testing – checks if the website is easy to use
Interface testing – checks interaction between different parts of the
system
Compatibility testing – checks if it works on different browsers and
devices
Performance testing – checks speed and responsiveness
Security testing – checks protection against threats
Crowd testing – testing by many real users in different
environments

Steps / Guides to Web Application Testing


1. Functionality Testing of a Website
It checks whether all features of the website work properly.
It includes testing user interface, APIs, database, security, client and
server.
It can be done manually or automatically.
Example: check buttons work, test timeout, check JavaScript in different
browsers, check behavior when cookies are deleted, check data order in
lists.

2. Usability Testing of a Website


It checks whether the website is easy and user-friendly.
It can be tested by real users or a small group.
Example: no spelling/grammar mistakes, proper fonts, correct alignment,
clear error messages, proper tooltips, well-arranged fields.
3. Interface Testing of a Website
It checks communication between system components.
It tests three parts: application server, web server, and database server.
Application: correct request/response and proper error handling.
Web server: handles requests properly.
Database: returns correct results.

4. Database Testing of a Website


It checks the database performance and correctness.
Ensure no errors during queries.
Maintain data integrity during insert, update, delete.
Check response time of queries.
Ensure correct data display.
Example: verify tables, columns, keys, stored procedures.

5. Compatibility Testing of a Website


It checks if the website works on different devices, browsers, and OS.
Test on browsers like Chrome, Firefox, Safari, etc.
Check JavaScript, images, fonts, animations across platforms.
Ensure proper display everywhere.

6. Performance Testing of a Website


It checks speed and stability under different loads.
Test response time at different internet speeds.
Perform load testing and stress testing.
Check system behavior during crashes and recovery.
Use optimization like caching and compression.

7. Security Testing of a Website


It checks protection of sensitive data.
Prevent unauthorized access.
Ensure secure login and session handling.
Use HTTPS/SSL for secure data transfer.
Example: encrypted passwords, session timeout, no access after logout,
no reuse of old passwords.

Test Strategies for Web Applications


The testing strategy for WebApps follows general software testing
principles and object-oriented testing ideas. It is done step by step to find
errors in different parts of the system.
Steps:

 Review the content model to find mistakes in website content.


 Review the interface model to make sure all user actions (use
cases) work properly.
 Review the design model to find navigation problems.
 Test the user interface to check display and navigation errors.
 Test each functional part separately (unit testing).
 Test navigation flow across the whole website.
 Test the WebApp in different environments to check compatibility.
 Perform security testing to find and fix vulnerabilities.

Test Strategies for Mobile Applications


Mobile app testing also follows basic software testing principles, but
focuses more on mobile-specific issues.

Steps:

 User experience testing: involve real users early to check usability


and accessibility on different devices.
 Device compatibility testing: ensure the app works on different
phones, OS versions, and hardware.
 Performance testing: check speed, storage use, battery usage, and
processing power.
 Connectivity testing: test how the app works with weak or
unstable internet connections.
 Security testing: ensure user data privacy and protection.
 Testing in real conditions: test the app in real-world environments
with real devices and networks.
 Certification testing: ensure the app meets app store
requirements before release.

You might also like