Questions: For the subsequent questions (a)-(c), consider the method FSM for a (simplified) programmable thermostat. Suppose the variables that define the state and the methods that transition between states are:
partOfDay : {Wake, Sleep}
temp : {Low, High}
// Initially "Wake" at "Low" temperature
// Effects: Advance to next part of day
public void advance();
// Effects: Make current temp higher, if possible
public void up();
// Effects: Make current temp lower, if possible
public void down();
Question 1: How many states are there?
Question 2: Draw and label the states (with variable values) and transitions (with method names). Notice that all of the methods are total.
Question3: A test case is simply a sequence of method calls. Provide a test set that satisfies edge coverage on your graph.
Answer these questions and show each and every step with example.