Assessing Student Understanding: A Framework for Testing and Teaching