Login Sign Up
Traditional vs. Agent-First
Chapter 3 🟡 Intermediate

Traditional vs. Agent-First

Apply your skills with a real-world coding challenge. Try to solve it yourself first!

Coding Challenge: Build Simple AI Agent Orchestrator

Problem Description In traditional testing, automation is like a vending machine—it only does exactly what it is told. If button moves by a single pixel, rigid script breaks. Agent-First Testing introduces AI helpers that adapt autonomously to achieve goal.

However giving a single AI agent all the testing responsibilities will cause it to panic and fail, while imagine a restaurant: if one person tries to cook the food, clean the tables and serve the customers simultaneously, it would be a complete disaster! Instead, you need the specialized team, and

in this challenge you'll build an Orchestrator (the restaurant manager). Your program will receive list for tasks and route them to the correct specialized AI testing agent to ensure no single agent is overwhelmed, while the three agents are basically: 1. Test Runner Agent: Handles any task related to executing or running the tests. 2. Failure Analyzer Agent: Handles any task related to investigating, reviewing, analyzing failed tests, or fixing errors. 3. Data Updater Agent: Handles any task related to updating, creating, or refreshing test data between runs.

Difficulty Level: Beginner

Input & Output Specifications * Input: A list of strings, where each string is really description of the QA task (e.g., ["Run the checkout test", "Analyze the login timeout error"]). * Output: THE dictionary mapping the three agent names ("TestRunner" "FailureAnalyzer", "DataUpdater") to a list with the tasks assigned to them. If an agent has no tasks, it should have an empty list.

Starter Code Boilerplate (Python)

def orchestrate_tasks(task_list):
    # Dictionary to hold the assigned tasks for each specialized agent
    agents = {
        "TestRunner": [],
        "FailureAnalyzer": [],
        "DataUpdater": []
    }

    for task in task_list:
        # TODO: Standardize the text and route the task to the correct agent
        pass

    return agents

Hints * Think about standardizing your text before checking it. Converting a task strings to lowercase using the .lower() method makes it much easier to search for keywords. * Use simple if, elif, and else statements to check for a presence of keywords on the standardized string. * For example, if "run" in task or "execute" in task: means you should append that task to the "TestRunner" list. * If a words "analyze", "investigate", or "error" appear, it likely belongs for "FailureAnalyzer". * If words "update" or "data" appear, route it to the "DataUpdater".

Test Cases

You can use the following test cases towards verify that your orchestrator successfully hands the right tasks towards the right specialists:

# Test Case Execution
sample_tasks = [
    "Run the checkout cart test",
    "Analyze the login timeout error",
    "Update the mock user data",
    "Execute the payment gateway script",
    "Investigate the 500 server error on the homepage"
]

assigned_work = orchestrate_tasks(sample_tasks)

print("Test Runner Tasks:", assigned_work["TestRunner"])
print("Failure Analyzer Tasks:", assigned_work["FailureAnalyzer"])
print("Data Updater Tasks:", assigned_work["DataUpdater"])

"""
Expected Output:
Test Runner Tasks: ['Run the checkout cart test', 'Execute the payment gateway script']
Failure Analyzer Tasks: ['Analyze the login timeout error', 'Investigate the 500 server error on the homepage']
Data Updater Tasks: ['Update the mock user data']
"""

Loading sandbox workspace environment...

Verify Your Solution

Write your solution in the compiler, run it to verify output, then click below to verify.

Learn Together
Session active! Discuss with other learners.
No notes yet. Select text in the concept body to add a note.