write more tests but I don't get any practical value from them. It takes too much time, or it is too hard. Therefore I don't enjoy it or stopped doing it. (I totally understand that!) 4 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
tests. Do not waste your time with unit tests. (at least they are writing tests!) 5 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
In setup: Creation method for fresh xture Finder method for shared xture In veri cation: Custom assertion method 28 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
matches($other) { return $other === 42; } protected function failureDescription($other) { return sprintf( "%s is not the meaning of life, the universe and everything", $other ); } } 30 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
creation methods or assertions with relevant parameters For xtures: Test data builder 36 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
test data (foo, bar, 1, 42) is unclear Possible solutions Introduce variables or constants 38 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
on information that's not visible in the test Filename Database record General xture 39 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
else editing external source without knowing how it's used Possible solutions Fresh xture for each test Test data builders instead of xture scripts Create les in test For shared xture: Accurately named nder methods 42 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
methods Clear phases: setup (given), exercise (when) and veri cation (then) Convert variables ($savedStockItem) to properties Additional methods can also start with and_ 46 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
Possible solutions Use real domain objects where possible Refactor production code Use custom stub or fake objects with simpler setup 48 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
meaningful test names Use named keys in data provider arrays return [ 'meaningful description of case 1' => [ ... ], 'meaningful description of case 2' => [ ... ], ] 53 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
test correctly Possible solutions Write separate test cases, extract duplicated logic Make sure, tests are deterministic 57 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler
by taking care of the test architecture. Watch out for these typical problems. Get rid of them. 59 / 60 #MM18PL Fabian Schmengler /> Dealing With Testing Fatigue @fschmengler