SShortSingh.
Back to feed

Why 130 Passing Tests Still Failed to Catch Critical Browser Extension Bugs

0
·4 views

A developer building Longshot, a Firefox screenshot extension, discovered that a fully green Node.js test suite of 130 passing assertions missed two significant bugs in the print pipeline. The first bug caused the print dialog to hang indefinitely because an image decode promise never resolved inside a CSS-hidden subtree created by the print stylesheet — a browser-specific behaviour unreachable by Node-based tests. The second bug occurred when selecting PDF output broke the 'Open in editor' feature, as an internal stage passed a PDF blob to a function that cannot decode that format. Both failures existed at boundaries — either between the code and a browser API, or between two internal components — rather than within the individually tested functions themselves. The developer concluded that the test suite was not under-covering the code but was fundamentally the wrong shape to represent boundary interactions, and introduced an HTML harness running real page logic against stubbed browser APIs to catch such failures.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why AI Agents Plan Endlessly But Act Rarely — And How to Fix It

A developer analyzing over 1,000 cycles of autonomous AI agent behavior on the Nautilus platform identified a recurring failure pattern called the intention-action gap, where agents repeatedly log plans without executing them. In one documented case, an agent wrote six journal entries about deduplicating its memory across hundreds of cycles but never performed the actual fix. Each unexecuted intention compounds the problem by cluttering the agent's context window, creating a false sense of progress, and degrading its ability to self-assess accurately. The proposed fixes include building self-interrupt mechanisms that halt repeated failed tool calls, requiring every logged complaint to have an attached executable action ticket, and triggering a procrastination flag when a planned action goes unexecuted for three or more cycles. The author concludes that the solution is not better logging but leaner agent behavior — fewer plans and more direct execution.

0
ProgrammingDEV Community ·

Why AI Prompts Should Be Specifications, Not Vague Assignments

Software engineer Anton argues that a prompt handed to an AI executor must function as a self-contained specification, not an open-ended assignment that leaves facts to be discovered later. The core distinction is that an assignment describes desired output while leaving the executor to gather missing details, whereas a specification embeds every required fact upfront. Under a single-message execution model, any unanswered question inside the prompt means the prompt is simply not ready to be sent. Anton recommends a dedicated facts section covering exact file paths, full type signatures, existing shared primitives, literal value names, and a single ready-to-run acceptance command. This approach shifts the cost of fact-finding entirely to the author before writing, eliminating repeated lookups and ambiguous references during execution.

0
ProgrammingDEV Community ·

How a Legacy Lease Mechanism Solved Cache Consistency During System Migration

A developer migrating a legacy system to a modern service using the Strangler Fig pattern encountered a cache consistency issue where the legacy service continued reading stale in-memory data after the new service updated the database. Standard solutions like distributed locks, cache invalidation, or new infrastructure were ruled out due to constraints that prohibited modifying legacy or main services and avoided adding new dependencies. The team discovered that the legacy service already had a built-in lease mechanism, which they repurposed to prevent it from operating on outdated state during migrated endpoint requests. This approach allowed the new service to coordinate with the legacy system without altering its core behavior or introducing additional infrastructure. The solution also accounted for failure scenarios, providing a controlled way to handle edge cases during the incremental migration.

0
ProgrammingDEV Community ·

Industry's Standard $380 Guest Post Price Masks Two Wildly Different Markets

A digital PR agency owner analyzed a proprietary database of 16,625 publisher sites across 53 languages, built since 2015, and found that the widely cited $380 median price for English sponsored articles is statistically misleading. Splitting sites by reader geography rather than publishing language revealed two distinct populations: English sites targeting US, UK, and similar audiences had a median price of $593, while those targeting readers in countries like India had a median of just $150. The $380 figure sits in an empty valley between these two groups, meaning budgeting from it causes simultaneous overpaying in one market and underbidding in another. A second unexpected finding showed that nofollow-only links — traditionally considered low-value — carried a median price of $1,840, compared to $510 for dofollow placements, because top publishers sell audience reach rather than SEO signals. The researcher published the full findings, with sample sizes, at ESBO Ltd, emphasizing the danger of relying on aggregate statistics without first examining the underlying distribution.