Solution (source code)

= Solution

Each test divides the current candidate set into a tested subset and its complement: failure places the defective item inside the subset, whereas success places it outside. A sequence of tests is therefore a binary <decision tree>, and minimizing its expected depth is the <Huffman coding> problem with weights $1,2,\ldots,10$.

Combine the smallest two current weights repeatedly. One choice of merges is $1+2=3$, $3+3=6$, $4+5=9$, $6+6=12$, $7+8=15$, $9+9=18$, $10+12=22$, $15+18=33$, $22+33=55$. It gives this explicit <prefix code>:
$$
\begin{array}{c|cccccccccc}
\text{item}&1&2&3&4&5&6&7&8&9&10\\\hline
\text{code}&01110&01111&0110&1110&1111&010&100&101&110&00
\end{array}
$$
At any node, test the candidate items whose next code digit is one. Assign failure to digit one and success to digit zero, and repeat until only a single codeword remains. This specifies every test, including the first subset $\{4,5,7,8,9\}$. <Huffman coding> minimizes the weighted codeword lengths, so the optimal expected number is
$$
\boxed{\mathbb E[T]=\frac{173}{55}\simeq3.14545.}
$$
The sum of the successive merged weights is another check on the numerator $173$.