// GoodFastCheap: Investigating graph testing with an old engineering joke public final class GoodFastCheap { boolean good = false; boolean fast = false; boolean cheap = false; public void makeGood () { good = true; if (fast && cheap) { cheap = false; } } public void makeFast () { fast = true; if (good && cheap) { good = false; } } public void makeCheap () { cheap = true; if (fast && good) { fast = false; } } public void makeBad () { good = false; } public void makeSlow () { fast = false; } public void makeExpensive () { cheap = false; } public boolean isSatisfactory() { if ((good && fast) || (good && cheap) || (fast && cheap)) { return true; } return false; } }Try to identify a state space suitable for a graph model from the instance variables in this program.
Identify the transitions in this state space. To make this easier, start by ignoring the methods that make things worse.
Choose a coverage criterion and develop tests that satisfy the criterion.
Note: When we get to logic coverage we'll look at when each clause determines the value of a predicate.