Urgent.News

What's breaking now, across thousands of outlets.

Tech

AI Coding Tip 037 - Stop Patching Blind

Patch code that never had a test written for it, and every quick fix becomes tomorrow's outage

AI Coding Tip 037 - Stop Patching Blind

Many legacy codebases lack automated tests, leaving patches to be applied blindly. When a patch is applied without tests, any subsequent outage or issue is difficult to trace back to the specific change. This is why Microsoft shipped a security update for Excel that broke paste operations in various versions of the software. The patch triggered issues only when the workbook contained conditional formatting.

Users reported unexpected behavior, but no one had written tests for this conditional formatting code path. An AI-generated patch is fast, but it cannot verify the old code's behavior, leading to hidden damage. Characterization tests can record the module's current behavior before making changes, providing a specific, checkable claim about what still works.

By adding these tests to the pipeline, the regression under the same conditions will not depend on a user noticing it first. This helps ship patches with evidence, shrink the blast radius, and turn legacy code into safe territory.

Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at hackernoon.com →

More in Tech

JavaScript Array Methods

JavaScript has its own set of methods built into the language that allow developers to efficiently interact with arrays. JavaScript allows us to do such operations as adding, removing, updating or…

Iniciando meus estudos em Event Loop

✨♻️ JavaScript Visualized: Event Loop Lydia Hallie Lydia Hallie Lydia Hallie Follow Nov 20 '19 ✨♻️ JavaScript Visualized: Event Loop # javascript # webdev

More from Sunday 20 September →