code for chapter on testing