0
0
Testing Fundamentalstesting~20 mins

User story testing in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
User Story Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding User Story Acceptance Criteria

Which of the following best describes the purpose of acceptance criteria in user story testing?

AThey describe the user interface design details for the user story.
BThey list all the technical tasks developers must perform to implement the user story.
CThey define the conditions that must be met for the user story to be considered complete and working as expected.
DThey specify the project deadlines and resource allocation for the user story.
Attempts:
2 left
💡 Hint

Think about what helps testers decide if a user story is done.

assertion
intermediate
2:00remaining
Writing Assertions for User Story Testing

You have a user story: "As a user, I want to log in with valid credentials so that I can access my dashboard." Which assertion best tests this story?

AAssert that the login function returns a success message when given valid username and password.
BAssert that the login page loads within 5 seconds.
CAssert that the logout button is visible after login.
DAssert that the password field accepts only numbers.
Attempts:
2 left
💡 Hint

Focus on what the user story wants to achieve.

Predict Output
advanced
2:00remaining
Test Result from User Story Scenario

Given this test code for a user story about adding items to a cart, what is the test result?

Testing Fundamentals
def test_add_item_to_cart():
    cart = []
    def add_item(item):
        if item != '':
            cart.append(item)
    add_item('apple')
    add_item('')
    assert len(cart) == 1
    assert cart[0] == 'apple'
    return 'pass'

result = test_add_item_to_cart()
A"pass"
BAssertionError
CTypeError
DIndexError
Attempts:
2 left
💡 Hint

Check what items are added to the cart and what the assertions check.

🔧 Debug
advanced
2:00remaining
Debugging a Failing User Story Test

Consider this test for a user story: "As a user, I want to reset my password." The test fails with an AssertionError. What is the likely cause?

Testing Fundamentals
def test_password_reset():
    user = {'email': 'user@example.com', 'password': 'oldpass'}
    def reset_password(email, new_pass):
        if email == user['email']:
            user['password'] = new_pass
    reset_password('user@example.com', 'newpass')
    assert user['password'] == 'oldpass'
AThe user dictionary is missing the password key.
BThe assertion expects the old password but the password was changed to 'newpass'.
CThe email check in reset_password is incorrect.
DThe reset_password function does not update the password correctly.
Attempts:
2 left
💡 Hint

Look at what the assertion expects versus what the function does.

framework
expert
3:00remaining
Choosing the Best Test Framework for User Story Automation

You want to automate acceptance tests for user stories that involve web UI interactions and API calls. Which test framework setup is best suited?

AUse a simple script with print statements to manually verify UI and API responses.
BUse a unit testing framework like JUnit only for backend API testing without UI automation.
CUse a load testing tool like JMeter to test user story acceptance criteria.
DUse a BDD framework like Cucumber with Selenium for UI and REST-assured for API testing, integrating tests with user story descriptions.
Attempts:
2 left
💡 Hint

Think about tools that connect user stories with automated acceptance tests for UI and APIs.