AI for Commits, PRs, Tests & Docs Questions with Answers

23 practice questions on AI for Commits, PRs, Tests & Docs (AI Tools for Developers) with answers and step-by-step solutions. Try 10 samples below, then practise all 23 free in the AptiNest app.

Sample questions

Question 1Easy

AI can help write release notes by:

  1. Deciding which bugs customers should be told about without any human approval
  2. Deploying the release
  3. Summarising merged PRs into user-facing changes
  4. Choosing the version number for marketing

Answer: C. Summarising merged PRs into user-facing changes

Explanation

Summarising change lists is a drafting task; humans decide what is accurate and appropriate to publish.

Step-by-step solution

  1. Release notes summarise merged pull requests into user-facing changes.
  2. AI can draft that summary, which is a drafting task.
  3. A human still decides what to publish and checks that it is accurate.
  4. So the answer is option C.

Why the other options are wrong

  • A. Deciding what customers hear without human approval skips the review that release notes need.
  • B. Deploying a release is not drafting release notes.
  • D. Choosing a marketing version number is a human decision, not part of drafting the notes.

Tip: AI can draft release notes from merged changes; a person approves what is published.

Question 2Easy

An AI drafts the description for your pull request. What must you check before posting?

  1. That it contains no code
  2. That it mentions the AI tool's name three times
  3. That it is at least five paragraphs long so reviewers think it was a big effort
  4. That it accurately describes what the PR changes

Answer: D. That it accurately describes what the PR changes

Explanation

Reviewers rely on the description; an inaccurate summary misleads them about what to check.

Step-by-step solution

  1. An AI-drafted description can contain errors or describe changes that were not made.
  2. Reviewers rely on the description to know what to check.
  3. So before posting, confirm the description accurately matches what the PR changes.
  4. The check is option D.

Why the other options are wrong

  • A. A PR description may include code snippets; having no code is not the check.
  • B. Naming the AI tool is not required, and the check is accuracy.
  • C. Length does not make a description accurate.

Tip: Compare every claim in an AI-drafted PR description with the actual diff before posting.

Question 3Easy

Which documentation task is AI typically good at speeding up?

  1. Drafting docstrings and README sections from existing code
  2. Signing legal contracts
  3. Approving production releases
  4. Deciding the company's product strategy for the next five years

Answer: A. Drafting docstrings and README sections from existing code

Explanation

AI can produce first drafts of explanatory text that developers then correct and refine.

Step-by-step solution

  1. AI can generate initial versions of docstrings and READMEs from code.
  2. These texts are easy to modify after generation.
  3. Legal contracts require human judgment and nuance.
  4. Release approvals need team consensus and checks.
  5. Product strategy involves long-term planning and vision.

Why the other options are wrong

  • B. Signing legal contracts needs human judgment and legal responsibility, so AI does not speed this up safely.
  • C. Approving production releases needs human accountability and checks, not a tool's sign-off.
  • D. Deciding five-year product strategy needs human vision and business judgment, not generated text.

Tip: Use AI for repetitive documentation tasks, not strategic or legal work.

Question 4Easy

Before merging AI-generated tests, you should:

  1. Rename them so they follow the team's test naming convention
  2. Run them and confirm they fail when the code is broken
  3. Count them and report the number
  4. Remove all assertions

Answer: B. Run them and confirm they fail when the code is broken

Explanation

A useful test fails when behaviour is wrong; breaking the code on purpose shows the test actually checks something.

Step-by-step solution

  1. Running tests when code is broken ensures they catch errors.
  2. Failing tests prove they are checking for correct behaviour.
  3. This confirms tests are meaningful and working properly.
  4. Other steps do not verify test effectiveness directly.
  5. Final answer: B (Run them and confirm they fail when the code is broken).

Why the other options are wrong

  • A. Renaming tests to fit a convention is cosmetic and does not show they actually check anything.
  • C. Counting tests says nothing about whether they check correct behaviour or catch bugs.
  • D. Removing all assertions makes tests pass without checking anything, so they prove nothing.

Tip: Always run tests with broken code to ensure they work as intended.

Question 5Medium

Which statement about AI-written tests is TRUE?

  1. They never contain bugs because the AI also wrote the function they test
  2. They cannot be used in CI
  3. They replace the need for manual exploratory testing forever
  4. They can save time but need review like any other code

Answer: D. They can save time but need review like any other code

Explanation

Generated tests are code; they can have wrong expectations, missed cases or flaky timing.

Step-by-step solution

  1. AI-written tests are code and can have errors like any other code.
  2. They may miss edge cases or have incorrect logic without review.
  3. Review is needed to ensure accuracy and reliability of test results.
  4. Time can be saved by AI but human oversight is still required.
  5. Final answer: They can save time but need review like any other code.

Why the other options are wrong

  • A. AI-written tests can still contain bugs, and the function being written by AI does not guarantee correctness.
  • B. AI-written tests can run in CI like any other tests, so being banned from CI is false.
  • C. Tests cannot replace manual exploratory testing forever; they miss things humans would find.

Tip: Always review AI-written tests as they can still contain errors.

Question 6Medium

Which prompt is best for generating useful edge-case tests?

  1. "Write tests."
  2. "List edge cases for this function (empty, boundary, invalid input), then write a test for each."
  3. "Write tests that do not use assertions."
  4. "Write one test that passes."

Answer: B. "List edge cases for this function (empty, boundary, invalid input), then write a test for each."

Explanation

Asking for edge cases first makes the AI reason about inputs, giving tests that probe real risks.

Step-by-step solution

  1. Option A is vague and says nothing about which inputs to test.
  2. Option C bans assertions, so the tests cannot check any result.
  3. Option D asks for one passing test, which skips the risky inputs.
  4. Option B lists edge cases (empty, boundary, invalid input) first, then writes a test for each. The correct answer is B.

Why the other options are wrong

  • A. It gives no guidance on which inputs to test, so the tests are generic.
  • C. Tests without assertions cannot check any result.
  • D. One passing test covers a single case and misses the edge cases.

Tip: Ask the AI to list the risky inputs first, then write one test for each.

Question 7Medium

A developer asks AI to "make the failing test pass". It adds @pytest.mark.skip. What happened?

  1. The bug was fixed in the most efficient possible way
  2. The test now runs faster
  3. pytest now checks more cases
  4. The test was disabled, not fixed

Answer: D. The test was disabled, not fixed

Explanation

Skipping hides the failure; the request should say "fix the code so the test passes without changing the test".

Step-by-step solution

  1. The AI added @pytest.mark.skip to the failing test.
  2. The skip marker tells pytest not to run the test, so the failure is hidden.
  3. The bug in the code is still there, so nothing was fixed.
  4. The test was disabled, not fixed. The correct answer is D (The test was disabled, not fixed).

Why the other options are wrong

  • A. No bug was fixed at all, so nothing was done efficiently.
  • B. A skipped test does not run, so nothing about its speed changed.
  • C. Pytest checked no extra cases; it skipped this one.

Tip: Ask for the code to be fixed so the test passes, and say not to edit the test.

Question 8Medium

You ask AI to explain a failing CI log. Which input helps it most?

  1. Only the CI badge colour
  2. The relevant failing step's log lines and the command that ran
  3. Your commit count for the month
  4. The complete history of every CI run in the last year, unfiltered

Answer: B. The relevant failing step's log lines and the command that ran

Explanation

Focused, relevant log excerpts show the actual error without burying it in noise.

Step-by-step solution

  1. The model needs the relevant failing log lines and the command.

Why the other options are wrong

  • A. A badge colour tells nothing.
  • C. Commits are irrelevant.
  • D. Too much unfiltered data buries the issue.

Tip: Be specific.

Question 9Hard

AI generated 40 tests that all pass, and line coverage rose to 95%. Which conclusion is justified?

  1. Lines were executed, but the assertions may still miss wrong behaviour
  2. Coverage above 90% proves the tests are good
  3. No further review is needed
  4. The code is now bug-free because almost every line runs under at least one test

Answer: A. Lines were executed, but the assertions may still miss wrong behaviour

Explanation

Coverage shows which lines ran, not whether the tests check the right outcomes; weak assertions can give high coverage.

Step-by-step solution

  1. High coverage means most lines run, but not that tests check correct outcomes.
  2. Tests may pass even if they don't catch all edge cases or errors.
  3. Coverage alone doesn't ensure tests are comprehensive or effective.
  4. Assertions might be weak and miss wrong behaviour despite high line coverage.
  5. Therefore, lines were executed, but the assertions may still miss wrong behaviour.

Why the other options are wrong

  • B. Coverage above 90 percent does not prove tests are good, since lines can run with weak checks.
  • C. No further review is needed is wrong; coverage cannot replace review of assertions and logic.
  • D. Lines running under a test does not mean the code is bug-free; wrong results can still pass.

Tip: Coverage ≠ test quality; always check if tests catch real issues.

Question 10Hard

Your team lets an AI bot comment on every PR. After a month, developers ignore its comments. What is the best fix?

  1. Make the bot comment twice as often so developers notice
  2. Block merges until every bot comment is resolved, however minor
  3. Reduce noise by tuning it to high-signal issues and track which comments lead to changes
  4. Remove human reviewers so only the bot remains

Answer: C. Reduce noise by tuning it to high-signal issues and track which comments lead to changes

Explanation

Alert fatigue makes all comments ignored; measuring usefulness and cutting noise restores trust in the signal.

Step-by-step solution

  1. Bot comments cause alert fatigue, leading to ignoring.
  2. Measuring comment impact helps cut unhelpful noise.
  3. Tuning bot to focus on high-signal issues improves relevance.
  4. Tracking which comments lead to changes shows value.
  5. This rebuilds trust and reduces ignored comments.

Why the other options are wrong

  • A. Commenting twice as often adds more noise and makes developers ignore the bot even more.
  • B. Blocking merges over every minor comment slows work and does not improve the signal.
  • D. Removing human reviewers removes judgement and checks; the bot should support them, not replace them.

Tip: Prioritize quality over quantity in automated feedback.

Practise all 23 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all AI Tools for Developers topics · All topics