3 ms·
Elementary tests, like unit tests, should be mecanically generated by walking the AST, differences ack`d and snapshoted when commiting. Every language should co
by gxt 3y ago
Elementary tests, like unit tests, should be mecanically generated by walking the AST, differences ack`d and snapshoted when commiting. Every language should come with this built-in.
- superb_dev 3y agoWhat exactly are we testing at that point?
- Groxx 3y agoEnsuring that `if x == 1` works when x == 1. Very important. Very valuable. Imagine if `if err != nil { return err }` just stopped working tomorrow. Your tests would detect it! Outage prevented!
- Cthulhu_ 3y agoYou're being sarcastic but honestly, I've never found a regression because of a unit test. Only past few days though, I did find two bugs that would've been prevented if the original code was covered by a decent unit test.
- sangnoir 3y ago> You're being sarcastic but honestly, I've never found a regression because of a unit test So you've never made a change caused a unit test to fail? If not, how large is your codebase, and is ownership shared across multiple teams? I caught dozens of latent or unreported bugs by writing unit tests for a 6kloc JS app which had 0% coverage before.
- cgdub 3y agoI don't write Perl or Ruby anymore, but this would have been immensely helpful back then.
- bluefishinit 3y agoThis is called compiling with a type system.
- gxt 3y agoBeyond the type system, you're snapshoting exact behavior. Differences between x = y, and 2x=y that the types don't encapsulate, even in rust.