Please enable JavaScript.
Coggle requires JavaScript to display documents.
Software and software development - Coggle Diagram
Software and software development
Systems software
Operating systems
A collection of programs that provide an interface between the user and the computer
Provide the following features:
Memory management
Resource management e.g. scheduling
File management
Input/output management
Utility software
Security
User interface
Memory management
Main memory is often not large enough to store all of the programs being used
Paging, segmentation and virtual memory are techniques used by the operating system to ensure memory is shared effectively by programs
Paging:
Memory is split into equal-sized sections known as pages
Pages are swapped between main memory and the hard disk as needed
Segmentation:
Memory is split up into logical sized divisions, called segments
Segments vary in size
Segments represent the structure and logical flow of the program
Virtual memory:
A section of the hard drive acts as RAM when the space in main memory is insufficient to store programs being used
Sections of programs not currently being used are temporarily moved into virtual memory through paging
This frees up memory for other programs in RAM
The key issue with using these techniques is disk thrashing, when the computer 'freezes' due to pages being swapped too frequently between the hard disk and main memory
Interrupts
Signals generated by software or hardware to indicate to the processor that a process needs attention
Interrupts have different priorities and this is considered when allocating processor time
They are stored within an abstract data structure called a priority queue in an interrupt register
Interrupt service routine:
Processor checks the interrupt register at the end of each Fetch-Decode-Execute cycle
If there is an interrupt exists with a higher priority to the current process
The current contents of the registers in the CPU are transferred into a stack
The relevant interrupt service routine (ISR) is loaded into RAM
A flag is set to signal the ISR has begun
The flag is reset once the ISR has finished
This process is repeated
If there are no interrupts with a higher priority to the current process
The contents of the stack are popped back into the registers
Fetch-Decode-Execute cycle resumes
Scheduling
Operating system ensures all sections of programs being run (known as 'jobs') receive a fair amount of processing time using scheduling
Scheduling algorithms can either be:
Pre-emptive -> Jobs are actively made to start and stop by the operating system. For example: Multilevel feedback queues, Shortest time remaining, Round robin
Non pre-emptive -> Once a job has started, it is left alone until it is completed. For example: First come first served, Shortest job first
Round robin:
Each job is given a section of processor time - a time slice - within which it runs
Once each job in the queue had used its first time slice, they are given another slice of processor time until a job has been completed
Completed jobs are removed from the queue
Advantages:
All jobs will eventually be attended to
Disadvantages:
Longer jobs will take a much longer time for completion
Round robin does not take into account job priority or urgency
First come first served:
Jobs are processed in chronological order by which they entered the queue
Advantages:
Straightforward to implement
Disadvantages:
Does not take into account job priority or urgency
Multilevel feedback queues:
This makes use of multiple queues, each which is ordered based on a different priority
Advantages:
Takes into consideration different job priorities
Disadvantages:
Difficult to implement
Shortest job first:
The queue storing jobs to be processed is ordered according to the time required for completion, with the longest jobs being serviced at the end
Advantages:
Suited to batch systems, as waiting time is reduced
Disadvantages:
Requires processor to calculated how long each job will take
Processor starvation is short jobs are continuously added to the queue
Does not take into account job priority or urgency
Shortest remaining time:
The queue storing jobs to be processed is ordered according to the time left for completion, with the jobs with the least time to completion being serviced first
Advantages:
Throughput is increased as shorter processes can be quickly completed
Disadvantages:
Does not take into account job priority or urgency
Processor starvation if short jobs are continuously added to the queue
Types of operating system
Distributed:
Run across multiple devices
Means the load of a task is spread across multiple computer processors
Embedded:
Built to perform a small range of specific tasks
Catered towards a specific device e.g. a household appliance
Limited functionality and hard to update
Consume less power than other types of OS
Multi-tasking:
Enables user to carry out tasks simultaneously
Time slicing is used to switch quickly between programs and applications in memory
Multi-user:
Multiple users make use of one computer
A scheduling algorithm is used to allocate processor time fairly between jobs and prevent processor starvation
Real time:
Used in time-critical computer systems and designed to perform a task within a guaranteed time frame
BIOS
Basic input output system is the first program that runs when a computer system is switched on
Runs a series of tests before the operating systems is loaded into memory:
POST (power-on self test) which ensures that all hardware is correctly connected and functional
Checking the CPU clock, memory and processor
Testing for external memory devices
Device drivers
Computer programs that allow the operating system to interact with hardware
Are specific to the computer's architecture
Specific to the operating system
Virtual machines
A theoretical computer and a software implementation of a computer system
Provides an environment with a translator for intermediate code to run
Intermediate code:
Code halfway between machine code and object code is called intermediate code
Independent of processor architecture so can run across different machines and operating systems
Takes longer to execute than low-level code
Uses of virtual machines include:
Testing programs
Protection from malware
Running software compatible with different versions/types of operating systems
Applications generation
Nature of applications
Applications software:
Used by the end-user
Perform one specific task
E.g. desktop publishing, word processing, spreadsheets, web browsers
Systems software:
Manages computer resources
Ensures consistently high performance
E.g. library programs, utility programs, operating system, device drivers
Utilities
Maintain a high-performing operating system
Each utility has a specific function
E.g. compression, disk defragmentation, automatic updating, automatic backup
Open source vs closed source
Open source
Definition:
Can be used without a license
Distributed with the source code
Advantages:
Improved by community effort
Technical support from online community
Can be modified and sold on for profit
Disadvantages:
Inadequate support available. No user manual
Lower security
Closed source
Definition:
User must hold correct license
Users cannot access source code
Company owns the copyright license
Advantages:
Regular, well-tested updates
Company provides expert support and user manuals
High levels of security as developed professionally
Disadvantages:
Licensed has restrictions about use
Users cannot modify and improve code
Translators
A program that converts source code into object code. There are three types:
Interpreter:
Translate and execute code line-by-line
Produce an error if a line contains an error
Slower than running compiled code
Correct interpreter required to run on different platforms
Code is platform-independent
Useful for testing code
Compiler:
Translate high-level code into machine code all at once
Initial compilation process is longer than using other translators
Compiled code is platform-specific
Compiled code can be run without a translator present
Assembler:
Assembly code is low-level language that is platform specific
Assemblers translate assembly code into machine code
Each line of assembly code is equivalent to almost one line of machine code
Stages of compilation
Lexical analysis:
Whitespace and comments are removed
Keywords and identifiers are replaced with tokens
Information about tokens is stored in a symbol table
Syntax analysis:
Tokens analysed against rules of the programming language
Syntax errors are flagged up
Abstract syntax tree is produced
Code generation:
Abstract syntax tree used to produce machine code
Optimisation:
Aims reduce execution time
Is very time consuming
Redundant parts of code are removed
Linkers, loaders and use of libraries
Linkers
Software that links external modules and libraries included within the code
Static linker:
Module/library code is copied directly into the file
Increases the size of the file
Dynamic linker:
Addresses of modules/libraries are added to the file
External module/library updates automatically feed through to the main file
Loaders
Programs provided by the operating system
Fetches the library/module from the given memory location
Use of libraries
Pre-compiled programs which can be incorporated within other programs
Error-free
Save time and effort of developing and testing modules
Can be reused across multiple programs
Save programmers from 'reinventing the wheel'
Software development
Programming methodologies
Software development life cycles (SDLCs) all consist of the following stages:
Analysis
Design
Development
Testing
Alpha testing
Beta testing
White box testing
Black box testing
Implementation
Evaluation
Maintenance
Waterfall lifecycle:
Stages are completed in sequence, from start to finish
Clear structure makes this a model that is easy to follow
To make a change, programmers must revisit all stages in between
Low user involvement
Agile methodologies:
Collection of methodologies which aim to improve the flexibility of SDLCs
Adapt quickly to changes in user requirements
Different sections of the program are developed in parallel so can be at different stages of development simultaneously
Working prototype is delivered early on and improved in an iterative manner
Less of a focus on documentation
User satisfaction is prioritised
Extreme programming:
Example of agile model
Development team is a pair of programmers and a representative end-user
'User stories' are used to determine systems requirements
Produces high-quality code and highly-usable software
Programmers work no longer than forty hours a week
Hard to produce high quality documentation
Spiral method:
Used to manage risk-heavy projects
Has four key stages:
Analysing system requirements
Pinpointing and mitigating risks
Development, testing and implementation
Evaluating to inform the next iteration
Project terminated if too risky
Specialist risk-assessors must be hired which is expensive
Rapid application development:
Iterative methodology which uses partially functioning prototypes
User requirements are gathered using focus group
'Incomplete' version of the solution is given to the user to trial
User feedback is used to generate next, improved prototype
Final prototype matches user requirements fully
Used where user requirements are incomplete or unclear at the start
Code may be inefficient
Writing and following algorithms
Algorithm = A set of instructions used to solve a problem
All good algorithms have certain key qualities:
Inputs must be clearly defined - what is valid and what is invalid?
Must always produce a valid output for any defined input
Must be able to deal with invalid inputs
Must always reach a stopping condition
Must be well-documented for reference
Must be well-commented so modifications can easily be made
Merits, drawbacks and uses of programming methodologies
Waterfall
Merits:
Straightforward to manage
Clearly documented
Drawbacks:
Lack of flexibility
No risk analysis
Limited user involvement
Uses:
Static, low-risk projects which need little user input, such as a piece of general-purpose software
Agile
Merits:
Produces high quality code
Flexible to changing requirements
Regular user input
Drawbacks:
Poor documentation
Requires consistent interaction between user and programmer
Uses:
Small to medium projects with unclear initial requirements
Extreme programming
Merits:
Produces high quality code
Constant user involvement means high usability
Drawbacks:
High cost of two people working on one project
Teamwork is essential
End-user may not be able to be present
Uses:
Small top medium projects with unclear initial requirements requiring excellent usability
Spiral
Merits:
Thorough risk-analysis and mitigation
Caters to changing user needs
Produces prototypes throughout
Drawbacks:
Expensive to hire risk assessors
Lack of focus on code efficiency
High costs due to constant prototyping
Uses:
Large, risk-intensive projects with a high budget
Rapid application development
Merits:
Caters to changing user requirements
Highly usable finished product
Focus on core features, reducing development time
Drawbacks:
Poorer quality documentation
Fast pace and late changes may reduce code quality
Uses:
Small to medium, low-budget projects with short time-frames
Types of programming language
Programming paradigms
Different approaches to using a programming language to solve a problem
Split into two broad categories - imperative and declarative - which can be broken down in to more specific paradigms
Imperative
Use code that clearly specifies the actions to be performed
Procedural:
Widely-used paradigms as it can be applied to a wide range of problems
Easy to write and interpret
Written as a sequence of instructions
Instructions are carried out in a step by step manner
Object oriented:
Suited to problems which can be broken into reusable components with similar characteristics
Based on objects formed from classes which have attributes and methods
Focuses on making programs that are reusable and easy to update and maintain
Declarative
States the desired result and the programming language determines how best to obtain the result
Detains about how result is obtained are abstracted from the user
Functional:
Functions form the core of the program
Function calls are often combined within each other
Closely linked to mathematics
Logic:
A set of facts and rules based on the problem is defined
Queries are used to find answers to problems
Procedural language
Simple to implement and applicable to most problems
Not possible to solve all kinds of problems or may be inefficient to do so
Provide traditional data types and data structures
Structured programming is a popular subsection of procedural programming in which the control flow is given by four main programming structures:
Sequence
Selection
Iteration
Recursion
Assembly language
Low level language is the next level up from machine code
Uses mnemonics, which are abbreviations for machine code instructions
Commands used are processor-specific
Each line in assembly language is equivalent to one line of machine code
Modes of addressing memory
Machine code instructions are made up of an opcode and operand
Opcode specifies the instruction to be performed and the addressing mode
Addressing mode specifies how the operand should be interpreted
Operand holds a value related to the data on which the instruction is to be performed
There are four addressing modes you need to know:
Immediate addressing: The operand is the actual value upon which the instruction is to be performed
Direct addressing: The operand gives the address which holds the value upon which the instruction is to be performed
Indirect addressing: The operand gives the address of a register which holds another address, where the data is located
Indexed addressing: An index register is used, which stores a certain value. The address of the operand is determined by adding the operand to the index register
Object oriented languages
Classes, objects, methods and attributes:
A class is a temp[late for an object and defines the state and behaviour of an object
State is given by attributes which give an object's properties
Behaviour is defined by the methods, which describes the actions it can perform
Classes can be used to create objects by a process called instantiation
An object is a particular instance of a class, and a class can be used to create multiple objects
A setter is a method that sets the value of a particular attribute
A getter is another special method used in OOP which retrieves the value of a given attribute
Getters and setters ensure attributes cannot be directly accessed and edited but can only be altered by public methods. This is called encapsulation
Every class must also have a constructor method which allows a new object to be created
Inheritance:
Process in which subclass inherits all of the methods and attributes of the superclass
Subclass can also have its own additional properties
Polymorphism:
Enables objects to behave differently depending on their class
Overloading: Passing in different parameters into a method
Overriding: Redefining a method so that it functions differently and produces a different output
Advantages of OOP:
High level of reusability
Code made more reliable through encapsulation
Makes code easy to maintain and update
Casses can be reused as a black box which saves time and effort
Disadvantages of OOP:
Requires an alternative style of thinking
Not suited to all types of problems
Generally unsuitable for smaller problems