To test the hard drive find the manufacturer and then download their specific disk checking software and run this from a CD. You will need to create an iso copy to run direct from CD.
Other source of your problems could be the power supply.
Surface Pro (2017) vs Surface Pro 4
20 groundbreaking 3D animation techniques
How to mine Bitcoin on Mac