Factorize test dependencies