I disagree - It's not a legitimate method when the teacher has prior knowledge as to what's going to be asked on the test. Tests can only be written to evaluate students on a portion of their coursework. Trying to do anything more would be unworkable; there's just too much material to test on all of it.
When a teacher knows beforehand which areas are going to be tested and which ones aren't (or worse, knows what the questions will be), everything that's not on the test will be given short shrift (or not taught at all) as the teacher prepares the students for taking that test. A different test on the same subject matter would be a disaster grade-wise since the students have only been taught what will be on the test rather than what's in the entire coursework.
The teachers don’t know the specific questions, they just know the type of question and the previous questions.
Professional boards are done the same way. The prep courses give out old tests, the students answer all the questions on all the old tests and study them. Almost all the questions can be found on one of the old tests.
If they really wanted to test the students and not the teachers, they would be using something like the IOWA test that you can’t prepare for.