Testing Note DIU
Testing Note DIU
Verification: Verification is the process of evaluating work products (like documents, design, and
code) to determine if they meet the specified requirements at a certain stage of development. It
answers the question, "Are we building the product right?"
Example in Library Management:
Code Reviews: Reviewing the code for the Library Management System to ensure it follows to
coding standards and meets design specifications.
Validation: Validation is the process of evaluating the final product to determine if it meets the user’s
needs and requirements. It answers the question, "Are we building the right product?"
Example in Library Management:
User Acceptance Testing (UAT): The system allows users to easily search for books, check
availability, and borrow items seamlessly.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 1
Software Testing
Summary of Differences
Verification: Focuses on internal processes and development adherence to specifications. It is often
done through reviews and inspections before the product is completed.
Validation: Focuses on the end product’s usability and whether it meets user needs and
requirements. It typically occurs after the product is developed.
Software Inspections
Software inspections are a formal process of examining software artifacts (such as requirements
documents, design specifications, or source code) to identify defects, ensure adherence to standards,
and verify that the product meets its specifications. Inspections are typically conducted by a group of
peers and involve a structured approach.
Examples in the Context of a Library Management System:
1. Requirements Inspection:
o Purpose: To ensure that the requirements for the Library Management System are clear,
complete, and feasible.
o Example: A team reviews the requirements document to check if all functionalities (like
searching for books, managing loans, and handling returns) are accurately described and
that there are no ambiguous terms or missing requirements.
2. Design Inspection:
o Purpose: To verify that the system architecture and design meet the specified requirements
and that the design is robust.
o Example: Inspecting the system architecture diagram to ensure that components (like the
user interface, database, and backend services) interact correctly. The team may look for
design flaws, such as a lack of scalability or issues in data flow.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 2
Software Testing
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 3
Software Testing
Definition Manual testing is carried out by a Automation testing involves the use of
tester manually without the use of any special automation tools and requires a
kind of automation tool. huge investment of money and
resources.
Execution Testers manually execute test cases. Uses tools to schedule and execute the
test cases.
Time and cost The manual test takes up lots of time Automated testing: since the test cases
and implies a high cost. are automated, it saves time and is very
low.
Nature The process is such that it is Since the automation tool handles the
repetitive and boring. execution, the tester skips the boring
part.
Reliability Low reliability as manual High accuracy since all test cases are
and verification is prone to human error automated and executed by tools
Accuracy
User interface More user-friendly and guarantees Does not guarantee user-friendliness
improved customer experience or good customer experience.
1. White-box Testing: White-box testing involves testing the internal structures or workings of an
application. The tester has knowledge of the code, algorithms, and architecture.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 4
Software Testing
2. Black-box Testing: Black-box testing focuses on testing the functionality of an application without
peering into its internal structures or workings. The tester does not need knowledge of the code and
tests the software against its specifications.
Example: A QA tester tests a web application’s login feature by entering valid and invalid
credentials and checking if the system responds correctly (e.g., allowing access for valid credentials
and showing an error message for invalid ones) without knowing how the login mechanism is
implemented behind the scenes.
3. Grey-box Testing: Grey-box testing is a combination of white-box and black-box testing. The tester
has partial knowledge of the internal workings of the application, which helps in designing test cases.
Example: A tester has access to the application’s database schema and some code snippets. They
might check whether the application correctly retrieves data from the database after performing a
search, using their understanding of both the front-end functionality and back-end processes.
1. Unit Testing: Unit testing involves testing individual components or functions of a software
application in isolation to ensure they work correctly.
Example: In a library management system, a developer tests the function that calculates overdue fines.
They create tests to verify that the function correctly calculates fines for different overdue durations,
such as 1 day, 5 days, and 30 days.
2. Control Flow Testing: Control flow testing examines the control flow of the program to ensure all
paths are tested.
Example: In a library management system's book borrowing function, the developer creates tests to
cover all possible paths through the code:
User borrows a book successfully.
User tries to borrow a book that is already borrowed.
User tries to borrow more than the allowed limit.
3. Data Flow Testing: This technique focuses on the lifecycle of data within the program, ensuring
that variables are correctly defined, used, and released.
Example: A developer analyzes the data flow in the function responsible for searching books. They
check if all variables are initialized before use and if any are unnecessarily retained after they are no
longer needed.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 5
Software Testing
4. Path Testing: Path testing involves testing all possible paths in a program to ensure complete
coverage of the code.
Example: In the library management system, the developer identifies multiple paths in a function that
checks user credentials:
Path for valid username and password.
Path for invalid username.
Path for invalid password. They create tests to cover each of these paths.
To apply equivalence partitioning, we can take one value from each partition: $140 from the first valid
partition, $370 from the second valid partition, $530 from the third valid partition, and $78 from the
invalid partition. Now we have four test cases and have achieved 100% coverage because all defined
partitions are covered.
b) Boundary Value Analysis: This technique focuses on testing the boundaries between partitions, as
errors often occur at the edges.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 6
Software Testing
To apply two-value boundary analysis we will test the minimum and maximum value of each boundary:
$99, $100, $200, $201, $500, and $501. We have six test cases and we will achieve 100% coverage by
testing them because all defined boundaries are covered.
c) Decision Table Testing
The decision table testing technique is used to visually present the different combinations of inputs and
outputs and is more focused on business rules. We use decision table testing in situations where different
combinations of test input conditions result in different outputs. With this technique, we identify the
conditions and the resulting actions of the testing object and present them in a table.
Example of decision table testing:
The discount is calculated depending on the total amount of the shopping cart and whether the customer
is a member. If the total amount is more than $200 and the customer is a member, the discount is 10%.
If the customer is not a member, there is no discount regardless of the total amount in the shopping cart.
To use the decision table testing technique, we first need to identify the conditions. In this case, the
conditions are the total amount in the shopping cart and whether a customer is a member or not. Next,
we need to identify all combinations of these conditions. We will mark them with Y and N.
The next step is to identify the correct actions/outcomes for each combination. We will use Y and N to
mark them.
As the final step, we write test cases for each rule in the table. In this table we have four rules which
means we will have four test cases:
Test case 1 for Rule 1: The total amount is more than $200 and the customer is a member, the
outcome will be a 10% discount off the total amount in the shopping cart.
Test case 2 for Rule 2: The total amount is more than $200, but the customer is not a member. There
will be no discount.
Test case 3 for Rule 3: The customer is a member, but the total amount is not more than $200. There
will be no discount.
Test case 4 for Rule 4: The total amount is not more than $200 and the customer is not a member.
There will be no discount.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 7
Software Testing
Functional Testing:
Functional testing is performed to verify that all the features developed are according to the
functional specifications, and it is performed by executing the functional test cases written by the QA
team, in functional testing phase, system is tested by providing input, verifying the output and
comparing the actual results with the expected results.
There are different Levels of Functional Testing out of which the most important are
1. Unit Testing: Unit testing involves testing individual components or functions of a software
application in isolation to ensure they work correctly.
Example: In a library management system, a developer tests the function that calculates overdue
fines. They create tests to verify that the function correctly calculates fines for different overdue
durations, such as 1 day, 5 days, and 30 days.
2. Integration Testing: Integration testing checks the interactions between integrated units or
components to ensure they work together as expected.
Example: In the same library management system, integration testing may involve checking the
interaction between the user authentication module and the book borrowing module to verify that
users can borrow books only after logging in successfully.
3. System Testing: System testing evaluates the complete and integrated software system to verify
that it meets specified requirements.
Example: Testing the entire library management system as a whole to ensure all functionalities
(e.g., searching for books, borrowing, and returning) work correctly together and meet user
requirements.
4. Acceptance Testing: Acceptance testing assesses whether the software meets business needs and
is ready for delivery. This is often performed by end-users.
Example: In the library management system, users may conduct acceptance testing by using the
system to perform typical tasks (like searching for books and managing accounts) and ensuring it
meets their expectations before final approval.
a. Alpha Testing: Alpha testing is an internal testing phase conducted by developers or internal
teams to identify bugs before the software is released to external testers.
Example: Before releasing the library management system to a select group of users, the
development team conducts alpha testing to identify and fix any major issues in a controlled
environment.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 8
Software Testing
b. Beta Testing: Beta testing involves releasing the software to a limited audience outside the
development team to gather feedback and identify any remaining issues.
Example: The library management system is released to a group of librarians and users to test
in a real-world environment, allowing them to provide feedback on functionality and usability
before the final release.
ii. Stress Testing: Stress testing determines the system's behavior under extreme conditions,
beyond normal operational capacity, to identify its breaking point and how it recovers.
Example: For the library management system, stress testing might involve increasing the number
of simultaneous users to 1,000 or more and observing how the system handles the load, including
measuring how it performs when it exceeds its maximum capacity, such as during a high-demand
period like the start of a school semester.
iii. Security Testing: Security testing identifies vulnerabilities in the system to ensure data
protection and that the application is secure against threats and attacks.
Example: In a library management system, security testing could involve testing for common
vulnerabilities such as SQL injection, cross-site scripting (XSS), and verifying that sensitive user
information (like account details and borrowing history) is securely encrypted and protected
from unauthorized access.
iv. Recovery Testing: Recovery testing assesses how well a system can recover from crashes,
hardware failures, or other disruptions, ensuring that data integrity is maintained.
Example: For the library management system, recovery testing might involve simulating a power
failure or server crash while a user is borrowing a book and then checking if the system can
restore the previous session accurately and that no data is lost after the restart.
v. Compatibility Testing: Compatibility testing ensures that the software functions correctly
across different devices, browsers, operating systems, and environments.
Example: For the library management system, compatibility testing would involve checking if
the application works properly on various web browsers (like Chrome, Firefox, and Safari) and
devices (such as desktops, tablets, and smartphones) to ensure a consistent user experience.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 9
Software Testing
vi. Usability Testing: Usability testing assesses how easy and intuitive the software is for end-
users, focusing on user experience and satisfaction.
Example: In the library management system, usability testing might involve observing users as
they navigate the interface to borrow a book, noting any difficulties they encounter, such as
confusing layouts or unclear instructions, and gathering feedback to improve the overall user
experience.
Testing Process
The testing process typically involves several key stages to ensure software quality and functionality.
Here’s a structured overview of the testing process:
1. Requirement Analysis: Understand and analyze the requirements to define what needs to be tested.
Activities:
o Review requirement documents, specifications, and user stories.
o Identify testable requirements and clarify ambiguities.
2. Test Planning: Outline the testing approach, resources, schedule, and scope.
Activities:
o Define the testing strategy (manual, automated, etc.).
o Determine resource requirements (tools, team members).
o Create a test plan document outlining scope, objectives, timelines, and deliverables.
3. Test Case Design: Develop detailed test cases based on requirements and specifications.
Activities:
o Write test cases, including steps, expected results, and test data.
o Review and validate test cases with stakeholders.
5. Test Execution: Execute the test cases and record the results.
Activities:
o Run test cases and document actual results.
o Identify and log defects for any test case that fails.
o Retest fixed defects to verify corrections.
7. Defect Reporting and Management: Manage identified defects effectively.
Activities:
o Log defects in a tracking system with relevant details (steps to reproduce, severity, etc.).
o Communicate defects to development teams and prioritize them for fixing.
8. Regression Testing: Ensure that new code changes do not adversely affect existing functionalities.
Activities:
o Execute previously passed test cases to validate unchanged parts of the application.
o Automate regression tests where applicable for efficiency.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 10
Software Testing
Cyclomatic complexity
Independent path is an execution flow from the start point to the end point.
Cyclomatic complexity is a software metric used to measure the complexity of a program by
quantifying the number of linearly independent paths through the source code. It is calculated
based on the control flow of the program, specifically focusing on decision points like if
statements, loops, and case statements.
Formula:
The Cyclomatic complexity (CC) can be calculated using the formula:
CC = E – N + 2
Where:
Number of Nodes = 13
Number of edges = 17
CC= E-N+2
= 17-13+2
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 11
Software Testing
Why It Is Used:
Code Reviews: During code reviews, developers can use cyclomatic complexity to identify
areas of the code that may be overly complex.
Test Case Design: Cyclomatic complexity can help guide the design of test cases, ensuring
that all possible execution paths are covered.
Identify Potential Risks: Code with high cyclomatic complexity is more prone to bugs and
defects, as it may be harder to follow the logic. Identifying such areas can help prioritize
refactoring or additional testing.
1. Software Testing
Software testing involves the process of executing a program or application to identify any bugs or
errors. It focuses on verifying that the software behaves as expected under various conditions.
Example: In a Library Management System, testing might involve:
Functional Testing: Checking if users can successfully borrow and return books.
Performance Testing: Assessing how the system performs under a heavy load (e.g., many users
searching for books simultaneously).
Usability Testing: Evaluating whether the interface is user-friendly for both library staff and patrons.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 12
Software Testing
4. Audit
An audit is a systematic examination of a process or system to ensure compliance with established
standards or regulations. It can be internal or external and often involves a review of the effectiveness
of quality processes.
Example: In the Library Management System context, an audit might involve:
Reviewing the system’s documentation and processes to ensure compliance with regulatory standards
(e.g., data protection laws for patron information).
Assessing whether the testing and QC processes were followed correctly and if the QA processes are
effectively implemented.
Summary
Software Testing: Focuses on finding bugs and ensuring that the software works as intended.
Quality Control (QC): Involves inspecting the final product to ensure it meets specified requirements.
Quality Assurance (QA): Aims to improve the development process to prevent defects before they occur.
Audit: Reviews compliance with standards and the effectiveness of QA/QC processes.
Prof. Dr. Engr. A.K.M. Masum, Dept. of Software Engineering, DIU Page Number- 13