k-means and tests