Asking “Is this going to be on the test?” is a commonly asked question by students. However, it is arguably one of the most annoying questions for the professor. Asking this question tells an instructor that you don’t care about the material they are teaching, and only want to learn what is absolutely necessary to pass the course. In addition, chances are high that the professor hasn’t written the exam yet, and doesn’t know the proper answer to this question.
If a professor answers yes to this question, that tells a student exactly what is on the exam. This is not what (most) professors want. They want to see how much of the material you have learned or understood. Telling you exactly what you need to learn and study defeats the purpose. In addition, if they later decide not to add the topic to the exam, students may complain that they studied something unnecessarily (also something you should never do).
If the professor answers no, that means a student will not learn it. This is not at all what the professor wants. It means the students will completely disregard a portion of the course. If they do that, then what is the point of teaching that particular topic? As I stated before, the instructor may not have written the test yet. What if they later decide they do want to include this particular topic?
In general, this is not a good question to ask an instructor. You should assume that anything you have covered in the class is fair game to include on the exam. If you are really worried about a particular topic, explain this to the instructor, and request a meeting to clear up any confusion. If the professor suggests meeting after the exam, this is probably a good indication that it will not be on the exam. In addition, even if it is not on the next exam, it may still be on the final.