For some reason, speaking of viruses and techniques of creating them is a taboo (probably because most of them carry a malicious payload ready to destroy everything and become a potential chronic pain-in-the-a**) which is a shame, really. I find viruses and the way people write them fascinating. Most of viruses are, of course, written in assembly, and writing self-reproducing (and/or poly/metamorphic for instance) code in assembly is no easy task. This is an excellent way (in my opinion) of getting to know assembly, however one can barely imagine creating a virus for anything else than being an above mentioned chronic disease, which is (again) a shame.
Thinking of the fact that most of human's inventions (including software) is based on or inspired by things nature already created, you can see how viruses came to be known as viruses. They do the exact same thing :
1. Enter a cell (the computer)
2. Find DNA (executable files, some other data)
3. Modify it
4. Reproduce
5. Mutate
However, there are useful viruses in nature, so there must be a way that computer viruses (again I speak of them as of programs capable of self-reproduction) can be put to a good use (I admit, nothing comes to mind, right now

So, basically I opened this thread to see your opinions on the 'good viruses' (and what they might be good for) and for sharing knowledge (and useful links) about commonly used techniques.
Here are some links to what Wikipedia has to say. If nothing else, they are useful as a reference for terminology

http://en.wikipedia.org/wiki/Computer_virus
http://en.wikipedia.org/wiki/Self-modifying_code
http://en.wikipedia.org/wiki/Metamorphic_code
http://en.wikipedia.org/wiki/Polymorphic_code
(I'm sorry if my English is a bit rusty-it's not my native language)