A Practical Guide for QA Engineers Transitioning in the Era of Large AI Models

    This article explores how QA engineers can leverage large language models (LLMs) to streamline testing workflows, including automated test case generation, script construction, and workflow automation. It provides actionable prompt templates, coding examples, and insights into the evolving skill sets required for QA professionals in the AI era.

    Introduction: Why QA Engineers Need to Learn to Use LLMs

    Software testing workload increases with version iterations and business complexity. Repetitive tasks like writing test cases, maintaining scripts, and compiling reports consume a significant amount of time. Large language models (LLMs) can take over some of this mechanical labor, but they cannot replace a QA engineer’s judgment on business risks. This article focuses on the actual work of QA engineers, introducing several practical use cases, boundaries to be aware of, and the direction of capability evolution.

    How to Write Prompts for Automated Test Case Generation

    Before generating test cases, clarify the input materials. A usable prompt usually contains four parts: the scope of the object under test, known business rules, output format, and risks to focus on.

    Here is a reusable template:

    Role: You are a software testing engineer with five years of experience.
    Object under test: [Fill in the functional module name and page scope]
    Business rules: [List key rules, such as password length, verification code validity period, duplicate registration handling]
    Output requirements: Output in a table format, with columns including Case ID, Preconditions, Test Steps, Expected Results, Priority, Case Type.
    Coverage types: Functional, UI, Exception, Boundary, Security.
    Constraints: Do not fabricate features not in the requirements. List uncertain rules separately and mark them as “To be confirmed”.

    Test Case Generation Based on Multimodal Input

    Modern LLMs usually possess multimodal understanding capabilities. When testing web or mobile features, you can upload screenshots of login or registration pages to the model along with the prompt above. The model can identify input fields, buttons, links, and output structured test cases, thereby reducing preparation time.

    Before uploading screenshots, handle privacy issues. Screenshots may contain real phone numbers, emails, order information, or internal system addresses. Desensitize them first or use test environment data. Whether screenshots can be sent to external models should depend on the company’s data security policies. Model-generated test cases still require manual review, especially to verify if the expected results align with product requirements.

    Scenario Decomposition for Complex Business Logic

    For complex systems, asking the model to generate all test cases at once often yields generic results lacking depth. A better approach is divide and conquer. Take an e-commerce customer service system as an example; scenarios can be split by time period, user status, or business module, focusing on one scenario at a time.

    For instance, you can ask separately: “During daytime peak hours, users initiate return and exchange inquiries simultaneously. Please list test cases for concurrent scenarios, focusing on duplicate submissions, queue timeouts, and data consistency.” Or “During nighttime maintenance windows, users submit refund requests. Please list exception tolerance test cases, focusing on task interruptions, retry mechanisms, and user prompt copy.”

    After splitting, the output for each scenario is more specific and makes it easier to mine edge paths. Teams can use the following checklist to confirm coverage:

    • Whether the scenario covers normal, exception, and boundary paths
    • Whether each test case has a clear expected result
    • Whether test cases involving concurrency, timeouts, and retries specify environment requirements
    • Whether the paths proposed by the model are based on requirements or historical defects

    Efficient Construction of Automated Test Scripts

    Writing and maintaining automation scripts is time-consuming and tedious. Combining LLMs with Integrated Development Environments (IDEs) can reduce much repetitive work.

    Integration with IDE Embedded AI Assistants

    Most mainstream IDEs support integrating AI coding assistants. Engineers can invoke the model directly within the code editor without switching between multiple tools. This approach is suitable for writing API tests, monitoring scripts, and test data preparation scripts.

    Precise Code Generation with Specified Languages and Frameworks

    When requesting a script, specify the language, framework, dependencies, and comment requirements. For example:

    Please use the Go language and the testing framework to write a test that monitors API response time. Use the standard library net/http, set the request timeout, and add comments in the code to explain the basis for the threshold setting.

    The model can generate sample code like the following:

    1. package monitor_test
    2. import (
    3. "net/http"
    4. "testing"
    5. "time"
    6. )
    7. // The response time threshold should be set based on the interface's SLA or historical performance baseline; this is just an example
    8. const responseTimeThreshold = 500 * time.Millisecond
    9. func TestResponseTime(t *testing.T) {
    10. url := "https://example.com/api/v1/status" // Example URL, please replace with the API under test
    11. client := &http.Client{Timeout: 3 * time.Second} // Set timeout to prevent requests from hanging indefinitely
    12. start := time.Now()
    13. resp, err := client.Get(url)
    14. if err != nil {
    15. t.Fatalf("API request failed: %v", err)
    16. }
    17. defer resp.Body.Close()
    18. elapsed := time.Since(start)
    19. if resp.StatusCode != http.StatusOK {
    20. t.Errorf("Abnormal status code: %d", resp.StatusCode)
    21. }
    22. if elapsed > responseTimeThreshold {
    23. t.Errorf("Response time too long: %v, exceeds threshold: %v", elapsed, responseTimeThreshold)
    24. }
    25. }

    This code requires manual verification in three places. First, http.Client sets a timeout to prevent requests from hanging when the API does not respond. Second, the threshold is defined in a constant; the actual value should come from the API’s Service Level Agreement (SLA) or historical performance baseline, not be set arbitrarily. Third, the example URL needs to be replaced with the real API under test.

    AI can quickly produce a draft, but it still requires manual review, debugging, and additional assertions. For example, the sample only checks the status code and elapsed time, and does not validate the returned data structure. This part needs to be supplemented by the engineer based on the API documentation.

    Leveraging AI Reversely to Broaden Testing Boundaries

    Faced with concerns about “will AI take away testing jobs,” a pragmatic approach is to proactively integrate LLMs into daily workflows. Treat it as an analytical tool and auxiliary means, without expecting it to do all the work.

    Intelligent Assistance for Black-Box and White-Box Testing

    In black-box testing, you can have the model analyze requirement documents, extract boundary values and equivalence classes, or ask it to list security testing ideas from a malicious user’s perspective for brainstorming. The model outputs candidate ideas; security testing should still be executed in accordance with the company’s security standards.

    In white-box testing, you can feed core code snippets to the model and ask it to point out suspicious resource management issues, null pointer risks, or missing logical branches. For memory or resource-related suspicions, static analysis tools and runtime detection should be used for verification; do not rely solely on the model’s judgment.

    Workflow Automation

    Stages like test data generation, test report summarization, and defect ticket consolidation are suitable for introducing LLMs. For example, the model can organize reproduction steps based on defect descriptions or categorize failure reasons from a testing round.

    The model can also assist in narrowing down the scope of code commit investigations. Engineers can provide the defect description, error logs, and recent change records to the model together, asking it to list suspicious commits. This only narrows the scope; final localization still requires manual confirmation combined with logs and version records.

    The extent of efficiency improvement depends on the team’s processes and tool maturity. It is recommended to pilot one or two repetitive stages first, recording the time spent, number of test cases, and defects found before and after, to use data to determine whether it is worth scaling up, rather than relying on a single impression or promotional numbers.

    Role Evolution: QA Skill Structure in the AI Era

    AI has not caused QA engineers to lose job opportunities, but job requirements are changing. Mainstream global tech companies and large enterprises are laying out LLM applications, and the market demand for testing talent who can understand and utilize AI tools is increasing.

    New role directions include “AI Test Coach” and “Quality Insight Analyst.” The former is responsible for guiding the team on how to apply AI tools in testing processes and formulating usage guidelines. The latter uses AI to analyze massive testing data and production data to provide recommendations for quality improvement.

    These roles typically require the following capabilities:

    • Business understanding: Ability to judge which risks truly affect users and revenue
    • Programming skills: Ability to read and write scripts, and understand data processing methods in languages like Python
    • AI application skills: Ability to design prompts and judge whether the model’s output is trustworthy
    • Quality judgment: Ability to review AI-generated results and take responsibility for the final conclusion

    A QA engineer does not need to be proficient in all directions simultaneously. A more realistic path is to deepen one capability first and gradually fill in others.

    Risks and Boundaries

    When using LLMs, note three types of risks. First is data leakage; screenshots, logs, and source code may contain sensitive information. Second is erroneous output. The model may