In general, the only difference between test and and is that test , doesn't modify its operands. Essentially test applies an and operation, discarding the non-flags part of the result. If the operands are identical, the results will be the same (as will or).
test can be a superior instruction choice because of things like micro-op fusion. As a result, test is usually preferred unless the computation would have to be repeated. The same thing goes for cmp/sub.
Search Intel's doc for "fusion" and you should find the details.