CSE Roadmap

Specialist tier · about 5 hours · 13 parts

Part 10 of 13 · 2 min read

Mistakes that sink a contribution

Common mistakes, and what the example does not do.

Mistakes that sink a contribution

  • A giant pull request that mixes a fix, a refactor and a reformat.
  • No test, or a test that does not fail on the old code.
  • Editing the old tests to make your change pass.
  • Opening a pull request without reading the contributing guide.
  • Leaving debug output or generated files in the diff.
  • Ignoring review comments or arguing about style.
  • Submitting code you do not understand, including AI-written code.
  • Claiming credit for the project in an interview.

What the example does not do

About this example What the example does not do
  • One toy repository: three hand-made branches, not a sample of real pull requests.
  • Heuristic thresholds: the 400-line, 25 percent and 3-area limits are the example's own, and the formatting rule has a minimum hunk size and a similarity threshold chosen for the example.
  • No semantic check: the tool cannot tell a breaking change, a missing edge case or an irrelevant test.
  • No social side: discussion, tone and maintainer preferences are not modelled.
  • Optional real experiment: find a documentation or test issue in a project you use, make the change, and record how long review took and what the maintainers asked for.

Check yourself

Why does a pull request need a test that fails before the fix and passes after?

Show answer

It proves the change fixes the bug. In the toy exercise the new tests failed on main (2 failed) and passed on the fixed branch (5 passed); the no-test fix passed too, so it was correct but unproven.

For the curious Review cost is the currency

A minimal fix with a regression test changed 22 lines in 2 files; a bloated version of the same fix changed 51 lines in 3 files because it also reformatted a module, renamed a function and left a debug print. The checker flagged the churn and the leftover print, but one flag was a false alarm and it could not see the breaking rename. The repository is a tiny fictional one, so the absolute numbers prove nothing, only the ratio of fix to noise.

What you will use daily at work

Practice What it looks like
Read the contributing guide and licence first Also the code of conduct and any AI-assistance policy.
Make one small change linked to an issue With a test that fails before and passes after.
Keep renames and reformatting in separate pull requests Review cost is the currency.
Respond to review quickly Say precisely what you changed.