What tests could be done to diagnose mid/upper back pain, along spine and muscles. Cause headaches and daily severe pain. Feels like a hole in spine.

Get MRI Spine. This pain in the distribution as you suggested is the result of an irritated nerve or facet joints or other injury typically in the lumbar spine (low back) which are caused by herniated disks, spinal stenosis or degenerative disc disease, etc requiring further evaluation (MRI) by a spine specialist and may be candidate for facet injections/radiofrequency ablation and epidural steroid injection.
History. Of present illness and physical evaluation are the most important elements for proper diagnosis. To support the findings MRI and ct scan are usually recommended.