When you are working with supervised algorithms ( in case ANN ) you need to correct weights which represent knowledge. these weight must be built based on data ( it the train data ). after the training ends we need to verify the ability of the algorithms on generalization so we used ( test data set).