Skip to content
Ameen Abozaid
JNR-055

AI-assisted development workflow

  • 6 Lessons
  • 66 min of reading
  • 2.5 h practice (estimate)
On this page 8 topics

Overview

Topics

  • IDE assistants
  • context-rich prompts
  • generating tests and boilerplate
  • reviewing AI code in pull requests
  • protecting proprietary code
  • team policy

Learn first

66 min of reading · 2.5 h of practice (estimate)

Learning outcomes

  1. Use an IDE assistant for completion, chat, and refactoring suggestions, and choose when not to use it.
  2. Write context-rich prompts: the relevant code, constraints, conventions, and the expected result.
  3. Generate tests and boilerplate with an assistant, then review them for meaningful assertions and correct behavior.
  4. Review AI-assisted changes in a pull request with the same standards as human code, and disclose AI use as the team requires.
  5. Follow a team policy that protects proprietary code, secrets, and licenses.

Lessons

  1. 01Assistants in the professional workflow11 min read
  2. 02Prompts with context: code, constraints, conventions11 min read
  3. 03AI for tests and boilerplate, and how to review it11 min read
  4. 04Reviewing AI-assisted pull requests11 min read
  5. 05Team policies: code privacy, secrets, licenses11 min read
  6. 06Demo: refactoring a long method with an assistant under green tests11 min read

Lab and exercises

Lab

JNR-055-LAB1 · Assisted refactoring

Outcomes: 1–5 · Time: ~2 h Use an assistant to help refactor the CheckoutService from JNR-003-LAB1 and to generate missing unit tests. Keep a log of prompts, what you accepted, what you rejected, and why. Draft a one-page team AI-use policy for Shop. Acceptance: tests stay green throughout; every generated test has meaningful assertions; at least two suggestions rejected with reasons; a one-page team AI-use policy drafted for Shop.

Exercises (assessment: review a provided AI-assisted pull request and find its defects and policy issues, plus six exercises)

IDOutcomeTask
JNR-055-EX011List three tasks where you would use an assistant and three where you would not. Give a reason for each.
JNR-055-EX022Rewrite the prompt "make this better" for a method of your choice, with code, constraints, conventions, and expected result.
JNR-055-EX033Generate tests for Money.add with an assistant. Mark any test with a weak assertion and fix it.
JNR-055-EX043Take one generated test, break the production code on purpose, and report whether the test catches it.
JNR-055-EX054Review a given 400-line AI-assisted pull request description. Write five review comments.
JNR-055-EX064Write the disclosure line you would put in a pull request that used an assistant.
JNR-055-EX075Mark which of these may go into a prompt: a stack trace without secrets, a .env file, customer emails, a public method signature.
Show solutions
  • EX01 Use: boilerplate, explaining code, draft tests. Do not use: security-sensitive logic, secrets handling, code you cannot verify.
  • EX02 Example: "Java 21, Shop Core. Code below. Keep the signature, no behavior change, JUnit 5. Extract the tax block into calculateTax and list changes."
  • EX03 Weak: assertNotNull(result). Fix: assertEquals(new Money(300, "EUR"), a.add(b)).
  • EX04 Change + to - in the code; a useful test turns red. A test that stays green is useless; strengthen or remove it.
  • EX05 Examples: PR is too large, ask to split; method name that does not exist in the library; deleted null check; tests assert nothing; no AI disclosure.
  • EX06 "AI assistance: used [tool] to draft tests and one extraction; reviewed and edited by me."
  • EX07 Allowed: stack trace without secrets, public method signature (if policy allows). Not allowed: .env file, customer emails.
  • Outcome 1 is also covered by quiz Q01–Q02; outcome 5 by the lab policy and quiz Q09–Q10.

Quiz

Outcomes: O1 using assistants · O2 prompts · O3 generated tests · O4 reviewing AI-assisted PRs · O5 team policy.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1A good use of an assistant is:O1
  2. 2Who is responsible for AI-written code you commit?O1
  3. 3A good prompt includes:O2
  4. 4Why state conventions in a prompt?O2
  5. 5assertNotNull(result) alone is:O3
  6. 6How can you check that a generated test is useful?O3
  7. 7AI-assisted pull requests get:O4
  8. 8A very large generated diff should:O4
  9. 9May you paste a production password into a prompt?O5
  10. 10Which tools may you use?O5

Practical part

Seven exercises JNR-055-EX01 to EX07 plus the lab; the assessment is reviewing a provided AI-assisted pull request for defects and policy issues. Pass: at least 8 of 10 quiz answers, six exercises correct, and a lab log with at least two reasoned rejections and tests that stay green.

Common mistakes

Accepting large generated diffs without reading them; generated tests that assert nothing useful; pasting proprietary code into tools the employer has not approved.

Assessment

Review a provided AI-assisted pull request and find its defects and policy issues.

Career relevance

Most teams now use AI assistants; reviewing their output well is a junior expectation. Deepened in MID-072 and governed at scale in SRB-022 and STF-021.

Type to search levels, phases, modules and lessons.