Bird
Raised Fist0
Testing Fundamentalstesting~20 mins

Root cause analysis in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Root Cause Analysis Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Identifying the root cause in a bug report

You receive a bug report stating that the login button does not respond when clicked on the homepage. Which of the following is the most likely root cause?

AThe user forgot their password and cannot log in.
BThe button's click event handler is not attached properly in the code.
CThe server is down and cannot process login requests.
DThe homepage background color is not displaying correctly.
Attempts:
2 left
💡 Hint

Think about what directly affects the button's ability to respond to clicks.

❓ Predict Output
intermediate
2:00remaining
Output of root cause analysis log filtering

Given the following log entries, what will be the output after filtering only error-level logs?

Testing Fundamentals
logs = [
  {'level': 'info', 'message': 'User logged in'},
  {'level': 'error', 'message': 'Null pointer exception'},
  {'level': 'warning', 'message': 'Low disk space'},
  {'level': 'error', 'message': 'Timeout error'}
]

error_logs = [log['message'] for log in logs if log['level'] == 'error']
print(error_logs)
A[]
B['User logged in', 'Low disk space']
C['Null pointer exception']
D['Null pointer exception', 'Timeout error']
Attempts:
2 left
💡 Hint

Filter logs where level equals 'error'.

❓ assertion
advanced
2:00remaining
Assertion to verify root cause fix in test automation

Which assertion correctly verifies that a bug causing a crash on clicking 'Submit' is fixed by checking the page does not crash?

Testing Fundamentals
def test_submit_button_does_not_crash(driver):
    driver.get('http://example.com/form')
    submit_button = driver.find_element('id', 'submit')
    submit_button.click()
    # Which assertion below is correct?
Aassert submit_button.is_displayed()
Bassert driver.current_url == 'http://example.com/form'
Cassert 'Error' not in driver.page_source
Dassert driver.find_element('id', 'error-message').is_displayed()
Attempts:
2 left
💡 Hint

Check that no error text appears after clicking submit.

🔧 Debug
advanced
2:00remaining
Debugging flaky test due to timing issue

A test intermittently fails because it tries to click a button before it is clickable. Which fix will most reliably solve this root cause?

AUse an explicit wait to wait until the button is clickable before clicking.
BAdd a fixed sleep of 5 seconds before clicking the button.
CRemove the click action from the test to avoid failure.
DClick the button twice quickly to ensure it registers.
Attempts:
2 left
💡 Hint

Waiting dynamically for the button state is better than fixed delays.

❓ framework
expert
3:00remaining
Root cause analysis integration in CI pipeline

In a CI pipeline, which approach best helps identify the root cause of a failing test suite after a new code push?

ACollect detailed test failure logs and screenshots, then analyze failure patterns over time.
BOnly run unit tests and skip integration tests to reduce failures.
CIgnore flaky tests and rerun the pipeline until it passes.
DRun all tests in parallel without logs to save time.
Attempts:
2 left
💡 Hint

Detailed logs and historical data help find root causes effectively.

Practice

(1/5)
1. What is the main goal of root cause analysis in software testing?
easy
A. To find the main reason behind a problem
B. To write more test cases quickly
C. To increase the number of bugs found
D. To improve the user interface design

Solution

  1. Step 1: Understand the purpose of root cause analysis

    Root cause analysis aims to identify the fundamental reason why a problem occurs.
  2. Step 2: Compare options with the purpose

    Only To find the main reason behind a problem matches the goal of finding the main reason behind a problem.
  3. Final Answer:

    To find the main reason behind a problem -> Option A
  4. Quick Check:

    Root cause analysis = find main reason [OK]
Hint: Root cause analysis = find main problem reason [OK]
Common Mistakes:
  • Confusing root cause analysis with test case writing
  • Thinking it increases bug count directly
  • Mixing it with UI design improvements
2. Which of the following is a correct first step in performing root cause analysis?
easy
A. Fix the bug immediately without investigation
B. Ignore the problem if it is rare
C. Ask 'Why?' repeatedly to dig deeper
D. Write automated tests before analysis

Solution

  1. Step 1: Identify the initial action in root cause analysis

    The process starts by asking 'Why?' multiple times to understand the problem deeply.
  2. Step 2: Evaluate the options

    Only Ask 'Why?' repeatedly to dig deeper describes this investigative questioning approach correctly.
  3. Final Answer:

    Ask 'Why?' repeatedly to dig deeper -> Option C
  4. Quick Check:

    Root cause analysis starts with asking 'Why?' [OK]
Hint: Start root cause analysis by asking 'Why?' [OK]
Common Mistakes:
  • Trying to fix before understanding the cause
  • Ignoring rare problems without analysis
  • Confusing test writing with root cause steps
3. Consider this scenario: A test fails because the login button does not respond. After investigation, you find the button's click event is not bound due to a missing script file. What is the root cause?
medium
A. The script file is missing, so click event is not bound
B. The login button is not visible
C. The test case is incorrect
D. The server is down

Solution

  1. Step 1: Analyze the failure reason

    The test fails because the login button does not respond to clicks.
  2. Step 2: Identify the root cause

    The missing script file causes the click event not to bind, which is the main reason for failure.
  3. Final Answer:

    The script file is missing, so click event is not bound -> Option A
  4. Quick Check:

    Missing script file = root cause [OK]
Hint: Root cause is the missing script causing failure [OK]
Common Mistakes:
  • Blaming the test case instead of the cause
  • Assuming UI visibility is the problem
  • Incorrectly blaming server downtime
4. You have a failing test due to a timeout error. You suspect the root cause is a slow database query. Which debugging step will best confirm this?
medium
A. Ignore the timeout and rerun the test
B. Check the test script syntax
C. Restart the test environment
D. Run the database query separately and measure time

Solution

  1. Step 1: Identify the suspected root cause

    The slow database query is suspected to cause the timeout.
  2. Step 2: Choose the debugging action to confirm

    Running the query separately and measuring its time will confirm if it is slow.
  3. Final Answer:

    Run the database query separately and measure time -> Option D
  4. Quick Check:

    Measure suspected cause to confirm root cause [OK]
Hint: Test suspected cause directly to confirm [OK]
Common Mistakes:
  • Checking unrelated test script syntax
  • Restarting environment without analysis
  • Ignoring the error and rerunning blindly
5. A web app test fails intermittently due to a 'null reference' error. After root cause analysis, you find the error happens only when the user profile data is missing. How should you fix this to prevent future failures?
hard
A. Increase test timeout to avoid failure
B. Add a check in code to handle missing profile data gracefully
C. Remove the user profile feature entirely
D. Ignore the error since it happens rarely

Solution

  1. Step 1: Understand the root cause

    The null reference error occurs because the code does not handle missing user profile data.
  2. Step 2: Choose the fix to prevent recurrence

    Adding a code check to handle missing data gracefully will stop the error from happening again.
  3. Final Answer:

    Add a check in code to handle missing profile data gracefully -> Option B
  4. Quick Check:

    Fix root cause by handling missing data [OK]
Hint: Fix root cause by coding safe checks [OK]
Common Mistakes:
  • Ignoring rare errors instead of fixing
  • Removing features unnecessarily
  • Changing unrelated test settings
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard