0
0
Testing Fundamentalstesting~20 mins

Database migration testing in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Database Migration Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Purpose of Database Migration Testing

Why is database migration testing important when moving data from one system to another?

ATo check if the user interface of the application looks good after migration.
BTo ensure the network speed is faster after migration.
CTo confirm that the database server hardware is upgraded.
DTo verify that data is accurately transferred and no data loss or corruption occurs during migration.
Attempts:
2 left
💡 Hint

Think about what could go wrong with the data itself during migration.

Predict Output
intermediate
2:00remaining
Result of Data Count Check After Migration

Given the following SQL queries run before and after migration, what is the expected output if migration is successful?

-- Before migration
SELECT COUNT(*) FROM customers;
-- After migration
SELECT COUNT(*) FROM customers_new;
Testing Fundamentals
Before migration count: 1500
After migration count: 1500
ABoth counts are equal, showing 1500 rows each.
BBefore migration count is 1500, after migration count is 0.
CBefore migration count is 0, after migration count is 1500.
DBoth counts are different, before 1500 and after 1400.
Attempts:
2 left
💡 Hint

What does it mean if the row counts before and after migration match?

assertion
advanced
2:00remaining
Valid Assertion for Data Integrity Check

Which assertion correctly verifies that the 'email' field in the migrated 'users' table contains no NULL values?

Testing Fundamentals
assert migrated_data['email'].isnull().sum() == 0
Aassert migrated_data['email'].count() == 0
Bassert migrated_data['email'].isnull().sum() == 0
Cassert migrated_data['email'].isnull().all()
Dassert migrated_data['email'].sum() == 0
Attempts:
2 left
💡 Hint

Think about how to check that no NULL values exist in a column.

🔧 Debug
advanced
2:00remaining
Identify the Error in Migration Test Script

What error will this Python snippet raise during migration testing?

def test_row_count(original, migrated):
    assert original.count == migrated.count

original = 1000
migrated = 1000

test_row_count(original, migrated)
AAttributeError because 'int' object has no attribute 'count'.
BAssertionError because counts are not equal.
CTypeError because count is not callable.
DNo error, test passes successfully.
Attempts:
2 left
💡 Hint

Check the data types and attributes used in the assertion.

framework
expert
3:00remaining
Best Practice for Automating Database Migration Tests

Which approach is best for automating database migration testing to ensure data integrity and performance?

AManually check data in the database using SQL queries after migration is complete.
BOnly test the application UI after migration to see if it works without errors.
CCreate automated scripts that compare row counts, data samples, and run performance benchmarks before and after migration.
DRun migration once and trust the migration tool without further testing.
Attempts:
2 left
💡 Hint

Think about thorough and repeatable testing methods.