0% found this document useful (0 votes)
12 views24 pages

Report STQA Final

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)
12 views24 pages

Report STQA Final

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
You are on page 1/ 24

REPORT ON

LIBRARY MANAGEMENT SYSTEM


SUBMITTED TO THE SAVITRIBAI PHULE PUNE UNIVERSITY, PUNE
IN THE PARTIAL FULFILLMENT OF THE REQUIREMENT
FOR

MINI PROJECT (SOFTWARE TESTING AND QUALITY


ASSURANCE)
SEM - VII

SUBMITTED BY

VARSHIT REDDY 3458


VINAY TIWARI 3460
VIKASH PURI 3459

DEPARTMENT OF COMPUTER ENGINEERING


ARMY INSTITUTE OF TECHNOLOGY
DIGHI HILLS, ALANDI ROAD, PUNE 411015

SAVITRIBAI PHULE PUNE UNIVERSITY


2024-2025

ARMY INSTITUTE OF TECHNOLOGY, DEPARTMENT OF COMPUTER ENGINEERING 2024-25


1
CERTIFICATE

This is to certify that the project report entitles

LIBRARY MANAGEMENT SYSTEM

SUBMITTED BY

VARSHIT REDDY 3458


VINAY TIWARI 3460
VIKASH PURI 3459

are bonafide students of this institute and the work have been carried out by them under the
supervision of Prof. Sushma A Shirke and it has been approved for the partial fulfilment of
the requirement of, Fourth-Year course on Software Testing and Quality Assurance of
Savitribai Phule Pune University.

(Prof. Sushma Shirke) (Dr. Sunil Dhore)


Guide HOD
Department of Computer Engineering Department of Computer Engineering

ARMY INSTITUTE OF TECHNOLOGY, DIGHI, PUNE-411015

Place: Pune

Date:

ARMY INSTITUTE OF TECHNOLOGY, DEPARTMENT OF COMPUTER ENGINEERING 2024-25


2
ACKNOWLEDGEMENT

We are overwhelmed in all humbleness and gratefulness to acknowledge our depth to all those
who have helped us to put these ideas, well above the level of simplicity and helped us develop
this into something concrete. The outcome of this project required a lot of guidance and
assistance from many people, and we are extremely grateful and privileged to be provided with
it through all the helping entities.

We owe our deep gratefulness to our project guide Prof. Sushma A Shirke, who gave his
attention and took an interest on our project work and steered us in the right direction all along,
throughout our project work by providing all the necessary information for developing a good
system. We are extremely thankful to him for providing his fascinating support and guidance,
despite his busy schedule.

We are thankful and fortunate enough to get constant encouragement, support, and guidance
from all the teaching staff of the Computer Engineering Department which helped us in
successfully completing our project work. Also, we would like to extend our sincere esteem
to all our seniors for their timely and knowledgeable support without which completion of
this project would’ve been much harder to achieve.

VARSHIT REDDY
VINAY TIWARI
VIKASH PURI

ARMY INSTITUTE OF TECHNOLOGY, DEPARTMENT OF COMPUTER ENGINEERING 2024-25


3
Table of Contents

Sr.No Title of Chapter Page No.


01 Introduction
1.1 Overview
1.2 Motivation
1.3 Problem Definition and Objectives
1.4 Project Scope and Limitations
1.5 Methodologies of Problem Solving
02 Software Requirement Specification
2.1 Introduction
2.2 Overall Description
2.3 System Features
2.4 External Interface Requirements
2.5 Non Functional Requirements
2.6 Other Requirements
03 Test Plan
3.1 Introduction
3.2 Features to be tested
3.3 Bug Taxonomy
3.4 Test Cases with Procedures
3.5 Conclusion
04 Unit Tests and Integration Tests
05 Test Report
06 Screenshots
07 Conclusion
Chapter 1 : Introduction
1.1 Overview
• This project is a simple Python-based Library Management System that allows users to manage books,
including adding, deleting, issuing, and returning books. It employs object-oriented programming (OOP)
principles and stores book data in an Excel file using the Openpyxl library.

1.2 Motivation
• The motivation behind this project is to create a user-friendly library management system suitable for small
libraries or educational purposes. This project demonstrates how Python can be integrated with Excel for
data storage and manipulation while emphasizing basic library functionalities.

1.3 Problem Definition and Objectives


• Problem Definition:
To develop a system where users can efficiently manage library books, track issued books, and perform
basic operations like adding and deleting books.

• Objectives:
➢ To enable the addition of new books with unique identifiers and details.

➢ To implement the deletion of books from the system

➢ To support the issuance and return of books by users

➢ To allow users to view all available books and search for specific titles or authors.

1.4 Project Scope and Limitations


• Scope:
➢ The project covers basic library operations, including book management, issuance, returns, and
search functionalities.
➢ Data is securely stored and managed using Excel, ensuring persistence across sessions.
➢ Book details (title, author, publication year, etc.) are stored, making it easy to manage the library's
inventory
• Limitations:
➢ The project does not include advanced features like online access or integration with external
library databases.
➢ It is limited to basic library functions and does not support features like reservation or late fee
calculations.
➢ Performance may be slower for larger datasets as the Excel file grows.

1.5 Methodologies of Problem Solving


• Object-Oriented Programming (OOP):

➢ The project follows OOP principles, where each book is an object with attributes (title,
author, ID, etc.) and methods (add, delete, issue, return).
• Excel Data Management:

➢ Book data is stored and retrieved using the openpyxl library, which provides
functionality to read and write data in an Excel workbook.
• Automatic Account Number Generation:

➢ Account numbers are randomly generated to ensure uniqueness.

• Exception Handling:
➢ The project uses exception handling to manage errors such as insufficient funds or
invalid.
Chapter 2 : Software Requirements Specification
2.1 Introduction
• The Software Requirements Specification (SRS) outlines the functional and non-functional requirements
for the Python-based Library Management System. This document serves as a reference for the
development, design, and implementation phases of the project.

2.2 Overall Description


• The Library Management System is designed to provide basic functionalities for managing books in a
library. Users can add new books, delete existing books, issue and return books, and view all books in the
library. The system uses Excel files for persistent data storage, leveraging the openpyxl library to read and
write book data. The program is implemented using Python's object-oriented programming (OOP)
principles to encapsulate the logic for managing library operation.

2.3 System Features


• Add Book :
➢ Allows users to add new books by providing details such as title, author, publication year, and a
unique Book ID.

• Delete Book :
➢ All Users can delete a book from the library by specifying its Book ID.

• Issue Book :
➢ Users can issue a book, updating its availability status in the library.

• Return Book :
➢ Users can return an issued book, restoring its availability in the library..

• View all Books :


➢ Allows users to view a list of all books currently in the library, displaying details like title, author,
and availability status.

• Search for a Book :


➢ Users can search for a specific book by title, author, or Book ID.
2.4 External Interface Requirements
• User Interface:
➢ Command-line interface (CLI) for user interaction. Users will input data such as books details and
commands via the console.

• Software Interface:
➢ Uses the openpyxl Python library to interact with an Excel file for reading and writing book data .

• Hardware Interface:
➢ Requires a system capable of running Python 3.x.

2.5 Non-Functional Requirements


• Performance:
➢ The system must handle basic library operations efficiently, with minimal response times for
operations like adding or deleting books.
• Reliability:
➢ Data should persist across sessions through consistent Excel file operations, ensuring no data loss
between executions.

• Security:
➢ Basic user authentication may be implemented for sensitive operations to prevent unauthorized
access.

• Scalability:
➢ As the system relies on Excel for storage, its scalability is limited. Performance may degrade as the
number of books increases.

• Usability:
➢ The system should be easy to use, with a simple, intuitive command-line interface for navigating
library operations.

2.6 Other Requirements


• Data Backup:
➢ Manual backup of the Excel file is recommended to prevent data loss.
• Installation Requirements:
➢ Requires Python 3.x installed on the system along with the openpyxl library for Excel file
manipulation.

• Error Handling:
➢ The system should handle input errors, such as invalid books or incorrect books Ids , gracefully
without crashing.
Chapter 3 : Test Plan
3.1 Introduction
• The test plan provides a framework for testing the Python-based Library Management System. It includes
details about features to be tested, a taxonomy of potential bugs, test cases, and procedures for verifying
that the system meets its functional and non-functional requirements.

3.2 Features to be tested


• Add Book :
➢ Ensure that the system correctly adds a new book with a unique Book ID, title, author, and year of
publication.

• Delete Book :
➢ Verify that the system allows users to delete a book and that the book is removed from the library
database

• Issue Book :
➢ Test that users can successfully issue a book, and that the availability count is updated correctly.

• Return Book:
➢ Ensure that the system allows users to return a book, and that the availability count is updated
accordingly

• View Books:
➢ Verify that users can view a list of all books in the library, displaying correct details (title, author,
Book ID, etc.).

• Search for a Book :


➢ Ensure that users can search for a book by title, author, or Book ID, and that the correct book
details are returned.
3.3 Bug Taxonomy
• Data Input Errors:
➢ Invalid input for amounts (negative numbers, non-numeric input).
➢ Incorrectly formatted usernames or passwords during account creation.

• Book Management Errors:


➢ Failure to update the availability count when issuing or returning books
➢ . Allowing the deletion of book that does not exist.

• Data Storage Issues:


➢ Excel file not saving or loading books details correctly.
➢ Corruption of data when writing to or reading from the Excel file.

• System Crashes/Unhandled Exceptions:


➢ Crashes due to invalid input or unhandled exceptions.
➢ Missing Excel file causing the system to fail on initialization.

3.4 Test cases with procedures


Test Case Description Procedure Expected Outcome
TC1: Add Book Verify that new books are added 1. Add a book with the ID Book added
AIT-001 with unique ID "AIT-001".. successfully with ID
"AIT-001"
TC2: Add Book Verify that new books are added 1. Add a book with the ID Book added
AIT-002 with unique ID "AIT-002".. successfully with ID
"AIT-002"
TC3: Return Book Ensure that returning a book 1. Search for the issued Book is marked as
AIT-001 updates its availability. book "AIT-001" returned, and the
2. Confirm the return availability count is
increased by one
TC4: Issue Book Book issued successfully if 1. Search for the book Book is marked as
AIT-002 attempt is done. "AIT-002" issued, and the
2. Confirm issuance to a availability count is
user decreased by one
TC5: Attempt to Attempts to add a book. 1. Try to add the book Exception raised:
Add Book AIT- "AIT-001" again. "Book ID already
001 Again exists"
TC6: Delete Book Book is removed from the library 1. Search for the book Book deleted
AIT-001 database or Excel file. "AIT-001". successfully.
2. Confirm deletion.
TC7: View All Displays a list or Data Frame with 1. Select the option to List of all books
Books in Library details of all books currently view all books in the displayed
available in the library library

3.5 Conclusion
• The test plan defines a structured approach to test the key features of the Python-based banking system. It
identifies critical operations, potential bugs, and testing strategies to ensure the system performs reliably,
securely, and as expected. By executing the outlined test cases, we ensure that the banking application
meets its functional and non-functional requirements, providing a stable user experience.
Chapter 4 : Unit Tests and Integration Tests
4.1 Unit Tests
Definition:

• Unit testing focuses on verifying individual components or functions in isolation to ensure they work as
intended. In the context of the Python-based Library Management System, unit tests are written to check
the functionality of core methods such as adding a book, deleting a book, issuing a book, and viewing all
books. The goal is to test these individual units in isolation from the rest of the system.

Benefits of Unit Testing:

• Early Detection of Bugs: Unit tests allow developers to catch issues in individual functions or methods
early in the development process, minimizing the chances of defects making their way into the integrated
system.
• Simplified Debugging: Since unit tests focus on small, independent components, it becomes easier to
identify and fix errors when a test fails.
• Code Quality: By ensuring that each unit behaves correctly, unit testing promotes higher code quality and
reliability. Well-tested units are less likely to introduce bugs when changes are made in the future.

Unit Tests for the Library Management System:

• Add Book Test:


o Verifies that a book with valid details (title, author, year, and unique Book ID) is added to the
library.
o Ensures that the system raises an error if a book with an existing Book ID is added.
o Checks that adding a book with invalid details (e.g., non-integer year) raises a ValueError.
• Delete Book Test:
o Verifies that a book can be deleted using a valid Book ID.
o Ensures that the system raises an error when attempting to delete a non-existent Book ID.
• Issue Book Test:
o Ensures that issuing a book changes its status to unavailable.
o Verifies that an error is raised if an unavailable book is issued again.
• Return Book Test:
o Verifies that returning an issued book updates its status to available.
o Checks that an error is raised if a book that hasn’t been issued is returned.
• View All Books Test:
o Confirms that the method returns a list of all books with their details.
o Ensures that the system accurately reflects the current state of the library (e.g., after adding,
deleting, or issuing books).
4.2 Integration Tests

Definition:

• Integration testing focuses on verifying how different components or modules work together as a group. It
ensures that combined parts of the system function as expected when integrated. In the case of the Python
Library Management System, integration testing would check whether components like book management
(add, delete, issue, and return) and Excel file handling work together harmoniously to achieve end-to-end
functionality, such as adding a book, issuing it, and saving the library’s state to the Excel sheet.

Benefits of Integration Testing:

• Detects Issues in Interaction: While individual units may work correctly, integration testing uncovers
problems that arise when they interact with each other, such as issues with data flow between components.
• Ensures Data Consistency: Integration tests can verify that data is handled consistently across
components, ensuring that operations like issuing and returning books persist correctly in the Excel sheet.
• End-to-End Verification: Integration testing provides confidence that the system performs all required
actions correctly from start to finish, simulating real user scenarios.

Integration Tests for the Library Management System:

• Add Book and Data Persistence Test:


o Ensures that adding a book also saves the book details in the Excel file.
o Verifies that after restarting the system, the book data is correctly loaded from the Excel file.
• Delete Book and Data Synchronization Test:
o Ensures that deleting a book updates the Excel file as well as the in-memory data.
o Verifies that attempting to delete a non-existent book is handled consistently across all components.
• Issue Book and Data Synchronization Test:
o Ensures that issuing a book updates its availability status in both in-memory data and the Excel file.
o Verifies that issuing an unavailable book raises a consistent error message.
• Return Book and Data Synchronization Test:
o Ensures that returning a book updates its availability status in both in-memory data and the Excel
file.
o Verifies that returning a book that hasn’t been issued is handled consistently across all components.
• View All Books and Data Consistency Test:
o Verifies that the view function accurately reflects the current state of the library, showing all books
and their statuses.
o Confirms that changes in the library (such as adding, deleting, issuing, or returning books) are
reflected consistently in the Excel file and in-memory data.
Chapter 5 :Unit Test Report for Library Management System

1. Working with setUp and tearDown

• Purpose:
o setUp: Prepares the test environment by creating a temporary Excel file
(test_library.xlsx) to simulate the library database.
o tearDown: Cleans up by deleting this temporary file after each test to ensure no residual data
impacts other tests.
• Outcome: Ensures that each test starts with a fresh, consistent environment, which is crucial for accurate
and isolated test results.

2. Test Case: test_create_excel_file


• Purpose: Verifies that the create_excel_file function correctly creates an Excel file with the
expected structure.
• What it Verifies:
o Confirms that the file exists after creation.
o Checks if the file has the correct number of columns (9), indicating the file’s structure is accurate.
• Expected Outcome: The file should exist, and its columns should match the expected library management
structure.

3. Test Case: test_generate_book_id


• Purpose: Ensures that the generate_book_id function correctly generates a book ID with a specific
format.
• What it Verifies:
o Confirms that calling generate_book_id(1) results in the correct ID format AIT - 001.
• Expected Outcome: The function should generate IDs accurately in the specified format.

4. Test Case: test_add_book


• Purpose: Checks if a new book is successfully added to the library.
• What it Verifies:
o Confirms that the book details are saved in the file and that the title matches the added book.
• Expected Outcome: The Excel file should contain one book entry with the correct details.

5. Test Case: test_add_book_with_existing_id


• Purpose: Ensures that adding a book with a duplicate ID raises an appropriate error.
• What it Verifies:
o Tests that the system raises an exception when a duplicate ID is added.
• Expected Outcome: The system should return a Book ID already exists. error.
6. Test Case: test_view_books
• Purpose: Verifies that the view_books function returns the data in a pandas DataFrame format.
• What it Verifies:
o Confirms that the output is a DataFrame, which ensures the data is returned in a structured format
for viewing.
• Expected Outcome: The function should return a DataFrame object containing the list of books.

7. Test Case: test_delete_book


• Purpose: Tests the deletion functionality for removing a book from the library.
• What it Verifies:
o Checks that the book is removed and is no longer present in the library after deletion.
• Expected Outcome: The DataFrame should have zero entries, confirming the book's deletion.

8. Test Case: test_delete_non_existent_book


• Purpose: Ensures that attempting to delete a non-existent book raises an error.
• What it Verifies:
o Confirms that the system raises an appropriate error if the book ID does not exist.
• Expected Outcome: An exception with the message Book ID not found. should be raised.

9. Test Case: test_issue_book


• Purpose: Tests the functionality to issue a book to a user.
• What it Verifies:
o Ensures the book’s status is updated to Issued, with the correct user details and issue date.
• Expected Outcome: The book entry should reflect the Issued status with the borrower's information.

10. Test Case: test_issue_already_issued_book


• Purpose: Verifies that issuing an already issued book raises an error.
• What it Verifies:
o Ensures the system prevents issuing the same book again and raises an error if an attempt is made.
• Expected Outcome: The system should return a Book is already issued. error.

11. Test Case: test_return_book

• Purpose: Ensures the return functionality updates the book’s status back to Available.
• What it Verifies:
o Checks that the book’s Issued status changes to No and the borrower’s details are cleared upon return.
• Expected Outcome: The book entry should no longer reflect it as issued, with cleared borrower details.

12. Test Case: test_return_non_issued_book

• Purpose: Ensures that returning a non-issued book raises an error.


• What it Verifies:
o Confirms that the system raises an appropriate error if an attempt is made to return a book that hasn’t been
issued.
• Expected Outcome: An exception with the message Book is not issued. should be raised.
Chapter 6 : Screenshots:
1. Add a Book :

2. View and delete book :


3. Issue a Book :

4. Return a book :
5. Stream lit Application :

6. See test Report :


Chapter 7 : Conclusion and Final Report

5.1 Summary of Test Results


After conducting a series of unit and integration tests on the Library Management System, the following results
were observed:

• Account Creation and Data Handling: The system accurately creates new books and generates unique
IDs, ensuring that all relevant details (title, author, year, etc.) are correctly saved in the Excel file.
• Book Operations: Functions for adding, viewing, deleting, issuing, and returning books are correctly
implemented. Unit tests confirmed that each function updates the Excel data file as expected.
• Error Handling: Exception handling was effectively tested, covering cases such as attempting to issue an
already issued book or deleting a non-existent book. All such cases raised appropriate and informative error
messages, improving system usability and reliability.
• Data Persistence: The system accurately reads and writes data to the Excel file, ensuring data is stored
correctly between sessions.
• Command-Line Interface: The system’s command-line interface was verified to be user-friendly, with
clear prompts and feedback messages, making it simple to navigate for the end-user.

5.2 Key Findings


Through the testing phase, we identified that the Library Management System met its functional requirements
effectively:

• Functional Accuracy: All core functionalities, such as book management and status updates (issued,
returned, deleted), were executed without errors.
• Reliability: The unit tests highlighted the system’s reliability in performing consistent and accurate book
management operations.
• Efficiency: Operations such as adding, viewing, and deleting books performed efficiently. The system
handled interactions with the Excel file smoothly, with no observed delays for the current dataset size.

5.3 Overall System Evaluation


The results from both unit and integration tests indicate that the Library Management System functions as expected
and meets its requirements. The system was able to manage and store book data with a high degree of accuracy,
while the structured error handling made it robust against common user errors.
Strengths:

• Data Management: The use of Excel for data storage allowed for easy data manipulation and persistence
across sessions.
• User Experience: With a simple command-line interface and clear feedback, the system is intuitive and
easy to use.
• Code Quality and Maintainability: The project employs modular, object-oriented programming
principles, making it easy to maintain and extend.

Limitations:

• Scalability: As the system relies on Excel for storage, performance may degrade with very large datasets.
For future versions, a relational database like SQLite or MySQL could improve scalability.
• Security: The system does not include advanced security features for data protection, such as encryption.
This is a limitation if used in a real-world environment where data security is critical.

5.4 Future Improvements


Based on the test results and observations, the following enhancements are recommended:

• Database Migration: Transitioning from Excel to a database management system (DBMS) would improve
scalability, data integrity, and access speed.
• Enhanced User Interface: Integrating a graphical user interface (GUI) would make the system more user-
friendly and visually intuitive.
• Advanced Search and Filter Options: Implementing search filters by author, year, or title could improve
usability, especially as the library grows.
• Security Enhancements: Adding features like encryption, access controls, and audit logging could make
the system suitable for handling sensitive or private information.

5.5 Conclusion

In conclusion, the Library Management System has proven to be a reliable and efficient tool for basic book
management. It successfully meets the requirements for a small-scale library environment, enabling users to add,
issue, and manage books with minimal setup. While there are areas for improvement, particularly in terms of
scalability and security, the system provides a solid foundation for library management and could be extended with
additional features for enhanced functionality.
Through this testing process, we validated the importance of unit and integration testing in ensuring system
functionality and reliability. The tests served as valuable tools for identifying both strengths and potential areas of
refinement in the Library Management System. Moving forward, the recommendations listed here could guide
future development efforts to expand the system's capabilities and enhance its performance.

You might also like