Software developers quite often listen to music while they are working on code. So-called heavy metal is a common choice, the most common in my experience. I listen to Mozart or Bach, usually. I don't know why it works, but it does. My theory is that it gives the 'lower' parts of your brain something to focus on so they don't chatter amongst themselves and distract you while the 'higher' parts work on the code. If your whole brain is occupied, it can't wander anywhere.
Sounds like a good theory.
I used to work with some MDs who had performed some research o the issue with some psychiatrists. In a nutshell, they believed that near shortterm recall, such as memory of events or training within a 6 week period, tended to be reinforced by similar environment.
So if you always studied by music, your best response in testing would be with a music background.
Since most examinations aren't conducted with the same music background, their recomendations were to study without music. However, if one was studying 18hrs a day for several months straight, the theraputic and relaxing effect of music in and of itself might prove more beneficial than study in dead silence.