How are computer viruses named?

I think it's on behaviour of the virus program, i.e. Trojan Horse,Black Bug etc.