iPhone 5s 16GB iOS11 randomly restarts
Your issue could be one of two things: the battery or an issue with your OS. 

You said you have already had your battery tested, but battery apps aren't very accurate and different tests at the Apple store will show different results. 

Start by calling (or chatting with) Apple support. Do this on a different device. Ask if they can remotely run a Mobile Resource Inspector test. This will test many different components in your phone and is how they diagnosed my battery issue.

If they determine it is not a battery issue, do a FULL restore. You'll need a computer with iTunes for this.


  As always, make sure all of your data is saved. You will not restore from a backup, so save it another way.


Start by putting your phone in recovery mode.


Shut down your iPhone.
Press and hold both the Home and Top buttons until the connect to iTunes screen appears.
Connect to iTunes.


iTunes will show a popup asking if you'd like to restore or update. You'd like to Restore.



Your computer will download a completely new copy of iOS 11 - that's what makes this different than doing this on an iPhone.

If your computer takes longer than 15 minutes to download the update, you'll need to put your phone in recovery mode again. Press and hold the Home and Top buttons at the same time to do this.


  Warning: Restoring your phone this way will require your Apple ID password unless you didn't have Find My iPhone enabled. If you do not remember your Apple ID password, you should reset it at iforgot.apple.com


If none of this fixed your phone, I'd recommend talking to Apple Support about your issue over the phone. (Over-the-phone support is generally faster than live chat)