Inferensys

Prompt

Defect Reproduction Automation Feasibility Assessment Prompt

A practical prompt playbook for using Defect Reproduction Automation Feasibility Assessment Prompt in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Defect Reproduction Automation Feasibility Assessment Prompt.

This prompt is for SDETs and automation engineers who need to decide whether a manual defect reproduction procedure is worth automating. The job-to-be-done is a structured feasibility assessment that produces a clear recommendation, not just a yes/no answer. The ideal user has access to the manual reproduction steps, knowledge of the target automation framework (Playwright, Selenium, Cypress), and understanding of the application's UI architecture. The prompt expects you to provide the manual reproduction steps, known environment details, and any prior automation context for the affected feature area.

Use this prompt when the cost of repeated manual reproduction justifies an automation investment decision. It works best for UI-driven defects where selectors, wait conditions, and state transitions are the primary automation concerns. The prompt is also appropriate when you need to justify automation ROI to stakeholders or when you're prioritizing a backlog of manual test cases for automation. It produces a feasibility score, selector stability assessment, automation approach recommendation, estimated effort in hours, and maintenance risk flags—all of which feed directly into sprint planning and automation roadmap decisions.

Do not use this prompt for defects that are purely backend, API-level, or data-state issues where UI automation adds no value. It is not designed for performance or load-related defects, security vulnerabilities requiring specialized tooling, or defects where the reproduction steps are still ambiguous. If the manual reproduction steps are incomplete or the defect is not reliably reproducible, resolve those gaps first using a defect structuring prompt before assessing automation feasibility. The prompt assumes you have a stable manual reproduction procedure as input; garbage in will produce an unreliable feasibility score out.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use these cards to quickly assess whether the Defect Reproduction Automation Feasibility Assessment Prompt fits your current triage or automation planning workflow.

01

Good Fit: Stable UI with Deterministic Steps

Use when: The manual reproduction steps are linear, repeatable, and target a stable UI with reliable selectors. Why it works: The prompt can assess selector stability and script generation effort with high confidence, producing an accurate feasibility score and low maintenance risk flag.

02

Bad Fit: Exploratory or Unscripted Bugs

Avoid when: The defect report lacks concrete steps or describes exploratory findings without a clear sequence. Risk: The model will hallucinate steps or produce a misleadingly high feasibility score based on imagined workflows. Escalate to a human SDET for test charter creation instead.

03

Required Inputs: Structured Defect Record

Guardrail: This prompt requires a pre-structured defect record with explicit steps, environment details, and observed behavior. What to watch: Feeding raw user complaints or unstructured logs will produce unreliable assessments. Use a defect structuring prompt first to normalize the input before assessing automation feasibility.

04

Operational Risk: Selector Fragility

Risk: The prompt may underestimate maintenance effort for applications with dynamic, auto-generated, or framework-specific selectors. Guardrail: Always require the output to include a selector stability assessment with explicit fallback strategies. Flag any score above 7/10 for human review if the application stack is known for frequent UI changes.

05

Operational Risk: ROI Overestimation

Risk: The model may overvalue one-time automation savings against ongoing maintenance costs, especially for low-frequency defects. Guardrail: Ensure the prompt output includes an estimated effort-to-recurrence ratio. Reject automation recommendations where maintenance cost exceeds manual reproduction cost over the expected lifecycle of the feature.

06

Operational Risk: Environment Parity Gaps

Risk: The assessment may assume environment consistency between manual and automated execution, missing staging or data-seeding gaps. Guardrail: Require the output to list explicit environment dependencies and flag any that cannot be automated. If critical dependencies are missing, cap the feasibility score and recommend environment setup before automation.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt with square-bracket placeholders for assessing the feasibility of automating a manual defect reproduction.

This prompt template is the core of the feasibility assessment workflow. It is designed to receive a structured defect record and return a detailed automation feasibility analysis. The template uses square-bracket placeholders to enforce a strict contract between the application layer and the model. You must populate these placeholders with real data before sending the prompt to the model. The most critical inputs are the reproduction steps, the target application's technology stack, and the automation framework you intend to use.

text
You are an SDET Architect evaluating the feasibility of automating a manual defect reproduction. Your analysis must be data-driven, focusing on selector stability, step complexity, and maintenance risk. Do not recommend automation if the cost of maintenance outweighs the value of automated regression coverage.

## DEFECT RECORD
[STRUCTURED_DEFECT_RECORD]

## TARGET CONTEXT
- Application URL: [APPLICATION_URL]
- Technology Stack: [TECH_STACK]
- Target Automation Framework: [AUTOMATION_FRAMEWORK]
- Existing Test Infrastructure Notes: [EXISTING_INFRA_NOTES]

## OUTPUT SCHEMA
You must respond with a single JSON object conforming to this exact structure. Do not include any text outside the JSON object.
{
  "feasibility_score": <number 0-100, where 100 is trivially automatable>,
  "recommendation": "<Automate | Conditionally Automate | Do Not Automate>",
  "selector_stability_assessment": {
    "score": <number 0-100>,
    "fragile_selectors": ["<list of unstable selectors>"],
    "recommended_selectors": ["<list of robust alternative selectors>"]
  },
  "step_automation_complexity": [
    {
      "step_number": <integer>,
      "original_step": "<text>",
      "automation_approach": "<description of how to automate>",
      "risk": "<Low | Medium | High>",
      "risk_rationale": "<explanation>"
    }
  ],
  "estimated_effort_hours": <number>,
  "maintenance_risk_flags": ["<list of factors that will cause this test to break often>"],
  "roi_justification": "<concise justification for the recommendation>"
}

## CONSTRAINTS
- Base your assessment strictly on the provided defect record and target context.
- If the defect record lacks clear reproduction steps, the feasibility_score must be 0 and the recommendation must be "Do Not Automate".
- Flag any step that requires a human visual check (e.g., "check if the color is slightly off") as High risk.
- If the target application uses a dynamic UI framework (e.g., React, Angular), assume selectors are fragile unless data-testid attributes are confirmed to be present.
- The estimated_effort_hours must account for script development, debugging, and integration into the existing test suite.

To adapt this template, start by replacing the placeholders in the TARGET CONTEXT section. The [TECH_STACK] placeholder should be a concise string like "React 18, Next.js, Tailwind CSS" to guide selector strategy. The [AUTOMATION_FRAMEWORK] placeholder should specify the exact tool, such as "Playwright (TypeScript)" or "Selenium 4 (Java)", as this dictates the syntax of the automation_approach in the output. The most critical adaptation is populating [STRUCTURED_DEFECT_RECORD] with a complete, machine-readable defect object, not just a block of text. A well-structured input might look like: {"id": "BUG-101", "title": "...", "steps": [{"action": "...", "expected": "...", "actual": "..."}], "environment": "..."}. This structured input is essential for the model to accurately parse steps and assess complexity.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the defect reproduction automation feasibility assessment prompt needs to produce a reliable feasibility score, approach recommendation, and effort estimate. Validate each input before calling the model.

PlaceholderPurposeExampleValidation Notes

[DEFECT_RECORD]

Complete structured defect with reproduction steps, observed vs expected behavior, environment details, and attachments summary

{"defect_id": "BUG-1423", "title": "Checkout button unresponsive on Safari iOS", "reproduction_steps": ["1. Add item to cart", "2. Tap Checkout", "3. Observe no navigation"], "environment": {"browser": "Safari", "os": "iOS 17.2", "device": "iPhone 15"}, "attachments": ["screenshot_tap_area.png", "console_log.txt"]}

Must contain at minimum: reproduction_steps array with at least one step, environment object with browser or os, and observed_behavior field. Reject if steps are null or empty.

[AUTOMATION_FRAMEWORK]

Target test automation framework for feasibility assessment

playwright

Must be one of: playwright, selenium, cypress, webdriverio, puppeteer, appium, xctest, espresso, or custom. Reject unknown values and request clarification.

[APPLICATION_UNDER_TEST]

Description of the application including type, platform, and key architectural details relevant to automation

{"type": "web", "platform": "iOS Safari", "frontend": "React 18", "auth": "OAuth2 with MFA", "third_party_components": ["Stripe Elements", "Google Maps"]}

Must include type field (web, mobile, desktop, api, hybrid). Third-party components and auth mechanism are critical for selector stability assessment. Reject if type is missing.

[TEST_ENVIRONMENT_ACCESS]

Details about test environment availability, data setup requirements, and access constraints

{"environment_type": "staging", "data_required": ["test user with saved payment method", "item in cart state"], "access_constraints": ["VPN required", "MFA code needed"], "api_available": true}

Must indicate whether API seeding is available for state setup. Access constraints directly impact automation feasibility score. Flag if data_required is empty and state setup is complex.

[EXISTING_AUTOMATION_SUITE]

Reference to existing test automation codebase, patterns, utilities, and selector conventions already in use

{"framework": "playwright", "page_objects": true, "selector_strategy": "data-testid with text fallback", "custom_utilities": ["login helper", "cart state manager"], "ci_integration": "GitHub Actions"}

If null, prompt must assess greenfield automation cost. If provided, prompt must evaluate reuse potential. Validate that framework matches [AUTOMATION_FRAMEWORK] or flag mismatch.

[CONSTRAINTS]

Specific constraints that limit automation approach, including time budget, flakiness tolerance, and maintenance expectations

{"max_automation_time_hours": 8, "flakiness_tolerance": "low", "must_run_in_ci": true, "maintenance_window": "monthly", "selector_stability_requirement": "high"}

Must include max_automation_time_hours or effort_tolerance field. Flakiness tolerance drives selector strategy recommendation. Reject if constraints are empty or undefined.

[PREVIOUS_AUTOMATION_ATTEMPTS]

History of prior automation attempts for this defect or similar defects, including failure reasons

{"attempted": true, "attempts": [{"date": "2024-11-15", "approach": "Playwright click on checkout button", "failure_reason": "Button selector not consistently found due to dynamic aria-label regeneration", "time_spent_hours": 3}]}

If attempted is true, prompt must analyze prior failure reasons and adjust feasibility score downward unless new approach is viable. Null is acceptable for first-time assessment. Validate that failure_reason is present if attempted is true.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the feasibility assessment prompt into a QA automation pipeline with validation, routing, and human review gates.

This prompt is designed to be called programmatically as part of a defect triage or automation planning workflow. The primary integration point is after a manual reproduction procedure has been documented and before an automation engineer commits to scripting it. The prompt expects a structured defect record with reproduction steps, environment details, and selector information as input. In a typical pipeline, a ticketing system webhook or a test management tool trigger fires when a defect is marked 'Candidate for Automation,' sending the defect payload to an orchestration layer that calls the LLM with this prompt template.

The implementation should include a pre-validation step that checks the input defect record for required fields before calling the model. Missing reproduction steps, absent environment details, or empty selector fields should cause the request to be rejected early with a clear error message rather than producing a low-confidence feasibility assessment. After the model responds, a post-validation layer must parse the JSON output and verify that the feasibility_score is a number between 0 and 1, that automation_approach is one of the expected enum values, and that estimated_effort_hours is a positive number. If the output fails schema validation, retry once with a repair prompt that includes the validation error. If the retry also fails, route the defect to a human reviewer queue with the raw model output attached. For model choice, a capable mid-tier model like claude-3-5-sonnet or gpt-4o is appropriate; this task requires structured reasoning about testability but not the largest available context window.

Logging and observability are critical because this prompt influences resource allocation decisions. Log the input defect ID, the model's feasibility score, the automation approach recommendation, and the selector stability assessment to your observability platform. Track the maintenance_risk_flags array over time to identify patterns—if the model consistently flags CSS class-based selectors as high-risk, that signal should feed back into your selector strategy. For human review gates, route any assessment with a feasibility score between 0.4 and 0.6 to an SDET for manual judgment. Assessments with maintenance_risk_flags containing 'high' severity items should also trigger review, even if the feasibility score is above 0.7. The ROI justification field should be surfaced in your automation planning dashboard alongside the estimated effort so that prioritization decisions are evidence-backed. Do not use this prompt for security-sensitive defects where reproduction details should not leave your environment; those require an air-gapped or local model deployment.

IMPLEMENTATION TABLE

Expected Output Contract

Validate the structured JSON output from the feasibility assessment prompt. Each field must pass the specified validation rule before the result is accepted into an automation pipeline or triage queue.

Field or ElementType or FormatRequiredValidation Rule

feasibility_score

integer (0-100)

Must be an integer between 0 and 100 inclusive. Reject if float, string, or out of range.

automation_approach

enum string

Must match one of: 'FULL_AUTOMATION', 'PARTIAL_AUTOMATION', 'MANUAL_ONLY'. Reject unknown values.

estimated_effort_hours

number

Must be a positive number. Null allowed if approach is MANUAL_ONLY. Reject negative values.

selector_stability_assessment

object

Must contain 'overall_risk' (enum: LOW, MEDIUM, HIGH) and 'fragile_selectors' (array of strings). Reject if overall_risk is missing.

roi_justification

string

Must be a non-empty string with minimum 50 characters. Reject if empty or below minimum length.

maintenance_risk_flags

array of strings

Must be an array. Each element must be a non-empty string. Empty array is valid. Reject if not an array.

recommended_framework

string or null

If present, must be a non-empty string. Null is valid. Reject if empty string is provided.

confidence_score

number (0.0-1.0)

Must be a float between 0.0 and 1.0 inclusive. Reject if integer, string, or out of range.

PRACTICAL GUARDRAILS

Common Failure Modes

When assessing defect reproduction automation feasibility, these failure modes surface most often in production. Each card identifies a specific breakdown and a concrete guardrail to prevent it.

01

Overestimating Selector Stability

What to watch: The model assumes selectors are stable because they work once, ignoring dynamic IDs, framework-generated classes, or A/B test variants. The feasibility score comes back high, but the script breaks on the next deployment. Guardrail: Require the prompt to inspect actual DOM snapshots or page-object definitions. Add a selector volatility check that flags auto-generated attributes and demands fallback strategies before approving feasibility.

02

Ignoring Asynchronous State Dependencies

What to watch: The assessment treats the defect as a linear sequence of clicks, missing race conditions, loading spinners, debounced inputs, or WebSocket-driven UI updates. The reproduction script passes in slow environments but flakes in CI. Guardrail: Include explicit async-state probes in the feasibility template. Require the model to identify every point where the UI state depends on network completion, then flag any step lacking a deterministic wait condition.

03

Confusing Manual Reproduction with Automation Feasibility

What to watch: The model conflates 'a human can reproduce this' with 'a script can reproduce this reliably.' It ignores environmental variability, authentication state, test data lifecycle, and cross-browser differences. Guardrail: Add a mandatory 'automation-specific blockers' section to the output schema. Force the model to list every factor that differs between a human following steps and a headless script executing them, then downgrade the feasibility score for each unresolved blocker.

04

Underestimating Maintenance Cost

What to watch: The feasibility assessment focuses on initial script creation effort while ignoring long-term maintenance. Selectors that work today break during the next UI refactor, turning a 'quick win' into a maintenance sink. Guardrail: Require the output to include a maintenance risk score separate from the implementation effort score. Flag any step that depends on CSS classes, XPath indices, or text content that is likely to change. Recommend abstraction layers for high-risk selectors.

05

Hallucinating Environment Parity

What to watch: The model assumes the test environment matches production without verifying. It generates a feasibility score based on idealized conditions, ignoring missing services, mocked dependencies, or data-seeding gaps that block actual execution. Guardrail: Add an environment-gap checklist to the prompt output. Require the model to enumerate every service, credential, and data dependency the reproduction needs, then flag any that are not confirmed available in the automation environment.

06

Missing the Flakiness Multiplier

What to watch: The assessment treats a defect as deterministic when the original report describes intermittent behavior. The automation script passes once, gets committed, and then fails unpredictably in CI, eroding trust in the test suite. Guardrail: Require the prompt to extract the reproduction rate from the defect report. If the rate is below 100%, cap the feasibility score and mandate a retry-and-log strategy. Flag the automation as 'observation-only' until the root cause is understood.

IMPLEMENTATION TABLE

Evaluation Rubric

Use these criteria to evaluate the quality of the Defect Reproduction Automation Feasibility Assessment Prompt output before integrating it into your triage or automation planning workflow.

CriterionPass StandardFailure SignalTest Method

Feasibility Score Justification

Score is accompanied by at least 3 specific, evidence-backed reasons referencing the defect's characteristics.

Score is presented without rationale, or rationale is generic (e.g., 'it looks automatable').

Manual review: Check for a list of specific reasons tied to the defect's steps, environment, or selectors.

Automation Approach Recommendation

Recommendation specifies a concrete framework (e.g., Playwright, Selenium) and a high-level strategy (e.g., API mocking, UI interaction).

Recommendation is vague (e.g., 'use a testing tool') or missing entirely.

Schema check: Verify [AUTOMATION_APPROACH] field is populated with a non-empty string containing a recognized framework name.

Selector Stability Assessment

Identifies at least 2 specific UI elements from the reproduction steps and rates their stability (e.g., stable, fragile) with reasoning.

Fails to mention any UI elements or provides stability ratings without justification.

Parse check: Confirm [SELECTOR_STABILITY] array contains objects with 'element', 'stability_rating', and 'justification' fields.

Effort Estimation

Provides an estimated effort range in hours/days and breaks it down into major phases (e.g., script development, selector hardening, validation).

Provides a single number without breakdown or context, or the estimate is absurdly low/high without justification.

Schema check: Verify [EFFORT_ESTIMATE] object contains 'total_hours' and 'breakdown' fields with non-null values.

ROI Justification

Compares estimated automation effort against the cost of repeated manual reproduction, including frequency of occurrence.

ROI is stated as a boolean or a simple 'high/medium/low' without any quantitative or qualitative comparison.

Manual review: Check for a statement that links effort, defect frequency, and manual effort cost.

Maintenance Risk Flags

Identifies at least 2 specific risks (e.g., rapidly changing UI, third-party dependency, non-deterministic timing) that could cause script failures.

Lists only generic risks (e.g., 'application changes') or fails to identify any risks.

Parse check: Confirm [MAINTENANCE_RISKS] array is populated with strings that are specific to the defect context.

Assumption Transparency

Explicitly lists any assumptions made about the test environment, access, or defect reproducibility when information was missing.

Makes definitive statements without qualifying missing information, leading to an overconfident feasibility score.

Manual review: Check for an [ASSUMPTIONS] section that is populated when the input defect report lacks key details.

Output Format Adherence

The entire response is a valid JSON object that strictly conforms to the defined [OUTPUT_SCHEMA].

Response is plain text, contains markdown fences, or is missing required top-level fields.

Automated test: Parse the response with a JSON validator and check for the presence of all required schema fields.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model and manual review of outputs. Remove strict JSON schema enforcement initially; accept markdown-structured feasibility reports. Focus on getting useful feasibility scores and approach recommendations before investing in automation infrastructure.

Simplify the [OUTPUT_SCHEMA] to a free-text assessment with labeled sections instead of strict JSON fields. Drop the ROI calculation section if you lack historical automation cost data.

Watch for

  • Overly optimistic feasibility scores when the model lacks access to the actual application DOM or test environment
  • Selector stability assessments made without seeing real selectors—the model will guess based on description alone
  • Missing distinction between "technically automatable" and "worth automating" without ROI guardrails
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.