Created
October 23, 2010 16:20
-
-
Save searls/642384 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package searls.dougu.examples; | |
public class Wallet { | |
private int dollarCount; | |
public void insertDollars(int numberOfDollars) { | |
for(int i=0;i<numberOfDollars;i++) { | |
putADollarInThatWallet(true); | |
} | |
} | |
void putADollarInThatWallet(boolean alwaysTrue) { | |
if(!alwaysTrue) { | |
//Maybe I had fun test-driving a whole bunch of logic in here! | |
//Too bad it's effectively unreachable by production code | |
//And missing code coverage can't tell me this might be dead code | |
} | |
//Oh, and good luck refactoring this method, since | |
//our test code is now tightly coupled to this implementation | |
dollarCount++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment