The idea is to dynamically keep track of all group labels encountered
during test execution; an action that leads to a new group is prioritized over an action
that does not. Here the driving factor is coverage of new groups, and the search
space is pruned accordingly. The same idea can be applied to transitions.
12.6 Exercises
1. Correct the faulty bag implementation and rerun ct on it.
2. The custom strategy shown in Section 12.4 chooses an action with maximum
reward. Implement another SelectAction method that chooses an action with
probability that is proportional to the reward.
3. Implement a strategy for decrementing action weights discussed in Section
12.5.4. In order to assign initial weights to actions, use state properties.
4. Implement a strategy that records for each transition (s1, a, s2) an abstract
transition (g(s1), g(a), g(s2)), where g is a grouping function; use GetHashCode
for g. If in a given state, there are enabled actions that transition to states in
new groups, select one of those actions randomly, otherwise choose any action
randomly.
*5. A state s is partially explored if there exists an unexplored action that is enabled
in s. A state s is interesting either if it is partially explored or if there exists
an explored path from s to a partially explored state. Implement a strategy that
gives priority to actions that lead to interesting states.
Pages:
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294