A computer virus is a computer program that can copy itself and infect a computer. The term "virus" is also commonly but erroneously used to refer to other types of malware, including but not limited to adware and spyware
programs that do not have the reproductive ability. A true virus can
spread from one computer to another (in some form of executable code)
when its host is taken to the target computer; for instance because a
user sent it over a network or the Internet, or carried it on a
removable medium such as a floppy disk, CD, DVD, or USB drive.

Malware, short for malicious software, (sometimes referred to as pestware is a software designed to secretly access a computer system without the owner's informed consent.
The expression is a general term used by computer professionals to mean
a variety of forms of hostile, intrusive, or annoying software or
program code.

Spyware is a type of malware that can be installed on computers,
and which collects small pieces of information about users without
their knowledge. The presence of spyware is typically hidden from the
user, and can be difficult to detect. Typically, spyware is secretly
installed on the user's personal computer. Sometimes, however, spywares such as keyloggers are installed by the owner of a shared, corporate, or public computer on purpose in order to secretly monitor other users