1.2 Software Flashcards

1
Q

What does OS stand for?

A

Operating System

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an OS?

A

A consistent platform for all software to run on, which manages the hardware, software, security and memory resources of a computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are examples of personal desktop PC OSs?

A

Microsoft Windows

Linux

MacOS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are examples of mobile devices OSs?

A

Android

iOS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are examples of server OSs?

A

Linux

Windows Server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is layering?

A

When the user doesn’t need to worry about how application software interacts with the hardware, they just ned to know how to interact with the application software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Is an OS an example of layering?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are three categories of OS functionality?

A

Hardware

User Interface (UI)

Security

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is hardware functionality?

A

Performs functionality to manage processes that need to be executed by the CPU

Deals with storing and retrieving data and using device drivers to communicate with I/O devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are some examples of hardware functionality?

A

Processor scheduling

Handling interrupts

Peripheral management

Memory management

Secondary storage management

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does the OS manage processes?

A

Determines order processes are passed to the CPU and amount of time a process will be allowed before switching to another

OS receives processing requests and sends them to the CPU when they need to be executed and tells the CPU when interrupt is received and pause the current process whilst interrupt completed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is processor management needed?

A

CPU needs to execute a large number of processes every second which need to be queued and sent to the processor in the correct order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an interrupt?

A

Signal sent to the processor to request immediate attention

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does the OS handle interrupts?

A

Determines if the current process should be paused for interrupt to be executed

If it is, OS stores current contents of registers and loads address of first instruction in ISR for interrupt to be dealt with

When interrupt completed, original process loaded and continued

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does the OS manage peripherals?

A

Manages I/O devices

Communicates with input devices using device drivers and sends data to correct part of computer

Takes data in memory or output from CPU and communicates with output devices using device drivers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does the OS manage memory?

A

Records how memory in a computer is divided (paging/segmentation) to ensure data allocated fairly

Data needs to be loaded from HDD into RAM when in use and removed from RAM when no longer needed

Ensure enough space in memory to store data requried

Keeps track of where data stored

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does the OS manage secondary storage?

A

Ensures enough space to be able to store required data

Keeps track of where data stored so can be retrieved again

Keeps track of free space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a UI?

A

Way of the OS allowing the user to communicate with the device

Can take many forms, type depending on device being used and level of experience of user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are some examples of an UI?

A

Graphical User Interface (GUI)

Natural Language Interface

Command Line (CLI)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a GUI?

A

Way of a user interacting with the device using a series of icons and images

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Who is a GUI suitable for?

A

Novice users

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a Natural Language Interface?

A

Where user can interact with a computer using their natural language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is a CLI?

A

Method of users being able to interact with a computer where they need to know specific commands to perform actions

Quick if the user knows commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Who is a CLI suitable for?

A

Skilled users as they need to know the specific commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is security functionality of an OS?
OS supports security of device by ensuring that resources are protected from unauthorised access through use of permissions and passwords
26
What are some examples of security?
Username and password User access folders Restricting access to files and folders Encryption Read only
27
What purpose do username and passwords have?
Ensures only users with suitable usernames and passwords can log into a device
28
What purpose do user access levels have?
Manages actions a user can perform depending on their user access levels Determines if they can see folders, change settings, install software
29
How is access restricted to files and folders?
Password allocated to them, which means the contents are only viewable if the user knows the password
30
What purpose does encryption have?
Data on hard drive encrypted so if someone gained unauthorised access they wouldn't be able to understand data stolen
31
What does setting files/folders to 'read only' read?
So user can view, but not edit, files Enforced via password of user access levels
32
How does the OS manage network protocols?
Manages network transmission of data and protocols used within, including TCP/IP, HTTP(S), FTP Establishes connection with device data is being sent to and agrees protocols with device
33
How does the OS load and run programs?
1. Locate where program is stored 2. Check if enough space in RAM 3. Move required data from secondary storage to RAM 4. Send interface to monitor
34
What are paging and segmentation?
2 techniques enabling OS to make optimum use of memory by splitting the memory into small sections and saving data in non-contiguous data locations
35
What are memory management operations?
Tracking status of memory allocation Determining storage requirements Controlling memory usage
36
How does the OS track the status of memory allocation?
Memory divided into physical address spaces OS initially marks each space as free but, when required, OS loads data into spaces and marks them as allocated When data or instructions are no longer needed, OS marks spaces as free again allowing data to be overwritten
37
How does the OS determine storage requirements?
Rare that data needed for a process can fit in a single memory locations Determines how much memory to allocate to each process that's running, based on requirements of its programming Reserves blocks of addresses for each process to use
38
How does the OS control memory usage?
Manages swapping between processes and their memory space to provide memory access as required Main memory is hardware resources with physical addresses used to locate areas in which data and instructions can be stored When program executed, logical addresses produced and total of these logical addresses makes up logical address space of that process Maps logical address space to physical address space and memory usage between processes
39
What is paging?
Data split up physically into equal size pages, not considering data it's storing
40
What is segmentation?
Data split up logically into different size segments, considering data it's storing
41
What is virtual memory?
Part of the hard drive which is allocated as an extension of RAM
42
How does the OS manage virtual memory?
Swaps data between virtual memory and RAM as required
43
What factors affect the division of processing time?
When task was requested Importance of task Length of task
44
What happens as a computer runs more processes?
Longer it takes for a process to be allocated processor time Unsuitable for processes that must perform tasks almost immediately
45
What are the reasons a processor can be interrupted?
Hardware device has signalled it has data to process Hardware device has completed a task it was asked to do Software processor needs a service to be provided or OS function to be performed Allotted amount of time expired and an action needs to be performed Hardware failure occurred and needs to be addressed
46
What does ISR stand for?
Interrupt Service Routine
47
What is an ISR?
Mini program that's been designed to respond to an interrupt's request Can be built into an OS or provided via device driver
48
What are the stages of an interrupt?
1. Processor receives the interrupt 2. Processor completes the FDE cycle of instruction that was running when it received interrupt 3. Current contents to processor registers (including PC) saved to memory 4. Origin of interrupt identified so that appropriate ISR called 5. All other lower-priority interrupts put on hold to allow ISR to finish running 6. PC updated with address of first instruction of ISR 7. ISR completes its execution 8. Processor registers reloaded with values saved to memory 9. Lower-priority interrupts that were put on hold re-established 10. PC set to point to address of next instruction that needs to executed in program that the processor was running when it received interrupt
49
Rank types of interrupt from highest to lowest
1. Hardware commands 2. Program/software 3. Timer 4. Input/output devices
50
What are hardware commands/interrupts?
Shutdown to start triggered by user pressing off button Memory parity error (data loaded contains different value than when it was stored) Internal clock triggers suspending proces Reset button pressed Power supply failure Power-down command (screen off, hibernate)
51
How does hardware interrupts/commands work?
Send a physical signal to the CPU via the interrupt chip
52
What is a program/software interrupt?
Software detects an error has occurred and issues software interrupt for CPU to run some instructions to try and clear error Illegal instruction encountered an interpreted code Arithmetic overflow (result of calculation exceeds available storage)
53
What is a timer interrupt?
Data-logger has to read an input sensor every one second Screen-recording application that has to read next screen update
54
What are I/O device interrupts?
Devices like the keyboard and mouse demand attention or inputs would never get a look in Hard disk Optical disk Printer Graphics tablet
55
What are scheduling algorithms?
For computer to switch tasks, OS must control suspension of process currently running and control subsequent continuation of another process Current process suspended and saved into memory and then when CPU is ready to service it, state reloaded and process continued Scheduling algorithms determines order OS will execute processes
56
What does a scheduler do?
Makes sure time allocated fairly to all processes Maximises use of CPU and all hardware Makes applications run as quickly as possible
57
What are examples of scheduling algorithms?
First Come First Served (FCFS) Shortest Job First (SJF) Shortest Remaining Time (SRT) Multi-Level Feedback Queue (MLFQ) Round Robin (RR)
58
What is starvation?
When a process cannot complete its execution because its constantly denied processor time
59
What is First Come, First Served?
First job to enter ready queue is the first in the running queue Execute each process in its entirety?
60
Is FCFS pre-emptive?
No
61
What are the advantages of FCFS?
Simplest method to implement Once a job starts, will definitely be completed Should avoid starvation
62
What system does a FCFS work well in?
One that only has a few concurrent processes
63
What are the disadvantages of FCFS?
Can be a long wait before a process can run
64
What is Shortest Job First?
Process with the shortest/smallest running time is run next When a process starts to be executed, it's executed in its entirety Jobs sorted in the ready queue according to estimated processor time needed
65
Is SJF pre-emptive?
No
66
What are the advantages of SJF?
Reduces wait times because shorter processes are removed quickly, meaning that the processor can allocate more jobs to longer times
67
What are the disadvantages of SJF?
Time estimation of a job could be wrong and this is what is used to determine which job first Susceptible to starvation as if shorter jobs keep being added, scheduler will keep prioritising these jobs so longer processes won't be serviced
68
What is Shortest Remaining Time?
Processor continuously reorders queue during run time If a process added to the queue has a shorter amount of remaining time, interrupt is raised Current process suspended in favour of the new one
69
Is SRT pre-emptive?
Yes
70
What are the advantages of SRT?
Short processes executed immediately which is useful for higher performance systems running many small concurrent processes
71
What are the disadvantages of SRT?
Starvation of long-running processes
72
What is the Multi-Level Feedback Queue?
Processor queue split into multiple queues with different priorities Processor will execute all processes in highest priority queue first then move down the groups If a process isn't getting enough CPU time, will be moved to a higher priority queue If a process is getting an unfair amount of CPU time, will be moved to a lower priority queue
73
Is MLFQ pre-emptive?
Yes
74
What are the advantages of MLFQ?
Eliminates starvation Can manually flag processes as higher priority to guarantee execution Processes can be executed very efficiently
75
What are the disadvantages of MLFQ?
More difficult to implement
76
What is Round Robin?
Each process is given a maximum length of processor time in the running state after which it's put back into the ready queue
77
What are the time period allocated to the processes called?
Time slices
78
Is RR pre-emptive?
No
79
What are the advantages of RR?
Ensures every task is allocated processor time without a long wait Eliminates starvation
80
What are the disadvantages of RR?
Doesn't scale well as more processes run, the time slices get smaller Urgent tasks less likely to be completed quickly
81
What are the different types of OS?
Distributed Multi-task Multi user Embedded Real time
82
What is a distributed OS?
Processing appears to be completed on a single computer However, task split and processed on multiple devices acting as a single computer Data shared between devices
83
What is an example of a distributed OS?
Creating weather satellite imagery
84
What is a multi-user OS?
Enables computer to perform multiple operations at once, or at least, what appears to be
85
What is an example of a multi-task OS?
Someone working on a home computer
86
What is a multi user OS?
Allows multiple users that are on different computers to access single system's OS resources simultaneously
87
What is an example of a multi user OS?
School system
88
What is an embedded OS?
Found inside other devices Has a dedicated function
89
What is an example of a embedded OS?
Washing machine / Satnav
90
What is a real time OS?
Ensures tasks are completed within an agreed period of time
91
What is an example of a real time OS?
Hospital
92
What does BIOS stand for?
Basic Input/Output System
93
Where is BIOS stored?
Non-volatile memory
94
When is BIOS available?
When the computer starts
95
What are the jobs of the BIOS?
Initialises and tests hardware in a computer system so it's ready for use by other software on the computer (POST) Loads bootloader program (bootstrap) from secondary storage
96
What does POST stand for?
Post-On Self-Test
97
What does the bootstrap do?
Starts initialisation of OS
98
What would happen without the BIOS?
Nothing could be loaded as main memory doesn't contain any instructions that could start boot process
99
When do modern systems use BIOS?
Only use it during initial stages of booting up a computer because software design's become so effective that there's no need for separate programs to be involved, making process more efficient and easier to control
100
Where is BIOS stored now?
Used to be stored on non-volatile ROM chip Now stored on flash memory systems because more convenient and easier to update software in-place
101
What does CMOS stand for?
Complementary Metal-Oxide Semiconductor
102
What is a CMOS memory circuit?
Has it's own battery so it can maintain it's data between restarts Any configurable settings are stored on CMOS memory circuit
103
What is CMOS memory circuit used in?
Modern computer systems to keep track of key functions
104
What are the stages when a computer is booted up?
1. Power turned on 2. Only data from ROM can be used at this point 3. POST is run, checks all parts that it needs to "come to life" are there and available 4. Clears anything that may still be in the registers or the CPU 5. Loads address of the first instruction in the boot program into the PC 6. Control now passed to boot program that carries out its own checks on the hardware 7. Checks for any BIOS on the hard disk or on a storage device called CMOS RAM 8. Combines this with the basic BIOS stored on the ROM and then sent to RAM 9. This file of information called the boot file 10. Computer now ready to load OS 11. OS normally found on hard disk but it will look at other locations first such as additional bootable device if told to do so by BIOS 12. OS now takes control of the computer and the memory and will load jobs into memory for processing as per the scheduler
105
What are device drivers?
Small programs that are used to control a piece of hardware, providing an interface between OS and hardware
106
Where would you find device drivers?
When you install a new peripheral have to install drivers May be on CD ROM, downloaded from internet or preloaded in OS
107
How do the OS and device drivers work together?
When OS receives a command (to print) passes this to device driver for that piece of hardware as the device driver knows how to communicate with this piece of hardware
108
What are the specific device driver functions called?
Routines
109
What is a virtual machine?
A host system running software that allows other software to behave as if it were running on a hardware system Can be configured to replicate any combination of hardware so that software running on it acts as if it were accessing certain devices even if they don't exist
110
What is virtualisation?
Many VMs running on a single host PC
111
What are some examples of roles of VMs?
Running alternative OSs Supporting incompatible software Creating a test system Running multiple servers
112
How does a VM run alternative OSs?
Created to allow installation of one OS within another OS Legacy OS or OS that wouldn't normally be able to run on hardware host VM can emulate different hardware setups so software runs as if running on different hardware platform
113
How does a VM support incompatible software?
Some older software might not run on newer systems VM could emulate older system on which user can run older software
114
How does a VM create a test system?
VMs are closed, controlled environments "Hardware" of VM only exists as self-contained software process that's isolated from actual host system Provides opportunity to run software that's potentially damaging (malware, early versions of software that needs to be analysed)
115
How does a VM run multiple servers?
Servers on network are required to fulfil multiple roles More than one server can run on a VM, allowing for separation of services without need for multiple pieces of hardware
116
What are some examples of VMs?
Emulators - allow for another system to be used on a PC Windows VM - used to "make" a PC a MAC Test environment - enables testing of a game on different systems
117
What is intermediate/byte code?
For all different programming languages, different version needs to compiled for each of the different machines it can be run on Different languages partially compiled from source code into intermediate/byte code then run on VMs on same PC
118
What are the three types of software?
Operating System software Utility software Application software
119
What is OS software?
Manages hardware, software and memory resources of the computer
120
What are some examples of system (OS) software?
OS Linux iOS macOS
121
What is application software?
Enables the user to perform tasks
122
What are some examples of application software?
Word processing software Graphical editing software Video editing software Music production software Spreadsheet software Presentation software Web development software
123
What is utility software?
Maintains, protects and improves performance of the computer Analyses, diagnoses problems with and tries to fix parts of your system
124
How does utility software come?
Pre-installed as part of OS
125
What are some examples of system (utility) software?
Defragmentation Decryption Compression Anti-virus Anti-spyware System info and diagnosis Firewall Disk formatting
126
What is compression software?
Used to both compress and decompress files on a computer Decreases the amount of data inside of files
127
What are the reasons to compress files?
Increasing amount of available space on a secondary storage device (if each file takes up less space, have more available space, good for files used infrequently) Sending files on a network (if file size smaller, less processing and less time required) When sending a file with an email (restriction of file size that can be sent, ensures maximum file size isn't reached)
128
What is defragmentation?
Recognises files on a hard drive Groups together files so that related data is stored together
129
Why is defragging necessary?
When data is saved on a hard drive, may be split up if first available space doesn't have enough memory to store all required data
130
How are files defragged?
Moves files to temporary empty space on the HDD Groups together empty spaces on the HDD Groups together related files Replaces data on the HDD so all related data stored together
131
What is encryption?
Process of using an algorithm to convert plaintext into ciphertext
132
What is the utility software of encryption responsible for?
Applying encryption algorithms Decrypting data using encryption key
133
When is encryption used?
Transferring data securely across a network to prevent it being read in case of interception On files on a secondary storage device to prevent access to files in case of hacking or theft
134
What is malware?
Malicious software that's been created with intention to cause damage to a computer
135
What can malware do?
Corrupt files Delete files Change files Steal files Cause disruption to service
136
What are different forms of malware?
Virus Worm Trojan Remote Access Trojan (RAT) Spyware Ransomware
137
What is a virus?
Malicious form of self-replicating software that attaches itself to other programs or files so that it can make copies of itself and spread easily to infect computer system Remains dormant in the host file or program until the program is run and it's able to execute
138
What can a virus be designed to do?
Send spam Steal data Infect other computers on the network Corrupt files
139
How can a virus arrive?
Via email attachment Visiting a malicious website On a removeable storage device
140
Why can viruses be hard to detect?
They hide themselves in their host's file
141
What are worms?
Replicate and cause damage to system Don't require a host program to spread, they can replicate and distribute independently
142
How can worms spread?
Using network features Email service
143
What are worms typically designed to do?
Spread quickly and infect as many devices as possible in order to waste system resources Use up network bandwidth and slow down network significantly Sometimes use up all system resources causing a DoS attack
144
What is a trojan?
Piece of software that appears to be legitimate to trick user into executing it but also performs malicious actions Aren't self-replicating and don't infect other files Only operate if the victim runs the program
145
What is the main defence against trojans?
Educate users about the risk of downloading and installing software
146
What is usually the main objective of trojans?
Steal confidential information Inflict damage
147
What is a RAT?
Computer may become part of a bot under the remote control of a hacker
148
What is a botnet?
Network of computers that are under the control of a single operator who can instruct all of the computer to do something at the same time
149
What can a botnet do?
Send out spam emails Perform a distribute denial-of-service (DDoS) attack on a chosen target
150
What is spyware?
Type of malicious software that is installed on a device without the user's knowledge, which captures data from the device and sends it back to the creator Gathers information on a person and how they use a computer
151
What data can spyware gather?
Monitor internet usage Send harmless but annoying adverts Taking and reporting back screenshots
152
How can spyware be installed?
Visiting a suspicious website Clicking a link in an email Downloading a legitimate program that's been bundled with malware
153
How can spyware be removed?
With a removal tool but user must be alerted to its presence in order to know to run the clean-up tool Routinely run anti-malware tools
154
What is ransomware?
Locks a computer or encrypts files and therefore prevents user from accessing their data Attacker will demand fee is paid before they release the files, although there is no guarantee that the user will get their files back even after they've paid the moment
155
What is anti-malware
Designed to protect a computer system by detecting and blocking threats Continually monitors files and software being accessed by OS to detect signs of malicious intent Software can be configured to deal with different threats
156
What is back up?
A copy of the original data is taken and stored in a different location
157
What is archive?
Original data is removed and stored in a different location
158
What are the reasons to restore files from backup?
Accidentally deleted Virus infects files Lose the original Hardware failure (after fire/flood) Data changed without intent
159
What are the two types of backup?
Full backup Incremental backup
160
What is a full backup?
Backs up everything on the system
161
What is an incremental back up?
Only updates files that are changed?
162
What is a disk formatter?
Prepares a secondary storage device to be used to store files Erases any data currently on the device Makes sure the settings are correct so that it's compatible with the OS
163
What is a file repair?
Designed specifically to recover files that have been corrupted or damaged files that can't be opened any more Attempts to repair damage to the file so it can be opened correctly by appropriate software application Greater range of tools to restore and repair corrupt files
164
What is a disk checker?
Scans secondary storage device to check for corrupted files Attempts to fix errors and gives option to delete them if not possible to restore the files
165
When does a file repair need to be used?
When data in file has gone missing or become disorganised making it unreadable by software attempting to open it
166
How can a file be damaged?
Bug in the software that wrote data to file Malware that corrupts file maliciously
167
What is a file manager?
Provides GUI to enable user to manage files on their computer (rename, copy, paste, delete)
168
What is a disk repair?
Hard disk drive can develop faults that result in sectors becoming corrupted or unreadable Software repairs disk by replacing data in bad sections with an empty sector so data can be read by computer
169
How can the bad sectors be caused?
Sudden loss of power System crashes Disk being exposed to static electricity
170
What can bad sectors cause?
Computer to run slowly Files to become inaccessible Whole disk to become unreadable
171
What is open source software?
Source code can be read and edited Comes in a readable format Can be tailored to needs to developer
172
What are some examples of open source software?
Linux Libre Office Firefox VirtualBox VLC
173
What are the advantages of open source software?
Can share software with others User can modify it Source code available for all to see Free licence New versions must come with same sharing/freedom licences
174
What are the disadvantages of open source software?
Support must be paid for Finished quality of software can vary, although some can be very high quality
175
What is closed source software?
Source code cannot be read, edited or adapted Applications come as executable format Usually licence fee charged Developed by commercial company
176
What are some examples of closed source software?
Adobe Google Earth Microsoft Office
177
What are the advantages of closed source software?
Support is usually free, although a premium can sometimes be charged Developer provides free updates for a set length of time Company obliged to provide software that's fit for purpose as covered by Trades Description Act
178
What are the disadvantages of closed source software?
Source code not readily available Software cannot be altered Software cannot be shared with others
179
What are open source applications?
Code available for other parties to see and alter
180
Who pays the development cost of open source applications?
Spreads cost of development Often volunteers will improve the code for free
181
Is code available in open source applications?
Available for other parties to see and alter
182
Who are open source applications often developed by?
People who do not have full knowledge of all the functionalities and methods used by the software, so solutions may be inefficient
183
Are there deadlines for open source applications?
No deadlines for development Software often has 'quick fixes' to solve problems rather than full solutions to problems so there is no guarantee that the software will function fully
184
How are open source applications tested?
Lack formal development methods and testing which can make the software unreliable
185
Who pays the cost of development of closed source applications?
Wholly funded by the company Costs recovered through sales
186
Is code available in closed source applications?
Kept by author Only executable distributed
187
Who are closed source applications often developed by?
Professionally developed in-house by the company that produced the program Technical solution is fully understood and improvement will be able to incorporate this to produce a more efficient solution
188
Are there deadlines for closed source applications?
Has formal deadlines and timescales for updates and produced with full solutions which the company is accountable for
189
How are closed source applications tested?
As developed in-house, tested fully and not released until software considered reliable
190
What is machine code?
List of binary instructions in memory that the CPU fetches one line at a time and decodes what they mean before executing them
191
What is an opcode?
First binary value Operation code
192
What is an operand?
Second binary value Address in memory of the data to be processed
193
What is assembly language?
Replaced opcode with mnemonic (one-to-one relationship) Needs a translator to convert code to machine code
194
What are the problems with machine code?
Error-prone Takes a long time to write Lots of repetitions Inefficient code
195
What is an instruction set?
Complete list of instructions supported by processor
196
What is source code?
Programs originally written in high or low level languages
197
Can source code be run by a computer?
Not unless it's translated
198
What are high-level languages?
Consist of key words and command statements
199
What are the advantages of high level languages?
Understandable - commands easier to learn, write and debug Portable - can be transferred and used on different types of computer (translator not source code that handles computer's architecture) Problem-focused - focus attention on problem-solving, not dealing with hardware specifics for machine it's run on
200
What are the three types of translator?
Assembler Interpreter Compiler
201
What language is an assembler suitable for?
Low level
202
What is an assembler?
One mnemonic in assembly language equivalent to an opcode Different assembler needed for each machine or chipset
203
What language is an interpreter most useful for?
High level
204
How does an interpreter work?
Code is put onto user's machine along with interpreter Translated line by line Next line only translated if line before has no syntax errors Once a line translated, code executed by CPU If there is an error, program won't run and user will be shown error
205
With an interpreter, can source code be viewed?
Yes
206
What are the advantages of interpreters?
Don't need to recompile software and distribute to different platforms when changing software Can change code and will be interpreted by relevant interpreter on hardware (compatibility across platforms)
207
What are the disadvantages of interpreters?
Have to have correct interpreter to run on a different computer Can be slower to run as being translated one line at a time
208
What code is a compiler most suitable for?
High level
209
How does a compiler work?
Translates code written in a high level language to object code Checks all lines of code for syntax rules then converts entire source code into object coed Code fully translated into object code and executable file made Executable file can run on user's machine but differs depending on the type of machine being used
210
With a compiler, can source code be viewed?
No
211
What are the advantages of compilers?
Source code cannot be seen when running the file as it is already translated Quick to run as already translated
212
What are the disadvantages of compilers?
Can take long time to translate as all done at once May find a lot of errors as translating all code at once
213
What is intermediate code?
When compiler/interpreter only translates code to 'half-way' stage (more efficient) Provides 'standard form' of code for translation to machine code High-level -> intermediate -> machine Can be run on a VM allowing code to run faster than interpreted code while allowing code to run cross-platform unlike compiled code
214
What does stages of compilation mean?
Set of stages that source code goes through so that executable object code can be produced
215
What are parses?
To translate code from source to machine code, translator run through series of parses Each parse of code designed to carry out certain tasks
216
What should there be at the end of the parses?
Efficient machine code that can be ru
217
What are the stages of compilation?
Lexical analysis Syntax and semantic analysis Code generation and optimisation
218
What are the tasks in lexical analysis?
Removes all white space and comments Turns remaining code into tokens Creating a symbol table
219
What is removed in lexical analysis from the code?
Comments Spaces Blank lines
220
How does lexical analysis turn the remaining code into tokens?
Compiler looks for operators, reserved words, variables which are split into tokens Analyses each line of code and assigns token to each part of the code Identifiers checked against set of rules Reserved words (print) only used as keyword tokens
221
What does a symbol table store?
Identifier or key word Token class Data type Run time address or value Scope
222
What are some examples of token classes?
Integers White space Identifiers Keywords Operator Individual token classes
223
What simple error-checking occurs in lexical analysis?
Look for illegal identifiers x and y would be flagged Misspelt keywords and undeclared variables NOT detected
224
Does syntax or semantic analysis come first?
Syntax
225
What is syntax analysis?
Code is checked against rules of the language
226
What happens in syntax analysis?
Analysis syntax of the statements to ensure they conform to the rules of grammar for the computer language in question Abstract Syntax Tree created
227
What are some examples of syntax rules?
Indentation Missing brackets Keywords misspelt Missing code Undeclared variables
228
What is an Abstract Syntax Tree?
Maps structure of program, first dropping the brackets, semicolons, etc that were used by the programmer If required tokens missing from the tree or in the wrong place, compiler will report an error
229
What does an AST help identify?
Errors in the structure of the code
230
What is semantic analysis?
Code is checked to see if it is valid within the given context
231
What are some examples of semantic errors?
Data type declaration mismatch Trying to access an array index that is out of bounds Variables being used before they've been declared Wrong number of parameters passed into subroutine Trying to access a variable that's out of scope Attempting to use a reserved word from the language (e.g. print) as a variable name
232
What happens in code generation and optimisation?
Separate program is created that is distinct from the original source code Code generated is object code (binary equivalent of the source code)
233
What is object code?
Executable version of the code BEFORE LINKED LIBRARIES ARE INCLUDED
234
What happens in code generation?
AST converted into object code Major distinguishing feature between compilation and interpretation is interpreters don't produce a separate executable file
235
What is code optimisation?
Takes place throughout the process but mainly in the final stage Attempts to reduce execution time of compiled program Removes redundant code and makes code as efficient as possible Reduces amount of memory as some variables may not be required and speeds up the processing as it's more efficient
236
What are the advantages of code optimisation?
Some compilers will be better at optimisation that others (what can make a good compiler) More efficient code Less memory needed Quicker processing of code
237
What are the disadvantages of code optimisation?
Some optimisation may remove code it thinks is redundant and may give unexpected results Can take a long time to optimise code
238
What is a library?
A pre-written collection of code that allows the programmers to import functionality into their own programs
239
What are programming libraries?
Gives you access to many specialised functions Saves programmers from having to reinvent the wheel when writing a new program Usually been thoroughly tested and is therefore reliable and efficient
240
What are some examples of programming libraries?
random - makes random choices tkinter - creating GUI pygame - creating Python game matplotlib - creating graphs numpy - performing mathematical operations on arrays pandas - analysing, cleaning, exploring and manipulating data
241
What are linkers?
Used to combine together compiled code from various sources along with any code being pulled in from pre-written libraries into a single executable program file
242
What do linkers do?
Resolve all cross-references between the object code files created through compilation and creates a single executable program Includes any links to any library code required by the object code into an executable file
243
What are the two types of linking?
Static Dynamic
244
What is static linking?
Code needed from the libraries is copied and included in the executable file
245
What are the advantages of static linking?
Code doesn't need to access external libraries during run time Therefore if a library is missing on the client computer, the program will crash
246
What are the disadvantages of static linking?
However compilation could take a long time Executable will be large and take up more space in RAM
247
What is dynamic linking?
Compiled versions of the libraries are stored on the computer and linked with the code by the OS at run time
248
What are the advantages of dynamic linking?
Less memory needed therefore quicker to process Less code needed to compile so it is quicker
249
What are the disadvantages of dynamic linking?
If a library is missing, the code will not run
250
What is a loader?
A program which is part of the OS which is responsible for loading the correct files and libraries into the main memory when the program is run (used when dynamically fired)
251
What does SDLC stand for?
Systems Development Life Cycle
252
What are the stages of a SDLC?
Analysis Design Development Testing Evaluation Maintenance
253
What happens in the analysis stage of a SDLC?
Feasibility study (cost, timescale, possibility) Research (interviews, observation, data flow, future plans/growth of company) Processing and defining user requirements so they're understood Finding out existing problems software is trying to solve Working out what data will be in the system and its origin, uses, volumes and characteristics What needs to be done in systems and what happens if error occurs
254
What are the outputs of the analysis stage of SDLC?
Problem definition - clear explanation of problem and its domain System requirements/objectives - clear description of what the systems need to do (specific, measurable, achievable, realistic, time bound)
255
What happens in the design stage of an SDLC?
System architects oversee design process where they draw attention to specific skills and expertise from UI designers, database designers Database Hardware and software required Test plan Design specification - document
256
What are the outputs of the design stage of a SDLC?
UI (design menus and UIs) System outputs (reports, emails, graphs) Algorithms (flowcharts, pseudocode, modular structure) What data structures data will be held in Security features
257
What happens in the development phase of a SDLC?
Code solution Most projects completed in teams with wide range of experience and skills so can specialise in their area of expertise when working If done by organisation, will be set style and standards that follows company's in-house conventions Project manager oversee project through development process White box testing where each module is tested as it is developed by examining code written and efficiency and alpha testing
258
What happens in the testing phase of a SDLC?
Testing for robustness and whether it fulfils the criteria Black box testing where inputs and outputs of systems are examined Beta testing
259
What happens in the evaluation phase of a SDLC?
Can be carried out throughout the project but mainly done once project completed Reviewed in terms of functionality, effectiveness, usability, reliability, maintainability, extendibility Compared against requirements Technical documentation - explains how system works and allows for those taking over code in future to understand work done User documentation - required for more complex parts of the code and for those less experienced Client signoff
260
What happens in the maintenance phase of a SDLC?
Agreed maintenance period Fixing bugs that arise in the system Changing software where it doesn't work
261
What is scope creep?
Additional requirements added during the project
262
What are the software development methodologies?
Waterfall Spiral Rapid application development (agile methodology) Extreme programming (agile methodology)
263
What is the waterfall method?
Each stage is completed in turn so stages and COMPLETED SEQUENTIALLY Next stage doesn't start until previous one is completed, signed off and documented Previous stage can be returned to however developers must then complete next stages CLEARLY DEFINED stages
264
When is the client involved in a waterfall method?
Analysis stage to help project team work out requirements of system Then little involvement until project is developed
265
What are the suitable uses of a waterfall method?
When requirements are very clear and well-defined (at beginning of project) Large-scale development projects due to ease of management Not suitable for innovative or complex projects
266
What are the advantages of the waterfall method?
Everyone is very clear on their responsibilities at each stage Simplicity makes it easy to manage Easy to see if project is running to schedule
267
What type of method is the spiral model?
Iterative method
268
What is the spiral model?
Always complete a RISK ANALYSIS in a cycle (whether cost is spiralling, timeframe, out of data technology, changing business processes) In each cycle, prototype is developed, reviewed and evaluated
269
When is the client involved in the spiral model?
Review with client in EVERY CYCLE to get client feedback
270
What are the suitable uses of the spiral model?
Large, complex projects where risk is a key factor Projects containing high level of risk or uncertainty Large scale problems
271
What are the advantages of the spiral model?
Risk placed at the heart of this model Excellent for projects which contain high level of risk or uncertainty Very suitable for large scale problems
272
What are the disadvantages of the spiral model?
Risk is SUBJECTIVE (what one person sees as a big risk, may not be considered such a big risk to a project) Need to have a member of the team skilled in identifying and quantifying risk, which is highly specialised skill Takes time in the project and costs money Complex nature of risk analysis adds to expensive If risk analysis done badly, project will suffer
273
Which methodologies are classified as agile methodologies?
Rapid Application Development (RAD) Extreme programming
274
What are agile methodologies?
Prototypes are created and feedback gained from the client ASAP Feedback used to inform next prototype
275
What are the suitable uses of agile methodologies?
Small to medium projects
276
What are the advantages of agile methodologies?
Can be used for big projects if decomposed into sub-projects
277
What are the disadvantages of agile methodologies?
Can result in scope creep
278
What is RAD?
Based on building a SERIES OF PROTOTYPES each of which adds to the previous and is reviewed by the client Less emphasis on planning and documentation and more on developing something and then using this to inform next stage Objectives/requirements GRADUALLY REFINED during each stage/prototype
279
What are suitable uses of RAD?
When client requirements not well defined Not suitable for projects where code efficiency is important (focus on usability rather than how product works) Doesn't scale well for large projects with big teams
280
What are the advantages of RAD?
Initial prototypes developed quickly Requirements don't need to be entirely clear from the start Continuous feedback from client means end project likely to have excellent usability
281
What are the disadvantages of RAD?
Poorly written, inefficient, patched code Regular contact must be maintained at all times
282
What is extreme programming?
Series of short releases and short cycles Each release is fully working Focus on refinement/quality and efficiency of code (completed through PAIRED PROGRAMMING) Development/feedback loops shorter as prototypes not produced but FULLY WORKING versions produced
283
When is the client involved in extreme programming?
Continual interaction as member of client team part of development team
284
What are the advantages of extreme programming?
Efficient, robust code produced Fewer bugs on release and high performing software Has a very high emphasis on programming so quality of end code likely to be very high
285
What are the disadvantages of extreme programming?
Difficult if not all of team and end user can be in same place Client must be able to commit to having a full time representative working with development team Requires team of programmers working in close collaboration, unlikely to work well if distributed geographically
286
What are the types of testing?
Black box testing White box testing Beta testing Alpha testing
287
What is black box testing?
Tests just inputs and outputs Not concerned with quality of algorithms
288
What is white box testing?
Tests logic of a problem All paths through Quality of algorithm checked
289
What is alpha testing?
Tests very early version of software Restricted to company Employees provide feedback
290
What is beta testing?
Tests almost finished version of software Extended Invited group of external testers who provide feedback
291
What is the order of the four types of testing?
Start of development - white box testing - black box testing - alpha testing - beta testing End of development
292
What are programming paradigms?
Used to specify an overall approach to writing program code
293
What is Turing complete?
Most programming languages in most paradigms are this Can solve all problems a computer is able to solve
294
What is the structure of programming paradigms?
Types of languages -> low level, higher level Low level -> machine language, assembly language Higher level -> imperative, declarative Imperative -> procedural, object-orientated
295
What is imperative language?
Write a sequence of instructions for the computer to perform using sequence, selection and iteration Focus is on stating HOW A COMPUTER SHOULD OPERATE (TELLING IT WHAT TO DO)
296
What is a declarative language?
Focus on what the program should achieve, the OUTCOMES OF THE CODE Used in intelligent systems and makes use of a knowledge base
297
What is an example of a declarative language?
SQL
298
What is a procedural programming paradigm?
Where program code is divided up into self-contained procedures/functions (subroutines) which are discrete blocks of code that carry out a single task Systems built by combining these procedures Procedures share data by passing data between them or through global variables Procedures have their own variables not accessible from outside the procedure
299
What is the programmer responsible for in a procedural paradigm?
Specifies steps needed to execute the programmer and in what order
300
How is logic of a program expressed in a procedural programming paradigm?
Series of procedure calls
301
What are some examples of procedural languages?
Pascal C Visual Basic Python
302
What is an object-orientated paradigm?
Identify the self-contained objects that make up the system and the way they interact with each other Systems built around objects Each object contains both program routines (methods) and data being processed Objects can be easily reused and inherited without having to rewrite code Because objects are self-contained and simple they are more reliable and easier to program
303
What is the programmer responsible for in an object-orientated paradigm?
Designed self-contained objects
304
What are some examples of object-orientated languages?
C++ Delphi Java Visual Basic
305
What are the characteristics of assembly language?
One-to-one relationship with machine code Use mnemonics (short codes) to represent specific sets of machine code 1s and 0s Specific to processor Use symbolic address as labels to reference locations of data in memory
306
What are low-level languages?
Specific to instruction set of the processor Defined by processor manufacturer Makes code written non-portable (only run on processor of same type it was written for)
307
What are some examples of LMC instruction set?
LDA - load STA - store ADD - add SUB - substract INP - input OUT - output HLT - end program BRZ - branch if 0 BRA - branch always BRP - branch if 0 or positive
308
What modes of addressing is used in high level languages?
Mode of addressing is abstracted from the developer
309
What mode of addressing is used in assembly language?
Developer would directly use different modes of addressing depending on what they wanted to do
310
What are the different modes of addressing?
Immediate Direct Indirect Indexed
311
What is immediate addressing?
Hard coding the value into the instruction Operand is not a memory address but the value to be used
312
How fast is immediate addressing?
Fastest method as don't need to access computer's memory
313
What is direct addressing?
Operand is absolute memory address is used and not the value Relies on value always correctly being at the location specified, which may cause problems if the code is moved
314
When is direct addressing generally used?
For a computer system that uses only one program that wouldn't be relocated in memory (on an embedded system)
315
How fast is direct addressing?
Quick method but not as quick as immediate
316
What is indirect addressing?
Often used with linkers and loaders Address of data held in an intermediate location - therefore address of where the data is stored must be looked up Point to a memory location that contains physical address of where we need to get data from Data (such as programming library) can be put in memory location and therefore be moved Address of where to find this stored as intermediate address Intermediate address location part of instruction
317
How fast is indirect addressing?
Slower than previous methods but more flexible when loading larger amounts of data
318
What is indexed addressing?
Final address of data determined by starting address and an offset Use an index to offset the value and find the appropriate value within an array
319
What is indexed addressing used for?
Arrays
320
What is a class?
A template outlining attributes (properties) and methods (actions/behaviours)
321
What are instantiated from classes?
Objects
322
What is an object?
Instance of a class
323
What is an attribute?
A piece of data to store about an object/a property of an object
324
What is a method?
The action that can be performed on an object
325
How are methods created?
Adding subroutines to a class definition
326
What is encapsulation?
Implemented by setting attributes and methods to public/private Object should bind together attributes and methods that manipulate the data Does this so that data is protected
327
What is public vs private?
Attributes and methods can be set to these to determine if code external to the class can call/access the attributes/methods or not Getter and setter methods are used to access attributes that cannot be directly accessed by code external to the class
328
What is polymorphism?
A method can perform different actions depending on the object it is called on
329
How is polymorphism implemented?
By overriding where an inherited method is redefined in a subclass and therefore this would override the inherited method when called
330
What is over-loading polymorphism?
Implementing a method multiple times to accept different parameters
331
What is overriding polymorphism?
Implementing an inherited method differently in a sub/child class
332
What is inheritance?
Where ALL ATTRIBUTES AND METHODS from a parent/super class can be used/called within a child/sub class
333
What is multiple inheritance?
When a class has two or more parent classes
334
What is a constructor?
Called when an object is created/instantiated
335
What is a constructor used for?
Initialising attributes
336
What is a constructor in Python?
__init__()