“Unit” tests?
-
-
The term "unit test" seems to be somewhat flexible. Where I work now, a "unit" is a feature. So a Unit Test is... a test. In one place I worked, I was the "unit" that was going to do the testing.
-
The best developers test their units often. Unit Testing is the testing of a unit -- often one library function. Integration testing is testing to be sure the newly changed unit works within a larger unit. Regression testing is testing performed in production.
-
If I can put the code in a library, the tests against that code are unit tests. (If not, they are "wishful thinking" tests. :) )
-
The term "unit test" seems to be somewhat flexible. Where I work now, a "unit" is a feature. So a Unit Test is... a test. In one place I worked, I was the "unit" that was going to do the testing.
-
IMO if you're going to split tests into different buckets, arguing unit vs integration vs etc as people with too much time on their hands do the useful distinction is how fast they execute and where/when they're run. Unless you're building a huge system using all of these buckets are probably excessive but: 0) Fast enough to run on each developer build. 1) ... on the developers machine before committing. 2) ... by the CI server after commit but before merging. 3) ... by the CI server less frequently (hourly? daily? weekly?) on the CI server and potentially limited to major branches (eg alpha, beta, release)
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt
-
The best developers test their units often. Unit Testing is the testing of a unit -- often one library function. Integration testing is testing to be sure the newly changed unit works within a larger unit. Regression testing is testing performed in production.
PIEBALDconsult wrote:
The best developers test their units often.
Hopefully not as a dry run!
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010
-
The term "unit test" seems to be somewhat flexible. Where I work now, a "unit" is a feature. So a Unit Test is... a test. In one place I worked, I was the "unit" that was going to do the testing.
I recall Uncle Bob saying the term "unit" is unfortunate as some might look at classes as units. Some might even look at every method as a unit even non-public ones (in the pursuit of 100% coverage maybe?). At my workplace, we define a "unit" as a behavior. It might be one method, or one method using several auxiliary methods or even one class depends on its size and usage.