This paper is a journal counterpart to our FOCS 2021 paper, in which we initiate the study of property testing problems concerning a finite system of relations $E$ between permutations, generalizing the study of stability in permutations. To every such system $E$, a group $\Gamma=\Gamma_E$ is associated and the testability of $E$ depends only on $\Gamma$ (just like in Galois theory, where the solvability of a polynomial is determined by the solvability of the associated group). This leads to the notion of testable groups, and, more generally, Benjamini-Schramm rigid groups. The paper presents an ensemble of tools to check if a given group $\Gamma$ is testable/BS-rigid or not.