How to debug a battery issue?
I have diagnosed several battery related anomalies with a combination of two apps: one called Diagnosis and the other GSam Battery Monitor Pro.  GSam isn't as robust but it offers a greater filtering options to sort the culprits by CPU usage, power usage, memory usage....  In every case it turned out to be a problem with an app or a setting or my current ROM but those apps helped me track down the problem.  

You may also want to check your device's logs for clues.  You can use aLogrec to record your logcat, then note the time of a spontaneous shutdown then check the log to see what events lead up to it.  I can barely understand what is contained in my logcat but this forum post may help you.