<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gabriel Holmes</title>
    <description>The latest articles on DEV Community by Gabriel Holmes (@gabrielholmesqa).</description>
    <link>https://dev.to/gabrielholmesqa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4012979%2Fc96ee13f-2878-452c-9012-8083dbacd9c4.png</url>
      <title>DEV Community: Gabriel Holmes</title>
      <link>https://dev.to/gabrielholmesqa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabrielholmesqa"/>
    <language>en</language>
    <item>
      <title>How to know which tests a PR will break — before CI runs</title>
      <dc:creator>Gabriel Holmes</dc:creator>
      <pubDate>Fri, 03 Jul 2026 05:00:53 +0000</pubDate>
      <link>https://dev.to/gabrielholmesqa/how-to-know-which-tests-a-pr-will-break-before-ci-runs-44b8</link>
      <guid>https://dev.to/gabrielholmesqa/how-to-know-which-tests-a-pr-will-break-before-ci-runs-44b8</guid>
      <description>&lt;p&gt;Every team has lived this: a pull request looks clean, gets approved, merges — and twenty minutes later the test suite is red. The change was in &lt;code&gt;src/&lt;/code&gt;. The failure is in &lt;code&gt;tests/&lt;/code&gt;. And nothing in the review surfaced the connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why code review misses it
&lt;/h2&gt;

&lt;p&gt;Code review shows you the diff. It does not show you what &lt;em&gt;depends on&lt;/em&gt; the diff. A reviewer reading a one-line selector rename has no way to know that three end-to-end specs select on that exact attribute — especially if those specs live in a folder they never open, or a repo they don't have checked out.&lt;/p&gt;

&lt;p&gt;So the breakage is discovered by the most expensive possible detector: a full CI run, after merge, by whoever is on call for the red build. The person with the most context — the author, mid-review — never saw it coming.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three ways teams try to close the gap
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Run the whole suite on every PR.&lt;/strong&gt; Correct, but slow and expensive, and it tells you &lt;em&gt;after&lt;/em&gt; the fact — you still wait for the red. On large suites it's minutes-to-hours of feedback latency per push.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Coverage-based test selection.&lt;/strong&gt; Map code to the tests that execute it and run only those. Powerful for unit tests, but it needs instrumentation, breaks down for E2E (where the "coverage" is a running browser), and says nothing across repo boundaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Static impact analysis at review time.&lt;/strong&gt; Read the diff, extract what it changes that tests depend on — selectors, routes, ids, visible text — and match those against the test files. This is cheap, needs no instrumentation, and runs the moment the PR opens.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "what tests depend on" actually means
&lt;/h2&gt;

&lt;p&gt;End-to-end and integration tests are coupled to the app through a small, identifiable set of anchors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Selectors / test ids&lt;/strong&gt; — &lt;code&gt;data-testid&lt;/code&gt;, &lt;code&gt;data-cy&lt;/code&gt;, &lt;code&gt;getByRole&lt;/code&gt;, CSS, XPath&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Routes&lt;/strong&gt; — URL literals the test navigates to or asserts on&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visible text &amp;amp; labels&lt;/strong&gt; — button copy, headings, aria-labels the test queries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Element ids and names&lt;/strong&gt; — the locators page objects hang off&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a PR changes one of these, any test referencing it is a break candidate. That's a tractable matching problem you can run in seconds — no test execution required.&lt;/p&gt;

&lt;p&gt;Want to see it on a real diff? I built a free scanner that runs this extraction entirely in your browser (nothing gets uploaded): &lt;a href="https://testward.app/diff-scanner" rel="noopener noreferrer"&gt;testward.app/diff-scanner&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The cross-repo blind spot
&lt;/h2&gt;

&lt;p&gt;Here's where it gets interesting for QA teams specifically. Many of us keep automation in a &lt;strong&gt;dedicated repo&lt;/strong&gt; — separate from the app it tests. Good hygiene, but it severs the only signal: the frontend dev's PR is green (no E2E tests live there), and the automation repo goes red hours later with no link back to the cause.&lt;/p&gt;

&lt;p&gt;Coverage tools, affected-test selectors, and CI test-splitting all operate within a single repo and a single test run. None of them can say "a change &lt;em&gt;here&lt;/em&gt; breaks a test &lt;em&gt;there&lt;/em&gt;."&lt;/p&gt;

&lt;h2&gt;
  
  
  How I automated this
&lt;/h2&gt;

&lt;p&gt;I'm a QA automation engineer, and this loop ate enough of my afternoons that I built a GitHub App for it — &lt;a href="https://testward.app" rel="noopener noreferrer"&gt;Testward&lt;/a&gt;. On every PR it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads the diff and extracts the anchors the change touches.&lt;/li&gt;
&lt;li&gt;Scans your test files — same repo, or a separately-linked automation repo (one line of config).&lt;/li&gt;
&lt;li&gt;Runs an LLM confirmation pass that names the specific specs likely to break and why.&lt;/li&gt;
&lt;li&gt;Posts one sticky comment: risk level, affected specs, reasons.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The reviewer sees the consequence next to the cause, while the author still has the context to fix it — or update the test in the same PR.&lt;/p&gt;

&lt;p&gt;Known limitation worth being upfront about: dynamic selectors (&lt;code&gt;`row-${id}`&lt;/code&gt;) can't be matched statically — that's the gap I'm working on. If your suite leans on template-literal test ids, the anchor model will miss those.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;You don't need to run tests to know a PR endangers them. The dependency between app code and test code is mostly &lt;em&gt;textual&lt;/em&gt; — selectors, routes, labels — and you can check it at review time, when the fix is cheapest. Whether you script it yourself or use a tool, moving that signal left is one of the highest-leverage things a QA team can do.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Questions or war stories about PRs silently breaking your suite? I'd genuinely like to hear them — especially from teams whose automation lives in a separate repo.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>qa</category>
      <category>automation</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
