Today the term virus is often loosely used to refer to any type of malicious program, or is used to describe any bad thing that a program does to a computer.
Strictly speaking, however, a virus is defined as program code that replicates.
Of course, this simple definition leaves plenty of scope for further sub-division.
Sometimes viruses are further classified by the types of object they infect.
For example, boot sector viruses, file viruses, macro viruses, etc.