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

  • nous@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    6 days 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.