Tests for model specification in the presence of alternative hypotheses