Optimizing score test