0
0
Microservicessystem_design~10 mins

Automated testing strategy in Microservices - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the type of test that checks individual functions in isolation.

Microservices
def test_user_creation():
    # This is a [1] test
    assert create_user('Alice') == 'User Alice created'
Drag options to blanks, or click blank then click option'
Aacceptance
Bsystem
Cintegration
Dunit
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing unit test with integration test.
2fill in blank
medium

Complete the code to specify the test type that verifies communication between microservices.

Microservices
def test_order_processing():
    # This is an [1] test
    response = call_payment_service(order_id)
    assert response.status == 'success'
Drag options to blanks, or click blank then click option'
Aperformance
Bintegration
Cunit
Dsecurity
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing unit test instead of integration test.
3fill in blank
hard

Fix the error in the test type that checks the entire system's behavior from the user's perspective.

Microservices
def test_full_system():
    # This is a [1] test
    result = simulate_user_journey()
    assert result == 'success'
Drag options to blanks, or click blank then click option'
Asystem
Bunit
Cintegration
Dload
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing system test with unit or integration test.
4fill in blank
hard

Fill both blanks to complete the test strategy for microservices: use {{BLANK_1}} tests for individual services and {{BLANK_2}} tests for service interactions.

Microservices
testing_strategy = {
    'single_service': '[1]',
    'service_interaction': '[2]'
}
Drag options to blanks, or click blank then click option'
Aunit
Bperformance
Cintegration
Dsecurity
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing performance or security tests with functional tests.
5fill in blank
hard

Fill all three blanks to complete the testing pyramid: {{BLANK_1}} tests form the base, {{BLANK_2}} tests are in the middle, and {{BLANK_3}} tests are at the top.

Microservices
testing_pyramid = ['[1]', '[2]', '[3]']
Drag options to blanks, or click blank then click option'
Aunit
Bintegration
Csystem
Dperformance
Attempts:
3 left
💡 Hint
Common Mistakes
Including performance tests in the pyramid layers incorrectly.