Repository navigation
Replies: 1 comment
|
thanks @dubzzz so much for posting this suggestion. As someone who has only vaguely made efforts at TDD in the past, since I was hand-writing all the code (which I know doesn't excuse it), I know am faced with being pushed to use Claude Code at work in my data engineering job. The example I always gave to folks in the past when purists TDD proponents insisted that "all you need is good tests" was parsing the table names from a SQL query. The myriad of ways to write SQL in my mind would require hundreds or thousands of tests to ensure that the correct table names were being parsed and the incorrect ones (e.g. in a comment or a CTE name) were not. However, some TDD things I have read lately convinced me that using Property based testing along with Mutation testing may actually make this example possible (i.e. where I would never actually inspect the code the AI generates, but am as close to 100% confident in the quality as I would be if I carefully wrote it by hand). Not being an expert in TDD, I would lean on folks like yourself to help us enhance this /tdd skill so that it would do these things. I still wonder though if we should inspect the tests to be sure the guidelines in the skill were adequately followed. BTW, it seems like most the the "great" TDD books were written years ago - does anyone know of any recent great ones that discuss Property Based testing and Mutation testing in the context of the current development frameworks? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Property-Based Testing is a well suited way to assess the What of an algorithm. The aim of this technique is to abstract the checks from hardcoded values and rather check invariants. Having it as a recommendation when thinking about tests would probably be a good addition.
I could eventually link some guidelines I wrote on when PBT pays off versus when an example test is the better tool. Giving some pointers about good usages for such technique would be awesome for designing better tests.
About me: I'm the author of fast-check, the leading Property-Based Testing library in JavaScript. I'm a strong believer that Property-Based Testing is not as used and recommended as it should be.
All reactions