Database testing project
Database testing project
GROUP PROJECT
GROUP D
Andrew Lite Suresh Rajan (C0917416)
Deepa Sree Kothandan Rajan (C0907986)
Praharsha Manda (C0917433)
Atomicity Violation:
Improper code and transaction failed:
Revised code:
Adding an EXCEPTION block ensures the transaction is rolled back in case of
an error, maintaining consistency and statement processed:
Test Cases for Transactions and Data Consistency checks:
Test Case 1: Basic Transaction Rollback
Objective: Validate that a rollback undoes partial changes.
Steps:
Start a transaction (BEGIN or SET TRANSACTION).
Insert a record into the table.
Roll back the transaction.
Verify that the record was not inserted by querying the table.
Phase 3: Data Generation and Data Mapping for Database Testing
One-to-one relationship:
A one-to-one relationship exists when each row in Table A is linked to only
one row in Table B, and vice versa.
A customer can have only one detailed profile (address and phone number).
Customers Table:
CustomerDetails table
One-to-many relationship:
A one-to-many relationship exists when a single row in Table A can be
associated with multiple rows in Table B, but each row in Table B is
associated with only one row in Table A.
A customer can place multiple orders, but each order belongs to only one
customer.
Customers table:
Orders table:
Alice placed 2 orders but, Bob placed 1 order in orders table
Many-to-many relationships:
A many-to-many relationship exists when multiple rows in Table A can be
associated with multiple rows in Table B, and vice versa. This relationship is
typically implemented using a junction table.
An order can contain multiple products, and a product can appear in multiple
orders.
Orders Table:
Products Table:
OrderDetails table:
Generated test data using test scripts for the following table:
Customers table:
Orders table:
Products table:
Checking for orphaned records (no valid customer or product):