You can remember the meaning of 作证 with this easy mnemonic:
I don't want to bear witness to this crime. You will have to make (作) someone else prove (证) that he's guilty.
Using mnemonics to remember the meaning of Chinese characters like can have an enormous impact on how long to learn Mandarin it takes.