Well, sorta, but in jurisdictions I'm familiar with, it's not exactly allowed to do it question by question. If the defendant chooses to testify on his behalf (optional) then does not submit to cross examination (takes the 5th), the entire testimony can be tossed out.
In other words, you can choose to testify or not, but if you testify, you have to answer legit questions. Strongly suggest consulting with a lawyer who specializes in criminal law in the jurisdiction of interest. IANAL Rules in civil suits are different, and it may not be possible to avoid testifying.
A recent case in OK involving a pharmacist repeatedly shooting a downed robber (after taking time to get another gun) resulted in the defendant choosing NOT to testify after the security tape was shown to the jury. He is now in state prison serving his sentence for murder.
There was a civil suit filed also.