Testing electrical systems and machines