CAIE-As Level-Computer Science - Practical
CAIE-As Level-Computer Science - Practical
ORG
CAIE AS LEVEL
COMPUTER SCIENCE
SUMMARIZED NOTES ON THE THEORY SYLLABUS
Prepared for S for personal use only.
CAIE AS LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by S at HomeSchooled on 22/03/25.
CAIE AS LEVEL COMPUTER SCIENCE
Operator Meaning
<
<=
Less than
Less than/equal
An object that stores data, information, settings or
> Greater than commands
>= Greater/equal Can be opened, saved, deleted & moved
= Equal to
<> Not equal to Transferrable across network connections
Date:
Array:
Data structure consisting of a collection of elements
Identified by at least one array index (or key)
File:
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by S at HomeSchooled on 22/03/25.
CAIE AS LEVEL COMPUTER SCIENCE
Pseudocode:
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by S at HomeSchooled on 22/03/25.
CAIE AS LEVEL COMPUTER SCIENCE
Mode Description ‘’’python identifier = value‘’’ or ‘’’python expression‘’’ or
r Opens file for reading only. Pointer placed at the beginning of the file.
w Opens a file for writing only. Overwrites file if file exists or creates new file if it ‘’’python “string”‘’’
doesn’t
Opens a file for appending. Pointer at end of file if it exists or creates a new file if
3.2. Selections
a not
Reading a file:
Read all characters: variable.read() “IF” Statement
Read each line and store as list: Pseudocode: IF…THEN…ELSE…ENDIF
variable.readlines()
Python: if (expression): (statements) else:
(statements)
Writing to a file:
Write a fixed a sequence of characters to file: “CASE” Statement
variable.write(“Text”)
Pseudocode: CASE OF variable: … … … OTHERWISE:
… ENDCASE
Write a list of string to file: variable.write(‘
‘.join(‘Z’, ‘Notes’))
Python: if (expression): (statement) elif
(expression): statement) … else: (statement)
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by S at HomeSchooled on 22/03/25.
CAIE AS LEVEL COMPUTER SCIENCE
Procedure: subroutine that performs a specific task without
returning a value Analyze problem: define problem, record program
specifications and recognize inputs, process, output & UI
Procedure without parameters: Design program: develop logic plan, write algorithm in
e.g. pseudocode or flowchart and test solution
PROCEDURE <statement(s)>ENDPROCEDURE def identifier():statement(s)
Code program: translate algorithm into high level
When a procedure has a parameter, the function can language with comments/remarks and produce user
either pass it by either reference or value interface with executable processes
Pass by value: data copied into procedure so variable Test and debug program: test program using test data,
not changed outside procedure find and correct any errors and ensure results are
correct
PROCEDURE <identifier> (BYVALUE <param>: Formalize solution: review program code, revise
<datatype>) internal documentation and create end-user
<statement(s)> documentation
ENDPROCEDURE Maintain program: provide education and support to
def identifier(param): end-user, correct any bugs and modify if user requests
statement(s)
There are three different development life cycles:
Pass by reference: link to variable provided so variable
changed after going through procedure (not in Python) Waterfall model: a classical model, used to create a
system with a linear approach, from one stage to
PROCEDURE <identifier> (BYREF <param>: <datatype>) another
<statement(s)> Iterative model: a initial representation starts with a
ENDPROCEDURE small subset, which becomes more complex over time
until the system is complete
Calling a procedure: Rapid Application Development (RAD) model: a
CALL () Identifier()
prototyping model, with no (or less) specific planning put
into it. More emphasis on development and producing a
product-prototype.
3.7. Function
Function: subroutine that performs a specific task and 4.2. Integrated Development
returns a value Environment
Functions are best used to avoid having repeating blocks of
code in a program, as well as increasing the reusability of A software application that allows the creation of a
code in a large program. program e.g. Python
FUNCTION <identifier> (<parameter>: <data type>) Consists of a source code editor, build automation tools,
RETURNS <datatype> a debugger
<statement(s)>
ENDFUNCTION Coding:
def identifier(param):
statement(s) Reserved words are used by it as command prompts
return expression Listed in the end-user documentation of IDE
A series of files consisting of preprogrammed-
subroutines may also be provided by the IDE
4. Software Development Initial Error Detection:
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by S at HomeSchooled on 22/03/25.
CAIE AS LEVEL COMPUTER SCIENCE
Debugging:
Single stepping: traces through each line of code and
steps into procedures. Allows you to view the effect of
each statement on variables Iteration: Implies that module is executed multiple
Breakpoints: set within code; program stops temporarily times
to check that it is operating correctly up to that point
Variable dumps (report window): at specific parts of
program, variable values shown for comparison
Rules:
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by S at HomeSchooled on 22/03/25.
CAIE AS LEVEL COMPUTER SCIENCE
Run-time errors:
Use test data for which results already calculated &
Source code compiles to machine code but fails upon compare result from program with expected results
execution (red lines show up in Python) Testing only considers input and output and the code is
When the program keeps running and you have to kill it viewed as being in a ‘black box’
manually
Examples: White box testing:
Division by 0
Examine each line of code for correct logic and accuracy.
Infinite loop – will not produce error message, May record value of variables after each line of code
program will just not stop until forced to Every possible condition must be tested
Logic errors: Stub testing:
Program works but gives incorrect output Stubs are computer programs that act as temporary
Examples:
replacement for a called module and give the same
Out By One – when ‘>’ is used instead of ‘>=’ output as the actual product or software.
Misuse of logic operators Important when code is not completed however must be
tested so modules are replaced by stubs
4.5. Corrective Maintenance
Dry run testing:
Corrective Maintenance is correcting identified errors
White-Box testing: making sample data and running it A process where code is manually traced, without any
through a trace table software used
Trace table: technique used to test algorithms; make The value of a variable is manually followed to check
sure that no logical errors occur e.g. whether it is used and updated as expected
Used to identify logic errors, but not execution errors
Walkthrough testing:
A test where the code is reviewed carefully by the
developer’s peers, managers, team members, etc.
It is used to gather useful feedback to further develop
the code.
Integration testing:
Taking modules that have been tested on individually
and testing on them combined together
This method allows all the code snippets to integrate
4.6. Adaptive Maintenance with each other, making the program work.
Making amendments to: Alpha testing:
Parameters: due to changes in specification
Logic: to enhance functionality or more faster or This is the testing done on software ‘in-house’, meaning it
both is done by the developers
Design: to make it more user friendly Basically another term for ‘first round of testing’
Beta testing:
4.7. Testing Strategies
This is the testing done on the software by beta users,
Black box testing: who use the program and report any problems back to
the developer.
Basically another term for ‘second round of testing’
Acceptance testing:
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by S at HomeSchooled on 22/03/25.
CAIE AS LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by S at HomeSchooled on 22/03/25.
CAIE AS Level
Computer Science
© ZNotes Education Ltd. & ZNotes Foundation 2024. All rights reserved.
This version was created by S on Sat Mar 22 2025 for strictly personal use only.
These notes have been created by Shaikh Ayman Abdul-Majid for the 2023 syllabus.
The document contains images and excerpts of text from educational resources available on the internet and printed books.
If you are the owner of such media, test or visual, utilized in this document and do not accept its usage then we urge you to contact us
and we would immediately replace said media. No part of this document may be copied or re-uploaded to another website.
Under no conditions may this document be distributed under the name of false author(s) or sold for financial gain.
"ZNotes" and the ZNotes logo are trademarks of ZNotes Education Limited (registration UK00003478331).