CT-GenAI Sample Questions

CT-GenAI Sample Questions & Answers

Prompt engineering for test tasks, from developing to refining and evaluating prompts, dominates, ahead of core generative AI foundations, managing risks like hallucinations and bias, LLM-powered test infrastructure, and rolling generative AI out across a test team.

Launch the full CT-GenAI simulator →

Showing 10 of 20 free samples.

  1. Question 1Intermediate

    Introduction to Generative AI for Software Testing · Generative AI Foundations and Key Concepts

    Which of the following best describes 'Instruction-Tuned' models compared to 'Foundation' models in the context of software testing?

    Show answer & explanation

    Correct answer: D

    Foundation models predict the next token based on vast internet data. Instruction-tuned models undergo further training (RLHF or supervised fine-tuning) specifically to learn how to follow user instructions (e.g., 'Act as a QA engineer'), making them superior for testing tasks.

  2. Question 2Beginner

    Prompt Engineering for Effective Software Testing · Effective Prompt Development

    A test analyst is crafting a prompt to generate Gherkin scenarios. They explicitly state: "You are a Senior QA Automation Engineer with 10 years of experience in E-commerce." Which component of a structured prompt does this sentence represent?

    Show answer & explanation

    Correct answer: C

    This component assigns a specific Role or Persona to the AI. This helps align the tone, vocabulary, and perspective of the output with what is expected from that specific professional profile.

  3. Question 3Beginner

    Prompt Engineering for Effective Software Testing · Effective Prompt Development

    You are tasked with using an LLM to generate test cases for a login feature. You initially send a prompt: "Write test cases for login." The output is generic and unusable. You then refine the prompt to include the specific requirements: "The login accepts email and password. Password must be 8 chars. Lockout after 3 attempts." Which prompt engineering principle are you applying to improve the result?

    Show answer & explanation

    Correct answer: D

    Adding specific details about the system under test (SUT) provides 'Context'. Without context, the LLM hallucinates generic features. Providing the business rules allows the model to generate relevant test conditions.

  4. Question 4Intermediate

    Prompt Engineering for Effective Software Testing · Applying Prompt Engineering Techniques to Software Test Tasks

    A tester wants to generate equivalence partition test data for a purely mathematical function. They provide the LLM with the function logic and then ask for the test data immediately, but the model makes calculation errors. Which prompting technique involves asking the model to "Think step-by-step" to improve logical accuracy?

    Show answer & explanation

    Correct answer: C

    Chain-of-Thought prompting encourages the LLM to articulate its reasoning process ('step-by-step') before giving the final answer. This significantly improves performance on logic, math, and reasoning tasks by allowing the model to correct its internal state.

  5. Question 5Intermediate

    Prompt Engineering for Effective Software Testing · Effective Prompt Development

    You need to generate test cases that strictly follow a specific JSON format for your test management tool. You provide three complete examples of the input requirement and the corresponding JSON output in your prompt. What technique are you utilizing?

    Show answer & explanation

    Correct answer: C

    Few-Shot prompting involves providing specific examples (shots) of the desired input-output pairs within the prompt to guide the model's behavior and formatting. This is highly effective for enforcing structured outputs like JSON.

  6. Question 6Advanced

    Prompt Engineering for Effective Software Testing · Effective Prompt Development

    In an automated test generation workflow, a 'Prompt Chaining' approach is being used. What is the primary advantage of this technique over a single massive prompt?

    Show answer & explanation

    Correct answer: A

    Prompt Chaining breaks complex tasks into sequential steps. A key benefit is the ability to programmatically validate or format the intermediate outputs, ensuring that errors in early steps (like hallucinated requirements) are caught before they generate downstream artifacts (like code).

  7. Question 7Beginner

    Prompt Engineering for Effective Software Testing · Effective Prompt Development

    A prompt contains the following section:
    """ Code: function add(a, b) { return a + b; } """ Instruction: Write unit tests for the code above.

    What is the specific purpose of the triple quotes (""") in this prompt design?

    Show answer & explanation

    Correct answer: C

    Delimiters (like triple quotes, XML tags, or dashes) help the LLM distinguish between the parts of the prompt that are instructions and the parts that are data to be processed. This reduces the risk of 'Prompt Injection' style confusion where the model executes the data.

  8. Question 8Intermediate

    Prompt Engineering for Effective Software Testing · Effective Prompt Development

    You are using an LLM to review a user story for ambiguity. The model simply replies "The story looks good." To get a more critical analysis, you change the prompt to: "You are a pessimistic QA lead who assumes every requirement will fail. Criticize this user story and list 5 potential edge cases that are missing." Which prompting concept are you leveraging?

    Show answer & explanation

    Correct answer: D

    By assigning a specific persona ('pessimistic QA lead'), you bias the model towards a specific mode of thinking. This effectively changes the perspective from 'helpful assistant' (who might agree) to 'critical reviewer' (who looks for flaws).

  9. Question 9Intermediate

    Prompt Engineering for Effective Software Testing · Applying Prompt Engineering Techniques to Software Test Tasks

    A tester asks an LLM to "Generate a list of Boundary Values for an age field (18-65)." The LLM returns values: 18, 19, 64, 65. The tester realizes this is insufficient for robust testing. How should the prompt be refined to improve the test coverage?

    Show answer & explanation

    Correct answer: A

    The initial prompt was too vague. LLMs need explicit instructions on the testing technique specifics. Requesting invalid boundaries (off-by-one errors) ensures comprehensive BVA coverage.

  10. Question 10Advanced

    Prompt Engineering for Effective Software Testing · Evaluate Generative AI Results and Refine Prompts

    Case Study:

    Company X is using Generative AI to automate the creation of unit tests for their Python microservices. They have established a workflow where the LLM reads a function and outputs a test file.

    Problem: The generated tests often reference variables or functions that don't exist, causing the tests to fail execution immediately.

    Question: What is the most effective "Self-Correction" prompting strategy to resolve this?

    Show answer & explanation

    Correct answer: C

    This describes the Reflexion pattern (or iterative repair). LLMs are excellent at fixing their own code if provided with the error trace (ground truth). Simply asking it to try again without the error context is less effective.

Ready for the real thing?

The full CT-GenAI simulator has every exam-style question, timed mode, and instant scoring.