Challenge 04

Run and extend test coverage, and review code

Work locally with your chosen API track.

Goal#

Bring the testing and review of the application up to Octocat standards by running the existing tests, extending coverage, and performing an agent-assisted code review. The mindset shift is from "does it work?" to "can I trust it?".

Actions#

  • Run the existing tests — Execute the current API and frontend test suites and confirm the baseline passes.
  • Find the gaps — Use Copilot to identify untested code paths, especially around the new cart and backlog features.
  • Extend coverage — Add unit tests for repository/business logic and component tests for critical UI paths. Include edge cases and error handling.
  • Review the code — Use Copilot (and/or the code review agent) to review recent changes for correctness, security, and data integrity.
  • Fix what you find — Address issues surfaced by the tests and review, prioritising security and correctness over style.

Success criteria#

Repo rule: only run linters, builds, and tests that already exist in the repo — no new test frameworks mid-hack.

Optional stretch — model selection & context budgeting#

  • Compare models — Generate tests for the same code once in Auto mode and once with an explicitly selected model. Compare and record a decision rule for when to use each.
  • Set a context budget — Before prompting, decide a budget (max number of files, max reference length per file) and stick to it.
  • Note the trade-off — Capture how the budget affected quality vs. noise in the generated tests.

Learning resources#

A prompt to start with

Adapt this to your chosen API track and actual environment. It starts a conversation; it does not complete the challenge for you.

Review the tests for the cart and the backlog feature we just changed. Identify missing edge cases and error paths. Extend only the existing test frameworks, run the focused suites, and rank review findings by security, correctness, and data integrity.

Ready for the next step?

Demonstrate each success criterion above and check it off. Completion is your assessment, not an automated test of your code.

Check all 3 success criteria before marking complete.

View this page's MarkdownLearning content is pinned to the credited upstream import.

Search the workshop

Solutions are not included.

    Search runs in your browser against the guide. It does not query GitHub or an AI service.

    Reset your workshop progress?

    This removes saved success criteria, completion marks, and the resume location in this browser. It does not change your repository or Azure resources.