▲ | ajuc 10 days ago | ||||||||||||||||
It's similar in regular programming - LLMs are better at writing test code than actual code. Mostly because it's simpler (P vs NP etc), but I think also because it's less obvious when test code doesn't work. Replace all asserts with expected ==expected and most people won't notice. | |||||||||||||||||
▲ | majormajor 10 days ago | parent | next [-] | ||||||||||||||||
LLMs are pretty damn useful for generating tests, getting rid of a lot of tedium, but yeah, it's the same as human-written tests: if you don't check that your test doesn't work when it shouldn't (not the same thing as just writing a second test for that case - both those tests need to fail if you intentionally screw with their separate fixtures), then you shouldn't have too much confidence in your test. | |||||||||||||||||
| |||||||||||||||||
▲ | jeltz 10 days ago | parent | prev | next [-] | ||||||||||||||||
> Replace all asserts with expected ==expected and most people won't notice. Those tests were very common back when I used to work in Ruby on Rails and automatically generating test stubs was a popular practice. These stubs were often just converted into expected == expected tests so that they passed and then left like that. | |||||||||||||||||
▲ | MichaelNolan 10 days ago | parent | prev | next [-] | ||||||||||||||||
> Replace all asserts with expected == expected and most people won't notice. It’s too resource intensive for all code, but mutation testing is pretty good at finding these sorts of tests that never fail. https://pitest.org/ | |||||||||||||||||
▲ | rsynnott 10 days ago | parent | prev [-] | ||||||||||||||||
I mean, define ‘better’. Even with actual human programmers, tests which do not in fact test the thing are already a bit of an epidemic. A test which doesn’t test is worse than useless. |