5124white Box Testing-2
5124white Box Testing-2
program by using the control flow graph (CFG) to represent paths of execution. Each node in
the CFG represents a block of code, and edges represent the control flow between these
blocks.
For a Library Management System (LMS), here’s how we can break down various
components and perform control flow testing. Below, I’ll outline the approach and provide some
control flow test cases for key modules such as user login, book search, borrowing books,
returning books, and fines.
● User Login
● Book Search
● Borrowing Books
● Returning Books
● Fine Calculation
● Adding/Deleting Books (Admin)
Each of the components below would be converted into a control flow graph where each
condition, loop, and branch is represented.
Description: Users enter their credentials, which are validated against the database.
Control Flow:
Control Flow:
Test Cases:
Error message:
"Invalid search
TC6 1 → 2 (invalid) → 4 → 1 criteria"
Module 3: Borrowing Books
Description: The user selects a book and attempts to borrow it, provided it is available.
Control Flow:
Test Cases:
Test Case
ID Path Expected Outcome
The next step is to apply Basis Path Testing to ensure all independent paths are covered.
Here's how to do it: