In the ECAD area, the Test Generation (TG) problem consists in finding an input vector test for some possible diagnosis (a set of faults) of a digital circuit. Such tests may have some unspecified Primary Inputs (i.e. bits are assigned neither 0 nor 1). In fact, for many purposes, minimally specified tests (or patterns) are preferred. Hence, we have the Test Pattern Optimisation (TPO) problem where the goal is to obtain a test with the maximum number of unspecified bits. In this paper we discuss different modelling approaches and present a TPO tool (Maxx) that substantially outperforms others by combining Branch-and-Bound and local search over distinct models. We apply the usual branch-and-bound search on CLP(FD) over a simple, yet incomplete, logic. A complementary Local Search is performed over an extended model, trying to improve an already computed solution by exploring an extended solution space thanks to the use of an extended logic (too complex for constraint solving). Such exte...