|
Answer» Consider a simple SQL CODE below: CREATE TABLE ACID_DEMO (X INTEGER, Y INTEGER, CHECK (X + Y = 50));We will test for the ACID properties for two columns X and Y. There is also a constraint added on the table that the sum of values in columns X and Y should always be 50. - Atomicity: Here, we test that the transactions done on the table is either successful or failed. No records should be updated if the transactions fail.
- Consistency: Here, we test that the values in columns X and Y are updated correctly by following the constraint that the sum of these two values is always 50. The insertion or updation should not be allowed if the sum is not equal to 50.
- Isolation: Here, in the presence of multiple transactions, we need to test they are happening in isolation.
- Durability: Here, the test cases should consider that if a transaction has been committed, it should remain even after the incidents of power losses, crashes and errors. If we are using sharded or DISTRIBUTED database applications, RIGOROUS testing needs to be done to ENSURE the data is not lost.
|