If we made testing a language's first class citizen

1 points by jlebrech ↗ HN
we'd be able to live code everything we make, by requiring a mock and expectations for every class we should be able to see output live as we code.

yes some already (Golang or D) do this and they should be able to run their tests inline with a pretty editor to create an live-code-esque environment.

2 comments

[ 5.8 ms ] story [ 20.6 ms ] thread
This is already a thing. It's in the form of static typing and runtime type-checking. If you use one (or both) properly in a language that supports them, you'll end up needing nearly zero unit tests, and you can focus on integration tests.
I think unit tests are good to make sure code has proper logic. all types could be used properly yet it doesn't behave as intended.

I'm not sure how it would look but maybe declaring methods using demo literals and ending them with an expectation could be the way to go.