The tests were dictated by India's security interests. India is sandwiched between two neighbours with varying degree of hostility towards India.
China is a declared nuclear weapons state, Pakistan's covert programme is no secret.
China possesses the ability to wreak intolerable devastation on India at all levels of nuclear escalation. Such an outcome could prove intolerable for India''. Compounding matters is the tense relationship between India and Pakistan, a covert nuclear country, whose nuclear programme has received assistance from China and North Korea. Pakistan is now believed to have the ability to assemble and test nuclear warheads and to deliver them over the comparatively short distances to New Delhi. Pushed to the wall by the CTBT deadlines, India did not have much choice.