this post was submitted on 06 Nov 2024
15 points (100.0% liked)

Opensource

7 readers
2 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.

top 1 comments
sorted by: hot top controversial new old
[–] nous@programming.dev 3 points 1 week ago* (last edited 1 week 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.