My experience as a math major is that tests are simply a retarded idea in anything beyond the elementary classes, especially in graduate ones. If you get some experience with upper level classes, you will come to realize that you can safely ignore about 50% of the material you "learn" throughout the semester (and 80% of what is done in class) because there is no way for that stuff to be on a test. The problems on a test are of a particular kind, simplified versions of the homework problems, where the low difficulty is made up for by the time constraint and lack of reference materials.
The homework problems are typically much more complex and a far better indicator of how well you know the stuff, but are usually only a small fraction of the grade. A handful of professors give take home tests, but those are extremely rare. I had one last semester though. After the final exam is over, you can proceed to forget everything you learned during the semester since you never really studied it seriously in the first place, just well enough to know how to do tests on it. I know I don't remember much of what I did last year except the stuff in my specific area of interest.

You need a certain set of skills to do well on tests, one that is completely different from what is needed to solve real problems or do actual research in that field. The math professors in fact have a term for getting too used to this mode of thinking, the Putnam syndrome (from the Putnam competition exam), since there are so many students in math Ph.D. programs who have gotten that far because they could excel in tests but have no clue how to do any research.
In my abstract algebra class, the averages for the first two tests have been 59 and 65, with the medians a few percentage points off from that. 90 is by default an A in any class unless otherwise specified, although the professor said he might be doing "slight curving." Of course, I got 87 and 95 so I'm not too concerned, but I wouldn't want to be in the situation of most of the other students in the class.

There is a test in my intro Java class tomorrow. The average for the first test there was 67 and the professor said there might be a couple percentage points' curve, so the average grade would be around 70 (a low C). Of course, they tend to give a lot lower grades in intro classes in general, with only about 7-12% A's. I got a 90 on that one, which a borderline A. The tests together are worth about 50% of the grade in this class, so I better make sure I do well on this one.
One other feature of lower level classes is weekly quizzes. These appear in the Java class and make tests look like a great idea; as far as I can see, the only purpose of these is to irritate students and make them hate the class.

These fortunately aren't generally seen in upper level things, but there is one guy in the math department who gives them for
graduate classes (the stuff on him on
www.ratemyprofessors.com is funny to read

). Needless to say, I'm not about to do anything with him.