SMS dit: Theory of rank tests