Code review is where good teams catch bugs, share knowledge and keep quality high. In this lesson you will review pull requests on GitHub, suggest changes, submit approvals, respond to feedback as an author and follow a practical review checklist.
๐ What You’ll Learn: why code review matters, reviewing a PR step by step, line and multi-line comments, suggested changes, review outcomes, responding as the author, a review checklist including test-code quality, review etiquette, and automating reviews.
๐ Why Code Review Matters
Code review means teammates read a change before it is merged. It catches bugs early, spreads knowledge across the team, keeps code consistent and is one of the best learning tools for juniors. On GitHub, code review happens inside pull requests.
For testers, reviewing pull requests is a chance to test earlier: spot missing edge cases, untested paths and risky changes before they reach a test environment.
๐งญ Reviewing a Pull Request Step by Step
- Read the PR title and description: what problem does it solve, and how was it tested?
- Check that the CI checks are green.
- Open the Files changed tab.
- Comment on specific lines, suggest changes and ask questions.
- Submit your review with one of three outcomes.
๐ฌ Comment on Code
In Files changed, hover over a line and click the blue +:
- Click and drag over line numbers (or Shift-click) to comment on several lines.
- Write the comment, then choose Start a review (recommended) or Add single comment.
Start a review collects all your comments and publishes them together, so the author gets one notification instead of twenty.
Suggest a change directly
In the comment box, click the Add a suggestion button (the ยฑ file icon). GitHub inserts the selected lines in a special “suggestion” block that you edit to the proposed code. The author can then click Commit suggestion, or batch several suggestions into one commit. This is perfect for small fixes such as typos, renamed variables or a better locator.
Useful helpers
- Tick Viewed on each file to track your progress in large PRs.
- Use the file filter and the file tree to focus on test files or one folder.
- Switch between unified and split diff view with the settings gear.
- Use
@usernameto bring someone into a discussion.
โ Submit the Review
Click Finish your review (or Review changes) and choose:
| Option | Meaning |
|---|---|
| Comment | General feedback without approving or blocking |
| Approve | You are happy for it to be merged |
| Request changes | Something must be fixed before merging |
With branch protection, a PR may require one or more approvals, and “Request changes” blocks the merge until the reviewer re-reviews. CODEOWNERS can request the right reviewers automatically.
๐ As the Author: Responding to Review
- Reply to each comment: agree, explain, or ask a question.
- Push fixes to the same branch; the PR updates and outdated comments are marked as such.
- Click Resolve conversation when a thread is settled (or let the reviewer do it, as your team prefers).
- Click Re-request review next to the reviewer’s name when you are ready.
๐ก Tip: Do not take review comments personally. Reviewers comment on the code, not on you, and every comment is a chance to improve.
๐งช What to Look For: A Review Checklist
| Area | Questions to ask |
|---|---|
| Correctness | Does it do what the description says? Any obvious bugs or edge cases missed? |
| Tests | Are there tests for the change? Do they test behaviour, not implementation details? |
| Test quality (automation PRs) | Stable locators, web-first assertions, no hard waits, independent tests (flaky tests) |
| Readability | Clear names, small functions, comments where the “why” is not obvious |
| Security | No secrets, tokens or personal data committed (.gitignore) |
| Scope | One purpose; unrelated changes moved to another PR |
| Docs | README, configuration and changelog updated if needed |
๐ค Review Etiquette
| โ Avoid | โ Prefer |
|---|---|
| “This is wrong.” | “This misses the empty-cart case. Could we add a test for it?” |
| “Why did you do this?!” | “What was the reason for the 5-second wait? Could expect(...).toBeVisible() replace it?” |
| Ten comments on style | Agree on a formatter and linter; let tools handle style |
| Blocking on personal preference | Prefix optional ideas with “nit:” (minor) or “optional:” |
| Reviewing 2,000 lines at once | Ask for smaller PRs |
Praise good work too: “Nice use of a fixture here, much cleaner.”
๐ค Automating the Boring Parts
- CI checks run tests and linters on every PR (GitHub Actions).
- Required status checks block merging until they pass.
- Dependabot and code scanning add security reviews (security tools).
- GitHub Copilot can produce a first-pass review and PR summaries (Copilot); a human still owns the decision.
๐ Assignment
- Ask a friend (or use a second GitHub account) to open a PR on your
git-practicerepository, or open one yourself. - Review it with Start a review: add at least one multi-line comment and one suggestion.
- Submit a Request changes review, then fix the issues as the author and Re-request review.
- Commit a reviewer’s suggestion directly from the PR page.
- Approve the PR and merge it.
- Write a short code review checklist for your own team or test project.
โ FAQ
๐ค How do I review a pull request on GitHub?
Open the PR, go to Files changed, comment on lines (using Start a review), then click Finish your review and choose Comment, Approve or Request changes.
๐ค How do I suggest a change in a GitHub review?
In a line comment, click Add a suggestion, edit the proposed code, and submit. The author can apply it with Commit suggestion.
๐ค What is the difference between Comment, Approve and Request changes?
Comment gives feedback without a decision, Approve signals it is ready to merge, and Request changes asks for fixes and can block merging.
๐ค How do I re-request a review?
On the PR’s Conversation tab, click the circular arrow next to the reviewer’s name in the Reviewers section.
๐ค Should testers do code reviews?
Yes. Reviewing PRs lets testers spot missing test cases and risky changes early, and test automation code itself needs review like any other code.
๐ฏ Next Steps
- ๐ด Fork a Repository and Contribute to Open Source
- ๐๏ธ GitHub Issues, Labels and Projects
- ๐ Git and GitHub Tutorial: full course
๐ฌ Learn Git and GitHub step by step: watch the series on YouTube!
Subscribe to SqaToolsByDY • Practice on sqatools.in
2 thoughts on “Code Review on GitHub: Review Pull Requests Like a Professional”