AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Malicious code (malware): computer virus

    A computer virus is a piece of malicious code that attaches itself to a legitimate program or file and only runs when that host is executed.

    Checked against the AQA 8525 specification (opens in a new tab) on .

    • Point 5 of 7

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    A computer virus is a piece of malicious code that attaches itself to a legitimate program or file and only runs when that host is executed. Once active it can replicate by copying itself into other files, so it spreads when infected files are shared, for example by email attachment or USB stick. It may also carry a payload that corrupts or deletes data, slows the system or displays unwanted messages. The key idea for the exam is the dependency on a host plus self-replication: a virus cannot spread on its own without a user running the infected file. Contrast this with malware that spreads across a network unaided. When answering, identify the attachment to a host file, the trigger of user execution, the replication and the possible payload, and distinguish a virus from other malware types such as a trojan or worm.

    What earns the marks

    • A virus is malicious code that attaches to a legitimate program or file (its host).

    Common mistakes and how to put them right

    • Treating any harmful program as a virus.

      Put it right: A virus specifically attaches to a host file and needs that file to be run.

    • Claiming a virus spreads across a network by itself with no user action.

      Put it right: That self-spreading behaviour describes a worm, not a virus.

    • Assuming a virus always destroys data immediately.

      Put it right: A virus may lie dormant and may carry no damaging payload, or a payload that only disrupts.

    Exam tips

    • Look for the word 'attaches' or 'host file' in an option; that signals a virus rather than other malware.
    • Reject options describing unaided network spreading, which point to a worm.
    • Link the virus to a route of spread such as an email attachment or shared USB drive to confirm the answer.

    Try the lesson

    The start of the Malicious code (malware): computer virus lesson, made from checked teaching notes for this specification point.

    Have a go first

    What is the key feature of a computer virus?

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Malicious code (malware): computer virus

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge