> TDD shifts this definition subtly, but importantly. The > definition I proposed for the term unit test was the > tightest definition: a unit is the smallest > bit of code that can be tested, thus a test is only a unit > test if it tests the smallest bit of code that can be > tested (usually a class via its public methods; this was a > Java project).
It's just nit picking but I'm not sure the use of smallest here is quite correct. Most TDD tests test individual methods (or functions) not classes, thus the smallest unit of code being tested is the method.
It then gets rather vague: Since most methods require more than one test for complete coverage it becomes apparent that any given test may be only part testing a particular method. Therefore the granularity is smaller still, except that an external test cannot see anything smaller than the method signature and therefore cannot 'know' to what extent the test fully or partially tests the method in question.
Flat View: This topic has 50 replies
on 51 pages
[
«
|
202122232425262728
|
»
]