didn't need to do表示过去不必做某事, 事实上也没做。
needn't have done表示过去不必做某事, 但事实上做了。例如:
John went to the station with the car to meet Mary, so she didn't need to walk back home.
约翰开车去车站接玛丽,所以她不必步行回家了。
John went to the station with the car to meet Mary, so she needn't have walked back home.
约翰开车去车站接玛丽,所以她本不必步行回家了。 (Mary步行回家了,没有遇上John的车。)