Try one or two cups of green tea instead of coffee.
Eating a small carb snack before a test - a whole-wheat English muffin with a little peanut butter and a glass of orange juice, will help boost concentration and brainpower, and is better than going in on an empty stomach.