this post was submitted on 06 Nov 2024
21 points (95.7% liked)

Opensource

1405 readers
51 users here now

A community for discussion about open source software! Ask questions, share knowledge, share news, or post interesting stuff related to it!

CreditsIcon base by Lorc under CC BY 3.0 with modifications to add a gradient



founded 1 year ago
MODERATORS
 

Discovering your application by usecase validation. Make test writing fast, understandable by any human understanding English or French. Open source under MIT license.

you are viewing a single comment's thread
view the rest of the comments
[–] nous 3 points 2 weeks ago* (last edited 2 weeks ago)

Why do we need tests to be understandable by any human. IMO tests that go to that degree do so by obscuring what logic is actually running and make it harder as a developer to fully understand what is going on. I would rather just keep tests plain and simple with as few abstractions around them as possible.

Cypress cy.get('h1').contains('Result')
Playwright await expect(page.getByTitle('Result')).toHaveCount(1)
Testing library expect(screen.getByTitle(/Result/i)).toBeTruthy()

We can nit pick about syntax here and I prefer the cypress one as it immediately tells me what it is doing and I am not even familiar with those frameworks but:

UUV Then I should see a title named "Result"

That tells me nothing about what it is actually doing. How is the framework meant to interpret that or similar things? It is imprecise and I have no way to validate it will do what I expect it should. I do not trust AI or LLMs enough to translate that into a workable test. Even if it works for simple situations like this how does it grow to far more real and complex test cases?

It would be one thing to use a LLM to generate a test for you that you can inspect - but to generate it probably on every run quite likely without being able to see what it did? Um No thanks. Not with the current state of LLMs.

At least I assume it is LLM based as there is no other way to do this as far as I am aware, though they dont seem to mention it at all.