Practise the language developers use when generating, reviewing, and discussing tests produced by AI tools — including how to talk about what AI gets right and what it misses.
0 / 36 completed
1 / 36
You prompt Copilot: '___ unit tests for the calculateTax function.' What are you asking the AI to do?
'Generate unit tests for' is a standard prompt pattern for AI-assisted testing. You provide the function (by naming it or pasting it) and the AI produces test cases covering happy paths, edge cases, and sometimes error conditions.
2 / 36
In a pull request description a developer writes: '___ generated these tests as a starting point — I've reviewed and added two extra edge cases.'
Stating 'Copilot generated these tests' in a PR description is transparent and professional — it tells reviewers the tests came from AI and that the developer has taken responsibility for reviewing them.
3 / 36
After reviewing AI-generated tests your colleague says: 'The AI ___ the edge case where the input array is empty.'
'The AI missed this edge case' is a common observation when reviewing AI-generated tests. AI tools often cover common paths well but may overlook boundary conditions, null inputs, or domain-specific scenarios the developer must add manually.
4 / 36
Your team notices that ___ coverage is 90% thanks to AI-generated tests, but a critical bug slipped through. What does this reveal?
High test coverage from AI-generated tests can create false confidence. Coverage measures which lines were executed, not whether the assertions are meaningful — AI tests can pass while missing the exact condition that causes a production bug.
5 / 36
A reviewer comments: 'These look like ___ tests — they pass the happy path but none of them check what happens when the API returns a 500.'
Shallow AI-generated tests cover the easy cases but miss error handling, unexpected inputs, and failure modes. Part of reviewing AI-generated tests is identifying and filling these gaps before the code reaches production.
6 / 36
Sarah: 'Hey team, I've been using AI to generate initial test cases for the new payment processing API. The response from the AI suggests we should focus on testing various currency conversions, but it hasn't considered potential negative values for amounts. Should I ask it to specifically incorporate negative amount tests?
This question assesses understanding of AI's role in test case generation. The correct answer acknowledges that while AI can *help* identify potential edge cases like negative amounts, it doesn't replace the need for manual review and validation based on existing documentation or business rules. Options A and B misinterpret the AI's function – it's an assistant, not a replacement for domain expertise. Option C is accurate in its assessment of AI's benefit, but misses the crucial point that AI needs to be guided by established requirements.
7 / 36
David: 'I've asked Copilot to generate some tests for the new user authentication service. The response suggests using `assertThrows` for several scenarios, but I'm not entirely sure when it's appropriate to use that assertion style. Can you explain the difference between `assertThrows` and a standard `assertEquals` in this context?',
`assertThrows` specifically targets assertions about exceptions being thrown. It's designed to verify that a function *should* throw an exception under specific conditions, allowing you to test for expected error handling. `assertEquals`, on the other hand, is used to confirm that the result of a function or operation matches a predefined value – it doesn't check if an exception occurs. Using assertThrows in this case ensures David understands when the AI is focusing on testing for error conditions rather than validating output values.
8 / 36
PR Description: 'Automated tests generated by the AI tool have covered 80% of the code paths for the user profile update endpoint. The AI identified several potential vulnerabilities related to data validation but flagged them as low priority due to the high test coverage. I've manually added tests for handling invalid email formats and exceeding character limits, as suggested by the AI.'
Which of the following best describes the developer's approach?
This scenario highlights a common pitfall: blindly accepting AI-generated recommendations. While AI can accelerate test creation, developers must critically evaluate the suggestions—understanding the potential risks and adding tests that address those specific concerns. The developer's actions demonstrate an appropriate balance of leveraging the AI's output while also incorporating targeted validation to ensure comprehensive coverage. The key is not just achieving high test coverage but ensuring it's *intelligent* test coverage.
9 / 36
During a code review of a new microservice responsible for calculating shipping costs, the team is considering using AI to generate test cases. Alex says: 'I'm going to use an AI tool to create initial tests based on the API documentation and some common scenarios. It'll save us time.' Ben replies, 'But what about testing for unexpected data types or edge cases that aren't explicitly documented?' Which of the following best reflects Alex's approach?
Alex's statement highlights a common tendency to embrace AI-assisted testing without sufficient caution. While AI can accelerate test creation, it's crucial to remember that documentation is often incomplete and doesn't cover every possible scenario or unexpected data type. A truly robust strategy requires human oversight to identify and address these gaps, ensuring the tests are actually verifying the system's behavior under all conditions. The correct answer reflects this balanced perspective.
10 / 36
Sarah: 'Hey team, I've been using AI to generate initial test cases for the new payment processing API. The response from the AI suggests we should focus on testing various currency conversions, but it hasn't considered potential negative values for amounts. Should I ask it to specifically incorporate negative amount tests?
This question assesses understanding of AI's role in test case generation. The correct answer acknowledges that while AI can *help* identify potential edge cases like negative amounts, it doesn't replace the need for manual review and validation based on existing documentation or business rules. Options A and B misinterpret the AI's function – it's an assistant, not a replacement for domain expertise. Option C is accurate in its assessment of AI's benefit, but misses the crucial point that AI needs to be guided by established requirements.
11 / 36
David: 'I've asked Copilot to generate some tests for the new user authentication service. The response suggests using `assertThrows` for several scenarios, but I'm not entirely sure when it's appropriate to use that assertion style. Can you explain the difference between `assertThrows` and a standard `assertEquals` in this context?',
`assertThrows` specifically targets assertions about exceptions being thrown. It's designed to verify that a function *should* throw an exception under specific conditions, allowing you to test for expected error handling. `assertEquals`, on the other hand, is used to confirm that the result of a function or operation matches a predefined value – it doesn't check if an exception occurs. Using assertThrows in this case ensures David understands when the AI is focusing on testing for error conditions rather than validating output values.
12 / 36
PR Description: 'Automated tests generated by the AI tool have covered 80% of the code paths for the user profile update endpoint. The AI identified several potential vulnerabilities related to data validation but flagged them as low priority due to the high test coverage. I've manually added tests for handling invalid email formats and exceeding character limits, as suggested by the AI.'
Which of the following best describes the developer's approach?
This scenario highlights a common pitfall: blindly accepting AI-generated recommendations. While AI can accelerate test creation, developers must critically evaluate the suggestions—understanding the potential risks and adding tests that address those specific concerns. The developer's actions demonstrate an appropriate balance of leveraging the AI's output while also incorporating targeted validation to ensure comprehensive coverage. The key is not just achieving high test coverage but ensuring it's *intelligent* test coverage.
13 / 36
During a code review of a new microservice responsible for calculating shipping costs, the team is considering using AI to generate test cases. Alex says: 'I'm going to use an AI tool to create initial tests based on the API documentation and some common scenarios. It'll save us time.' Ben replies, 'But what about testing for unexpected data types or edge cases that aren't explicitly documented?' Which of the following best reflects Alex's approach?
Alex's statement highlights a common tendency to embrace AI-assisted testing without sufficient caution. While AI can accelerate test creation, it's crucial to remember that documentation is often incomplete and doesn't cover every possible scenario or unexpected data type. A truly robust strategy requires human oversight to identify and address these gaps, ensuring the tests are actually verifying the system's behavior under all conditions. The correct answer reflects this balanced perspective.
14 / 36
Sarah: 'Hey team, I've been using AI to generate initial test cases for the new payment processing API. The response from the AI suggests we should focus on testing various currency conversions, but it hasn't considered potential negative values for amounts. Should I ask it to specifically incorporate negative amount tests?
This question assesses understanding of AI's role in test case generation. The correct answer acknowledges that while AI can *help* identify potential edge cases like negative amounts, it doesn't replace the need for manual review and validation based on existing documentation or business rules. Options A and B misinterpret the AI's function – it's an assistant, not a replacement for domain expertise. Option C is accurate in its assessment of AI's benefit, but misses the crucial point that AI needs to be guided by established requirements.
15 / 36
David: 'I've asked Copilot to generate some tests for the new user authentication service. The response suggests using `assertThrows` for several scenarios, but I'm not entirely sure when it's appropriate to use that assertion style. Can you explain the difference between `assertThrows` and a standard `assertEquals` in this context?',
`assertThrows` specifically targets assertions about exceptions being thrown. It's designed to verify that a function *should* throw an exception under specific conditions, allowing you to test for expected error handling. `assertEquals`, on the other hand, is used to confirm that the result of a function or operation matches a predefined value – it doesn't check if an exception occurs. Using assertThrows in this case ensures David understands when the AI is focusing on testing for error conditions rather than validating output values.
16 / 36
PR Description: 'Automated tests generated by the AI tool have covered 80% of the code paths for the user profile update endpoint. The AI identified several potential vulnerabilities related to data validation but flagged them as low priority due to the high test coverage. I've manually added tests for handling invalid email formats and exceeding character limits, as suggested by the AI.'
Which of the following best describes the developer's approach?
This scenario highlights a common pitfall: blindly accepting AI-generated recommendations. While AI can accelerate test creation, developers must critically evaluate the suggestions—understanding the potential risks and adding tests that address those specific concerns. The developer's actions demonstrate an appropriate balance of leveraging the AI's output while also incorporating targeted validation to ensure comprehensive coverage. The key is not just achieving high test coverage but ensuring it's *intelligent* test coverage.
17 / 36
During a code review of a new microservice responsible for calculating shipping costs, the team is considering using AI to generate test cases. Alex says: 'I'm going to use an AI tool to create initial tests based on the API documentation and some common scenarios. It'll save us time.' Ben replies, 'But what about testing for unexpected data types or edge cases that aren't explicitly documented?' Which of the following best reflects Alex's approach?
Alex's statement highlights a common tendency to embrace AI-assisted testing without sufficient caution. While AI can accelerate test creation, it's crucial to remember that documentation is often incomplete and doesn't cover every possible scenario or unexpected data type. A truly robust strategy requires human oversight to identify and address these gaps, ensuring the tests are actually verifying the system's behavior under all conditions. The correct answer reflects this balanced perspective.
18 / 36
Sarah: 'Hey team, I've been using AI to generate initial test cases for the new payment processing API. The response from the AI suggests we should focus on testing various currency conversions, but it hasn't considered potential negative values for amounts. Should I ask it to specifically incorporate negative amount tests?
This question assesses understanding of AI's role in test case generation. The correct answer acknowledges that while AI can *help* identify potential edge cases like negative amounts, it doesn't replace the need for manual review and validation based on existing documentation or business rules. Options A and B misinterpret the AI's function – it's an assistant, not a replacement for domain expertise. Option C is accurate in its assessment of AI's benefit, but misses the crucial point that AI needs to be guided by established requirements.
19 / 36
David: 'I've asked Copilot to generate some tests for the new user authentication service. The response suggests using `assertThrows` for several scenarios, but I'm not entirely sure when it's appropriate to use that assertion style. Can you explain the difference between `assertThrows` and a standard `assertEquals` in this context?',
`assertThrows` specifically targets assertions about exceptions being thrown. It's designed to verify that a function *should* throw an exception under specific conditions, allowing you to test for expected error handling. `assertEquals`, on the other hand, is used to confirm that the result of a function or operation matches a predefined value – it doesn't check if an exception occurs. Using assertThrows in this case ensures David understands when the AI is focusing on testing for error conditions rather than validating output values.
20 / 36
PR Description: 'Automated tests generated by the AI tool have covered 80% of the code paths for the user profile update endpoint. The AI identified several potential vulnerabilities related to data validation but flagged them as low priority due to the high test coverage. I've manually added tests for handling invalid email formats and exceeding character limits, as suggested by the AI.'
Which of the following best describes the developer's approach?
This scenario highlights a common pitfall: blindly accepting AI-generated recommendations. While AI can accelerate test creation, developers must critically evaluate the suggestions—understanding the potential risks and adding tests that address those specific concerns. The developer's actions demonstrate an appropriate balance of leveraging the AI's output while also incorporating targeted validation to ensure comprehensive coverage. The key is not just achieving high test coverage but ensuring it's *intelligent* test coverage.
21 / 36
During a code review of a new microservice responsible for calculating shipping costs, the team is considering using AI to generate test cases. Alex says: 'I'm going to use an AI tool to create initial tests based on the API documentation and some common scenarios. It'll save us time.' Ben replies, 'But what about testing for unexpected data types or edge cases that aren't explicitly documented?' Which of the following best reflects Alex's approach?
Alex's statement highlights a common tendency to embrace AI-assisted testing without sufficient caution. While AI can accelerate test creation, it's crucial to remember that documentation is often incomplete and doesn't cover every possible scenario or unexpected data type. A truly robust strategy requires human oversight to identify and address these gaps, ensuring the tests are actually verifying the system's behavior under all conditions. The correct answer reflects this balanced perspective.
22 / 36
During a standup meeting, Maya reports: "The AI testing tool flagged several potential race conditions in the distributed caching service. It suggested using `assertTimeout` to verify response times, but I'm not sure if that's the best approach for complex concurrency issues.". Which of the following best describes Maya's concern regarding using assertTimeout?
assertTimeout measures a response's duration, which is useful for quick timing checks. However, it doesn't address complex concurrency issues like deadlocks or data races that require deeper analysis of the code's state and interactions. Maya's concern highlights this limitation – assertTimeout isn't a substitute for comprehensive concurrency testing strategies.
23 / 36
In a Slack channel discussing the AI-generated tests for a new API endpoint, Ben writes: "The AI suggested generating negative test cases by sending invalid data types to the endpoint. I'm wondering if we should use `assertThrows` for these scenarios, or is there a more appropriate way to validate input?"
While assertThrows can be useful, relying solely on it for input validation—especially with complex API designs—is insufficient. It primarily catches basic type mismatches; a more robust approach involves custom assertions that specifically check the server's response code (e.g., 400 Bad Request) and content to ensure adherence to expected validation rules. This provides greater control and clarity.
24 / 36
Reviewing a PR containing AI-generated tests for a payment gateway service, Liam notes: "The AI identified several scenarios involving large currency transfers. It suggested using the `assertThrows` command to verify that transactions exceeding $10,000 result in an error. However, I'm unsure if this is sufficient to cover all potential edge cases."
While assertThrows is a good first step for large transaction checks, it doesn't guarantee complete coverage. Large transactions often involve complex edge cases (e.g., currency conversion rates, potential overflows) that require more targeted manual testing to ensure full validation and prevent unexpected behavior.
25 / 36
During a code review of an AI-generated test suite for a microservice handling user profile updates, Chloe observes: "The AI has generated tests based on the API documentation but hasn't considered scenarios where the user provides conflicting data. Should we add assertions to specifically check for these inconsistencies?"
API documentation, while helpful, doesn't guarantee data consistency. User input is inherently prone to errors or conflicting values. Adding assertions specifically designed to check for these inconsistencies strengthens the test suite and ensures the service handles unexpected user behavior gracefully—a critical aspect of robust software development.
26 / 36
A developer, David, asks an AI tool to generate tests for a new API endpoint that calculates shipping costs. The AI suggests using `assertResponseContains` to verify that the response includes the calculated cost. "I'm not sure if this is the best way to validate the output; it seems overly reliant on parsing the response content."
assertResponseContains checks for the *presence* of data within a response, not its accuracy. Validating the shipping cost requires more than just confirming that the correct field is present; it demands verifying that the calculation itself is mathematically correct and aligns with our defined business logic. This highlights the difference between validation and verification.
27 / 36
During a standup meeting, Maya reports: "The AI testing tool flagged several potential race conditions in the distributed caching service. It suggested using `assertTimeout` to verify response times, but I'm not sure if that's the best approach for complex concurrency issues.". Which of the following best describes Maya's concern regarding using assertTimeout?
assertTimeout measures a response's duration, which is useful for quick timing checks. However, it doesn't address complex concurrency issues like deadlocks or data races that require deeper analysis of the code's state and interactions. Maya's concern highlights this limitation – assertTimeout isn't a substitute for comprehensive concurrency testing strategies.
28 / 36
In a Slack channel discussing the AI-generated tests for a new API endpoint, Ben writes: "The AI suggested generating negative test cases by sending invalid data types to the endpoint. I'm wondering if we should use `assertThrows` for these scenarios, or is there a more appropriate way to validate input?"
While assertThrows can be useful, relying solely on it for input validation—especially with complex API designs—is insufficient. It primarily catches basic type mismatches; a more robust approach involves custom assertions that specifically check the server's response code (e.g., 400 Bad Request) and content to ensure adherence to expected validation rules. This provides greater control and clarity.
29 / 36
Reviewing a PR containing AI-generated tests for a payment gateway service, Liam notes: "The AI identified several scenarios involving large currency transfers. It suggested using the `assertThrows` command to verify that transactions exceeding $10,000 result in an error. However, I'm unsure if this is sufficient to cover all potential edge cases."
While assertThrows is a good first step for large transaction checks, it doesn't guarantee complete coverage. Large transactions often involve complex edge cases (e.g., currency conversion rates, potential overflows) that require more targeted manual testing to ensure full validation and prevent unexpected behavior.
30 / 36
During a code review of an AI-generated test suite for a microservice handling user profile updates, Chloe observes: "The AI has generated tests based on the API documentation but hasn't considered scenarios where the user provides conflicting data. Should we add assertions to specifically check for these inconsistencies?"
API documentation, while helpful, doesn't guarantee data consistency. User input is inherently prone to errors or conflicting values. Adding assertions specifically designed to check for these inconsistencies strengthens the test suite and ensures the service handles unexpected user behavior gracefully—a critical aspect of robust software development.
31 / 36
A developer, David, asks an AI tool to generate tests for a new API endpoint that calculates shipping costs. The AI suggests using `assertResponseContains` to verify that the response includes the calculated cost. "I'm not sure if this is the best way to validate the output; it seems overly reliant on parsing the response content."
assertResponseContains checks for the *presence* of data within a response, not its accuracy. Validating the shipping cost requires more than just confirming that the correct field is present; it demands verifying that the calculation itself is mathematically correct and aligns with our defined business logic. This highlights the difference between validation and verification.
32 / 36
During a standup meeting, Maya reports: "The AI testing tool flagged several potential race conditions in the distributed caching service. It suggested using `assertTimeout` to verify response times, but I'm not sure if that's the best approach for complex concurrency issues.". Which of the following best describes Maya's concern regarding using assertTimeout?
assertTimeout measures a response's duration, which is useful for quick timing checks. However, it doesn't address complex concurrency issues like deadlocks or data races that require deeper analysis of the code's state and interactions. Maya's concern highlights this limitation – assertTimeout isn't a substitute for comprehensive concurrency testing strategies.
33 / 36
In a Slack channel discussing the AI-generated tests for a new API endpoint, Ben writes: "The AI suggested generating negative test cases by sending invalid data types to the endpoint. I'm wondering if we should use `assertThrows` for these scenarios, or is there a more appropriate way to validate input?"
While assertThrows can be useful, relying solely on it for input validation—especially with complex API designs—is insufficient. It primarily catches basic type mismatches; a more robust approach involves custom assertions that specifically check the server's response code (e.g., 400 Bad Request) and content to ensure adherence to expected validation rules. This provides greater control and clarity.
34 / 36
Reviewing a PR containing AI-generated tests for a payment gateway service, Liam notes: "The AI identified several scenarios involving large currency transfers. It suggested using the `assertThrows` command to verify that transactions exceeding $10,000 result in an error. However, I'm unsure if this is sufficient to cover all potential edge cases."
While assertThrows is a good first step for large transaction checks, it doesn't guarantee complete coverage. Large transactions often involve complex edge cases (e.g., currency conversion rates, potential overflows) that require more targeted manual testing to ensure full validation and prevent unexpected behavior.
35 / 36
During a code review of an AI-generated test suite for a microservice handling user profile updates, Chloe observes: "The AI has generated tests based on the API documentation but hasn't considered scenarios where the user provides conflicting data. Should we add assertions to specifically check for these inconsistencies?"
API documentation, while helpful, doesn't guarantee data consistency. User input is inherently prone to errors or conflicting values. Adding assertions specifically designed to check for these inconsistencies strengthens the test suite and ensures the service handles unexpected user behavior gracefully—a critical aspect of robust software development.
36 / 36
A developer, David, asks an AI tool to generate tests for a new API endpoint that calculates shipping costs. The AI suggests using `assertResponseContains` to verify that the response includes the calculated cost. "I'm not sure if this is the best way to validate the output; it seems overly reliant on parsing the response content."
assertResponseContains checks for the *presence* of data within a response, not its accuracy. Validating the shipping cost requires more than just confirming that the correct field is present; it demands verifying that the calculation itself is mathematically correct and aligns with our defined business logic. This highlights the difference between validation and verification.
What will I practice in "AI-Assisted Testing — Vocabulary"?
This is an AI Code Generation Tools exercise set. It walks through 36 scenario-based multiple-choice questions built around real usage of AI Code Generation Tools terminology that IT professionals encounter on the job.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to complete with no account, sign-up, or paywall.
How many questions are in this exercise?
This set contains 36 questions. Each one shows immediate feedback and a detailed explanation after you answer, so you learn the correct usage right away rather than waiting for a final score.
Do I need prior experience to complete this exercise?
No prior experience is required. Each question includes a full explanation covering the reasoning behind the correct answer, so the exercise itself teaches the AI Code Generation Tools vocabulary as you go.
Can I retry the exercise if I get questions wrong?
Yes — use the "Try again" button on the results screen to reset your answers and go through all the questions again. There is no limit on attempts.
Is my progress saved?
Your answers and score for the current session are tracked in the browser as you go. No account or login is needed, and there is nothing to install.
What if I don't understand a term used in a question?
Read the explanation shown after you answer each question — it breaks down the correct term in plain English with a real-world example. You can also check the site Glossary for quick definitions.
How is this different from reading a blog article on the topic?
Exercises like this one are interactive drills that test and reinforce specific vocabulary through multiple-choice questions, while blog articles explain concepts in prose. Practising here after reading builds active recall, not just passive recognition.
Where can I find more AI Code Generation Tools exercises?
See the AI Code Generation Tools exercises hub for the full set of related pages, or browse all exercise categories from the main Exercises index.
Can I use this exercise to prepare for a technical interview?
Yes — AI Code Generation Tools vocabulary comes up often in technical discussions and interviews. Pair this exercise with our dedicated Interview Preparation section for role-specific practice.