Anti-patterns
- Having test cases depend on system state manipulated from previously executed test cases (i.e., you should always start a unit test from a known and pre-configured state).
- Dependencies between test cases. A test suite where test cases are dependent upon each other is brittle and complex. Execution order should not be presumed. Basic refactoring of the initial test cases or structure of the UUT causes a spiral of increasingly pervasive impacts in associated tests.
- Interdependent tests. Interdependent tests can cause cascading false negatives. A failure in an early test case breaks a later test case even if no actual fault exists in the UUT, increasing defect analysis and debug efforts.
- Testing precise execution behavior timing or performance.
- Slow running tests.
References:
testthat: Get Started with Testing @Article{testthat,
author = {Hadley Wickham},
journal = {The R Journal},
month = {June},
number = {1},
pages = {5––10},
title = {testthat: Get Started with Testing},
volume = {3},
year = {2011},
}
M. Burger, K. Juenemann, and T. Koenig. RUnit: R Unit test framework, 2009. URL http://CRAN. R-project.org/package=RUnit. R package ver- sion 0.4.22.
xUnit reference?