  For a non-negative integer $k$, a language is $k$-piecewise test\-able
($k$-PT) if it is a finite boolean combination of languages of the form
$\Sigma^* a_1 \Sigma^* \cdots \Sigma^* a_n \Sigma^*$ for $a_i\in\Sigma$ and
$0\le n \le k$. We study the following problem: Given a DFA recognizing a
piecewise testable language, decide whether the language is $k$-PT. We provide
a complexity bound and a detailed analysis for small $k$'s. The result can be
used to find the minimal $k$ for which the language is $k$-PT. We show that the
upper bound on $k$ given by the depth of the minimal DFA can be exponentially
bigger than the minimal possible $k$, and provide a tight upper bound on the
depth of the minimal DFA recognizing a $k$-PT language.
