A typical definition of a computer virus might have aspects such as the following:
A virus attacks specific file types (or files).
A virus manipulates a program to execute tasks unintentionally.
An infected program produces more viruses.
An infected program may run without error for a long time.
Viruses can modify themselves and may possibly escape detection this way.