move test code out of SimilarityMetric class and change return type from string to double