Tests may involve a MRI scan, blood test to check for electrolyte levels, electromyography to determine any deformity of muscles and nerves that control it, and nerve conduction studies. Hence, if you experience thumb spasms due to any one of the above said causes, it's best to pay a visit to the doctor who would be able to diagnose your problem and give you the appropriate treatment. Take care!