  As a crucial technique for integrated circuits (IC) test response compaction,
$X$-compact employs a special kind of codes called $X$-codes for reliable
compressions of the test response in the presence of unknown logic values
($X$s). From a combinatorial view point, Fujiwara and Colbourn \cite{FC2010}
introduced an equivalent definition of $X$-codes and studied $X$-codes of small
weights that have good detectability and $X$-tolerance.
  An $(m,n,d,x)$ $X$-code is an $m\times n$ binary matrix with column vectors
as its codewords. The parameters $d,x$ correspond to the test quality of the
code. In this paper, bounds and constructions for constant weighted $X$-codes
are investigated. First, we obtain a general result on the maximum number of
codewords $n$ for an $(m,n,d,x)$ $X$-code of weight $w$, and we further improve
this lower bound for the case with $x=2$ and $w=3$ through the probabilistic
method. Then, using tools from additive combinatorics and finite fields, we
present some explicit constructions for constant weighted $X$-codes with
$d=3,7$ and $x=2$, which are optimal for the case when $d=3, w=4$ and nearly
optimal for the case when $d=3,w=3$. We also consider a special class of
$X$-codes introduced in \cite{FC2010} and improve the best known lower bound on
the maximum number of codewords for this kind of $X$-codes.
