Top
Best
New

Posted by Klaster_1 4 days ago

Bombadil: Property-based testing for web UIs(github.com)
196 points | 76 commentspage 2
wittjeff 3 hours ago|
From your title my immediate thought was "cool, maybe this will move us a bit closer to making components (or the testing thereof) cover accessibility thoroughly by default".

See, the idea with the semantic web, and the ARIA markup equivalents, is that things should have names, roles, values, and states. Devs frequently mess up role/keyboard interaction agreement (example: role=menu means a list will drop on Enter keypress, and arrow keys will change the active element), and with ensuring that state info (aria-expanded, aria-invalid, etc.) is updated when it should be.

Then I checked the Antithesis website. They don't even have focus state styling on any of the interactive elements. sigh

terpimost 2 hours ago|
Hey, sorry for antithesis.com. Thank you for noticing this!

The bug is subtle: we do have styles for that, but in some change which I probably did we use css variable, which isn't there...

We will fix that soon.

picardo 6 hours ago||
For most static UI surfaces, I probably wouldn't use it, but I can see a use case in this for testing generative UI workloads.
owickstrom 6 hours ago|
Sure, server-side or client-side generated UIs tend to have a lot more interesting complexity to test. But I do want to bring up that with the specification language being TypeScript, you can validate some basic properties even for statically generated sites. I wrote a spell checker for Bombadil that uses https://github.com/wooorm/nspell and a custom dictionary and found a bunch of old typos on my own blog.
sequoia 7 hours ago||
Struggling to understand what this is or how it works.
owickstrom 4 hours ago|
Did you have a look at the intro in the manual? https://antithesishq.github.io/bombadil/1-introduction.html

If that's not clear, please let me know how we can improve it!

maxwg 2 minutes ago|||
> Bombadil itself decides what is an interesting event and when to capture state.

It would be very nice to have a little more details on how this works. Though I guess we can figure it out via code/trialing it out.

I'll give it a go later today!

darkvertex 3 hours ago|||
A hello-world example of what it looks like, and what running it would validate, would be nice.

It's all very abstractly described in the README and that intro page you linked.

owickstrom 2 hours ago||
Fair enough! I'm probably doing a demo video that'd help with this. Maybe can condense that in text form into the readme as well.
css_apologist 6 hours ago||
very cool! does this work? can you describe the kinds of real bugs you've caught with this?
owickstrom 6 hours ago|
I'd say it does! Bombadil is very new but its predecessor has found complicated and very real bugs in my work projects, and in the paper we wrote about it, we found bugs in more than half of the TodoMVC example apps: https://arxiv.org/abs/2203.11532
Darmani 2 hours ago||
Timely! I spent a good chunk of yesterday investigating Bombadil. I'm a huge fan of PBT and a huge fan of temporal logic (though not linear temporal logic) and we're currently trying to level up our QA, so it seemed like a good match.

Unfortunately, I concluded that Bombadil is a toy. Not as in "Does some very nice things, but missing the features for enterprise adoption." I mean that in a very strong sense, as in: I could not figure out how to do anything real with it.

The place where this is most obvious is in its action generator type. You give it a function that generates actions, where each action is drawn from a small menu of choices like "scroll up this many pixel" or "click on this pixel." You cannot add new types of actions. If you want to click on a button, you need it to generate a sequence of actions to first scroll down enough, and then look up a pixel that's on that button.

Except that it selects actions randomly from your list, so you somehow need the action generator, when run the first time, to generate only the scroll action, and then have it, when run the second time, generate only the click action. If you are silly enough as to have an action generator that, you know, actually gives a list of reasonable actions, you'll get a tester that spends all its time going in circles clicking on the nav bar.

(Something in the docs claimed that actions are weighted, but I found nothing about an actual affordance for doing that. Having weights would make this go from basically impossible to somewhat impossible.)

(Edit: Found the weighted thing.)

I am terrified to imagine how to get Bombadil to fill out a form. At least that seems possible -- you can inspect the state of the web page to figure out what's already been filled out. But if you want the state to be based on anything not on the current page, like the action that you took on the previous page, or gasp the state on disk (as for an Electron app), that seems completely impossible. Action generators are based on the current state, and the state must be a pure function of the web page.

Its temporal logic has a cool time-bounded construct, but it's missing the U (until) operator. One of their few examples is "If you show the user a notification, it disappears within 5 seconds." But I want to say "When you click the Generate button, it says 'Generating...' up until it's finished generating." And I can't.

(Note: everything above is according to the docs. Hopefully everything I said is a limitation of the docs, not an actual limitation of the framework.)

I shared my comments with the author yesterday on LinkedIn, but he hasn't responded yet. Maybe I'll hear from him here.

I have a pretty positive opinion of Antithesis as a company and they seem to be investing seriously in it, and generally see it as a strong positive sign when someone knows what temporal logic is, so I have hopes for this framework. I am nonetheless disappointed that I can't use it now, especially because I was supposed to finish an internal GUI testing tool this week and my god I'm behind.

owickstrom 31 minutes ago|
Hey, yeah, so actions are indeed independent and you can't express fixed sequences of them (e.g. fill out thus form by doing X, then Y, then Z). If you want to enforce certain sequentiality you'd need to precondition your generators. This is admittedly limited right now. I do want to add QoL things like `filter` on the generators to make that more ergonomic.

Also, as you note, you can't implement custom actions. And that's just something that I haven't gotten to yet. It'd be quite straightforward to add a plain function (toStringed) as one of the variants of the Action type and send that to the browser for eval. (Btw, we're taking contributions!)

Weighting is also important right now. There's no smart exploration in Bombadil yet, only blind random, so manual weighting becomes pretty crucial to have more effective tests (i.e. unlikely to run in circles). I'd like to both make the Bombadil "fuzzer" better at this, but eventually you might want to run Bombadil inside Antithesis instead to get a much better exploration, even in a single campaign.

The Until operator is also one of those things that I haven't gotten to yet. I actually didn't expect someone to hit this as a major limitation of the tool so quickly, which is why I've focused on other things. Surprising!

To add some more context, Bombadil is an OSS project with one developer (but we're hiring!) and it's 4 months old and marked experimental. I'm sorry you were disappointed by its current state, but it's very early days, so expect a lot of these things to improve. And your feedback will be taken into account. Thanks!

orliesaurus 7 hours ago||
Bombadillo Crocodillo

Ok I will see myself out

(Yes I know it's actually from the Tolkien book)

NoraCodes 7 hours ago||
My kingdom for a way to stop this godforsaken industry from stripping Tolkien's fiction for parts.
magicalhippo 4 minutes ago||
Indeed. Why not follow Douglas Adams' example and use obscure place names instead[1].

[1]: https://en.wikipedia.org/wiki/The_Meaning_of_Liff

nosman 5 hours ago|||
The bad guys are using Tolkien references. The good guys are probably using Hitchhiker's Guide references...
jkestner 6 hours ago|||
Let's start naming things after Iain Banks ships.
patapong 6 hours ago|||
I am in support. In general he was really good with names I thought, they always had an otherwordly flair while being clear to pronounce. Skaffen-Amtiskaw, Anaplian, Elethiomel...
chrisweekly 6 hours ago||
Yes!

"Just Another Victim Of The Ambient Morality" is one of my favorites.

nozzlegear 5 hours ago|||
Elon Musk has already had a head start on that idea for over 10 years, unfortunately:

https://scifi.stackexchange.com/q/81164

rienbdj 3 hours ago||
Weird - Iain m Banks would’ve found Musk’s politics abhorrent
akshayshah 6 hours ago|||
To be fair, the name was a joking response to https://x.com/patrickc/status/2015562569105465347…and then the temporary skunkworks name stuck, as it always does.
bevr1337 2 hours ago|||
The AI generated illustration and satire of the poem hurt my soul. Tom doesn’t even have pupils! This output is low quality even for AI generated content.
pythonaut_16 6 hours ago|||
Makes me want to name a project or company Sauron in response.
terpimost 6 hours ago|||
The Eye of Sauron for some Observability tool
dymk 5 hours ago||
Palantir
ffsm8 6 hours ago||||
I've worked at a company that had a team call themselves Sauron before

So occasionally I got mails by "some colleague on behalf of Sauron" back then

object-a 5 hours ago|||
https://www.sauron.systems/
threatofrain 5 hours ago|||
All the companies you’re thinking of are likely paying the Tolkien estate a very fat fee. This repo will likely have to rename.
NoraCodes 5 hours ago||
Yeah. Unfortunately the people running the estate today appear to share ~none of the late Professor's values.
testdelacc1 5 hours ago|||
I do appreciate you quoting Shakespeare.
eclectician 6 hours ago|||
We can go strip Shakespeare instead.
el_nahual 5 hours ago||
(For those who don't get it, "My kingdom for ___" is from Richard III: "my horse, my horse, my kingdom for a horse")
jzelinskie 6 hours ago|||
I'm just waiting for them to exhaust LotR and move on to Roverandom
sifar 5 hours ago|||
No, not bombadil. I'll donate mine too. :)
paulnpace 6 hours ago|||
Bad actors use Tolkien. Good actors use Orwell.
catlover76 6 hours ago||
[dead]
_doctor_love 5 hours ago||
[dead]