News for hackers. Stuff that matters.
Re:Is TDD Dead? (2014) by u801e on Wednesday August 26, 2020 @11:04AM (#24283088)
> When people talk about "unit tests", a unit doesn't refer to the common pattern of "a single class". A unit is a piece of the software with a clear boundary. It might be a whole microservice, or a chunk of a monolith that is internally consistent.

Every example I've read pertaining to unit testing uses a function as the unit to test. The easiest functions to test are ones that don't have side-effects (network, I/O, disk, etc). Could you point me to an example where a unit test applies to something beyond a function?

Re:Is TDD Dead? (2014) by pydry on Wednesday August 26, 2020 @11:11AM (#24283152)
This bugs me as well. The people who argue about whether unit tests works will often redefine "unit" to mean anything from "the entire application" to a single function.

Colloquially, however, anything above the level of a self contained function or class is called something else - typically an integration test.

Re:Is TDD Dead? (2014) by UK-Al05 on Wednesday August 26, 2020 @05:14PM (#24287359)
Unit tests, integration tests were never fully defined that well. They change based on who you talk to. Especially integration tests.

Better definition is the small, medium and large tests from Google's testing blog.

Re:Is TDD Dead? (2014) by bmh100 on Wednesday August 26, 2020 @11:13AM (#24283172)
I've used unit tests on attributes and methods of a mock class instance, in order to test the class's construction method.