Hacker News new | ask | show | jobs
by pydry 1621 days ago
Nobody can agree on what a unit test is either. I've seen people say that:

* If it uses an xUnit framework it's a unit test.

* That since the whole application constitutes a unit then a test for the whole application is a unit test.

* That anything that doesnt use the UI is a unit test.

Both names should be trashed, IMO. They both lack clear boundaries.

1 comments

I wholeheartedly agree that people can't agree on what "unit test" means precisely, either (even though I think your specific examples are a bit disingenuous). In particular, classical and London-school / mockist TDD have rather different definitions of it.

That's why it's important to have a well-rounded test strategy with different types of tests that have different purposes, instead of using some blanket approaches.

How on earth are they disingenuous?
I've never heard anyone call a test for a whole application a "unit test".
It happened to me once on hacker news. His point that was any size could be considered a "unit". Which is true, I suppose.

Also for some small command line applications.