similarity.test function

Compute the similarity test.