0
0
Agentic AIml~20 mins

Regression testing for agent changes in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Regression Testing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why is regression testing important after updating an AI agent?

Imagine you have an AI agent that helps users book flights. You update its code to improve speed. Why should you run regression tests after this update?

ATo add new features to the agent
BTo check if the update accidentally broke existing features
CTo improve the agent's speed further
DTo delete old data from the system
Attempts:
2 left
💡 Hint

Think about what might happen to old features when you change something new.

Predict Output
intermediate
2:00remaining
Output of regression test result summary

Given this Python code simulating regression test results for an AI agent update, what will be printed?

Agentic AI
test_results = {'login': True, 'search': True, 'booking': False, 'payment': True}
failed_tests = [k for k, v in test_results.items() if not v]
print(f"Failed tests: {failed_tests}")
AFailed tests: ['login', 'search']
BFailed tests: ['payment']
CFailed tests: []
DFailed tests: ['booking']
Attempts:
2 left
💡 Hint

Look for tests with value False in the dictionary.

Model Choice
advanced
2:00remaining
Choosing a model for regression testing of agent behavior

You want to predict if an AI agent update will cause failures in certain tasks based on past update data. Which model is best suited for this binary classification problem?

ALinear Regression
BK-Means Clustering
CLogistic Regression
DPrincipal Component Analysis (PCA)
Attempts:
2 left
💡 Hint

Think about models that predict categories like pass/fail.

Metrics
advanced
2:00remaining
Interpreting regression test classification metrics

An AI agent regression test classifier has these results: 90 true positives, 10 false positives, 5 false negatives, and 95 true negatives. What is the precision of the classifier?

A90 / (90 + 10) = 0.9
B90 / (90 + 5) = 0.947
C95 / (95 + 10) = 0.905
D90 / (90 + 95) = 0.486
Attempts:
2 left
💡 Hint

Precision = True Positives / (True Positives + False Positives)

🔧 Debug
expert
3:00remaining
Debugging a failing regression test script for agent changes

Consider this Python code snippet that runs regression tests on an AI agent's functions. It should print 'All tests passed' if all tests return True, else print failed test names. What error or output will this code produce?

Agentic AI
def test_login():
    return True

def test_search():
    return False

tests = {'login': test_login, 'search': test_search}

failed = []
for name, func in tests.items():
    if func() == False:
        failed.append(name)

if failed:
    print('Failed tests:', failed)
else:
    print('All tests passed')
AFailed tests: ['search']
BAll tests passed
CTypeError because func() is not callable
DSyntaxError due to missing colon
Attempts:
2 left
💡 Hint

Check which test returns False and how the code collects failures.