You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is done. The above-linked issues and PRs fix this. Most of the work ended up not being in our repository.
Summary: AI saved a good amount of time here, but some of the most difficult steps required manual debugging, and some of the trivial fixes didn't benefit.
Ends in a number checker
whatwg/url#865 was my first test case, and I asked Cursor (Sonnet 3.5) to generate test inputs that would cause that line to get hit. It came up with the empty string. I asked for a more nontrivial input, and it was convinced there was no such input. I turned my brain back on and verified that indeed it was correct, so I opened the linked issue.
Setter tests
The biggest work item was the setter test coverage gap. Cursor helped me generate such tests. It was quite pleasant, as I was able to mostly turn off my brain and just say "find a test case that exercises this branch". For 5-6 branches that was all that was required. One branch it got wrong so I had to think a bit more deeply.
At that point I had some new test cases in mind and I wanted to get them running through our whole coverage pipeline to prepare for an upstream pull request. Cursor was again helpful here as I gave it the test cases in an imperative format that we'd generated earlier for rapid iteration, and told it to translate to the declarative format used by the test fixtures. But after running the coverage tool, I noticed that despite the new test cases, the coverage did not improve, with the same branches showing no coverage. A clue was that Cursor said, after adding those test cases, something like "I noticed the file already contains a lot of tests like this. It's good that we're testing these edge cases!" This was suspicious since I thought we were testing new cases that weren't covered.
At that point I resorted to very classic debugging, without any real AI assistance, stripping the test infrastructure down to just two test cases for URL setters. I quickly found that even with 2 test cases, only one was being run. The issue was that the test harness code was using var. I'd actually forgotten exactly why var caused these sorts of problems, but I knew it was likely the culprit, which I confirmed by changing from var to let. At that point I just asked cursor to modernize the test harness code entirely, which it did quickly. I also asked it to port over the modernization to an adjacent piece of test harness code that needed to be kept in sync. This definitely saved some time and tedium.
I then asked Claude Sonnet 3.7 (thinking) web version to explain the bug to me since I'd forgotten how exactly how vars were problematic, and it did, which helped me confirm this was the right fix.
The bug fix + modernization was submitted as web-platform-tests/wpt#51369. I've verified locally that it fixes the problem, and dramatically increases coverage, using just the existing corpus. So I didn't need to add any new tests for the URL setters after all.
URL.canParse() bad base URL case
web-platform-tests/wpt#51370 didn't get any real help from AI. The only nontrivial part was determining why the existing test cases didn't cover this, which I spent 1 minute scrolling around and thinking about. After that it was only a couple of lines to fix because it was obvious how to trigger this branch.
Dead code removal
#294 didn't really get any help from AI. Most of the time spent here was scrolling desparately through multiple codebases trying to find if any of the current jsdom corpus uses this code in some way. Simple Ctrl+F on key strings was enough; asking the AI to check my codebase didn't seem like it would add anything.
Activity
Remove dead code in urlencoded serializer
Remove dead code in urlencoded serializer
domenic commentedon Mar 15, 2025
This is done. The above-linked issues and PRs fix this. Most of the work ended up not being in our repository.
Summary: AI saved a good amount of time here, but some of the most difficult steps required manual debugging, and some of the trivial fixes didn't benefit.
Ends in a number checker
whatwg/url#865 was my first test case, and I asked Cursor (Sonnet 3.5) to generate test inputs that would cause that line to get hit. It came up with the empty string. I asked for a more nontrivial input, and it was convinced there was no such input. I turned my brain back on and verified that indeed it was correct, so I opened the linked issue.
Setter tests
The biggest work item was the setter test coverage gap. Cursor helped me generate such tests. It was quite pleasant, as I was able to mostly turn off my brain and just say "find a test case that exercises this branch". For 5-6 branches that was all that was required. One branch it got wrong so I had to think a bit more deeply.
At that point I had some new test cases in mind and I wanted to get them running through our whole coverage pipeline to prepare for an upstream pull request. Cursor was again helpful here as I gave it the test cases in an imperative format that we'd generated earlier for rapid iteration, and told it to translate to the declarative format used by the test fixtures. But after running the coverage tool, I noticed that despite the new test cases, the coverage did not improve, with the same branches showing no coverage. A clue was that Cursor said, after adding those test cases, something like "I noticed the file already contains a lot of tests like this. It's good that we're testing these edge cases!" This was suspicious since I thought we were testing new cases that weren't covered.
At that point I resorted to very classic debugging, without any real AI assistance, stripping the test infrastructure down to just two test cases for URL setters. I quickly found that even with 2 test cases, only one was being run. The issue was that the test harness code was using
var. I'd actually forgotten exactly whyvarcaused these sorts of problems, but I knew it was likely the culprit, which I confirmed by changing fromvartolet. At that point I just asked cursor to modernize the test harness code entirely, which it did quickly. I also asked it to port over the modernization to an adjacent piece of test harness code that needed to be kept in sync. This definitely saved some time and tedium.I then asked Claude Sonnet 3.7 (thinking) web version to explain the bug to me since I'd forgotten how exactly how
vars were problematic, and it did, which helped me confirm this was the right fix.The bug fix + modernization was submitted as web-platform-tests/wpt#51369. I've verified locally that it fixes the problem, and dramatically increases coverage, using just the existing corpus. So I didn't need to add any new tests for the URL setters after all.
URL.canParse() bad base URL case
web-platform-tests/wpt#51370 didn't get any real help from AI. The only nontrivial part was determining why the existing test cases didn't cover this, which I spent 1 minute scrolling around and thinking about. After that it was only a couple of lines to fix because it was obvious how to trigger this branch.
Dead code removal
#294 didn't really get any help from AI. Most of the time spent here was scrolling desparately through multiple codebases trying to find if any of the current jsdom corpus uses this code in some way. Simple Ctrl+F on key strings was enough; asking the AI to check my codebase didn't seem like it would add anything.