Skip to content
DocsUse AIworkflowsCode Review & QA
Chapter 11 of 15·workflows·9 min read

Code Review & QA

Review Code & QA

Using AI for code review, testing, and quality assurance

Hover or tap any paragraph to see Vietnamese translation

AI in Code Review

Claude Code can help review code to find bugs, performance issues, best practice violations, and security vulnerabilities. This supplements (not replaces) human review.

Reviewing Code with Claude

Code Review Commands
1# Review current changes2"review my changes for bugs and issues"34# Review specific file5"review UserService.ts for security issues"67# Review a PR (with GitHub MCP)8"review PR #123 and provide feedback"910# Focused review11"check this function for edge cases I might have missed"

Review Aspects

  • Logic errors: bugs, off-by-one, missing null checks.
  • Security: injection, XSS, authentication issues.
  • Performance: N+1 queries, unnecessary loops, memory leaks.
  • Best practices: naming, structure, SOLID principles.
  • Type safety: TypeScript errors, missing types.

Testing with AI

Claude can help write tests, analyze test coverage, and identify edge cases that need testing.

Testing Commands
1# Generate tests for a function2"write unit tests for the calculateDiscount function"34# Generate tests for edge cases5"what edge cases should I test for this validation function?"67# Run and fix failing tests8"run the tests and fix any failures"910# Improve test coverage11"analyze test coverage and suggest missing tests"

QA Workflows

UltraQA Mode

UltraQA is a workflow that automatically runs build, lint, tests and fixes failures until everything passes.

UltraQA
1# Start UltraQA2/ultraqa34# UltraQA cycle:5# 1. Run build6# 2. Run lint7# 3. Run tests8# 4. If failures → fix and repeat9# 5. Max 5 cycles or until all pass

Continuous QA

Continuous QA
1# Set up continuous QA during development2/loop 5m "run tests and report any failures"34# After each change5"verify my changes don't break existing tests"

Structured Feedback

Code Reviewer agent provides structured feedback with severity levels so you know which issues need immediate attention.

Structured Feedback
1# Example review output:2## Critical (must fix)3- Line 45: SQL injection vulnerability in user query45## High (should fix)6- Line 78: Missing error handling for API call7- Line 92: Race condition in concurrent update89## Medium (consider)10- Line 23: Function too long, consider extracting1112## Low (style)13- Line 15: Inconsistent naming convention
Tip
Focus on Critical and High issues first. Low severity can be left for later refactoring.

Security Review

Security Reviewer agent specializes in finding security vulnerabilities per OWASP Top 10 and unsafe patterns.

Security Review
1# Security-focused review2"review this auth code for security vulnerabilities"34# OWASP checks5"check for OWASP Top 10 vulnerabilities"67# Secrets scanning8"scan for exposed secrets or credentials"

Key Takeaways

Điểm Chính

  • AI review supplements human review, not replaces itAI review bổ sung cho human review, không thay thế
  • Reviews cover logic, security, performance, and best practicesReview bao gồm logic, security, performance và best practices
  • UltraQA automatically fixes failures until tests passUltraQA tự động fix failures cho đến khi tests pass
  • Structured feedback has severity levels for prioritizationFeedback có cấu trúc với severity levels để ưu tiên

Practice

Test your understanding of this chapter

Quiz

What does UltraQA do?

UltraQA làm gì?

True or False

AI code review should completely replace human review.

AI code review nên thay thế hoàn toàn human review.

Code Challenge

Complete the command to start QA workflow

Hoàn thành lệnh để bắt đầu QA workflow

/ 
Quiz

Which severity should you fix first?

Severity nào nên fix trước?

← → to navigate chapters
Built: 4/8/2026, 12:01:11 PM