Are you asking because of a specific (e.g., battery, touchscreen) or are you evaluating a used iPhone ? Let me know, and I can suggest the best diagnostic tools for that situation. My Device Info! - App Store - Apple
Provides information on CPU usage, battery health, and storage.
Helps check sensors and parts, according to App Store descriptions.
You can initiate a hardware test by turning off your phone, holding both volume buttons, and plugging it into a charger, according to this YouTube video .
Dial *3001#12345#* followed by the call button to reveal advanced network settings and cellular data information, as explained in this Wilson Amplifiers blog post .
Dial *#06# to immediately show your device’s unique IMEI number, as shown in this PCMag article.