For your info, the circumstances under which you are required to give a police officer your N&A:
(1) If an officer wishes to summons you for an arrest at a later stage, or issue you with a fixed penalty notice. If you refused, you can be arrested in order to ascertain this information (Section 25 PACE).
(2) S50 anti-social behavior of police reform act 2002: If the police reasonably believe you to be involved in anti social behavior [defined as behavior likely to cause Harassment Alarm or Distress -the same as the offence under s5 Public Order Act 1986] then your details can be demanded. This can include harassment/ alarm/ distress to the police, but police have a higher threshold than the average person. This is not a search power but a suspicion that you have caused a crime. Failure to give your name is an arrestable offence in itself, although such a prosecution should be tied to a s5 offence, otherwise it would seem to invalidate the reasonable belief (if the constable had reasonable belief, why isn’t it being investigated.)
(3) Finding an item during a search that may be used to commit criminal damage.
(4) If you have been arrested you should only giving details in front of a custody sergeant at a police station to prevent officers arresting you for the sake of getting your personal details.
(5) If you are a driver of vehicle on the road or involved in or witnessed an accident or road traffic offence whether in a car, on a bike or as a pedestrian, you must give your details.