paper 1 Flashcards
examples of analysis stage work during software dev
- problem definition
- list of objectives
- data model
- interviews
- questionnaires
- research existing solutions
- acceptable limitations / constraints
why use named constants
- makes clear what the value held by the constant actually is / used for
- if the constant’s value would need to be changed, it only needs to be changed in one place
- improves readability of the code
purpose of a hierarchy chart
- represent the structure of the program
- to aid decomposition of a problem
differences between local and global variables
- global variables accessible to all parts of the program / have global scope
- global variables declared in main program block
- local variables declared in subroutine
- local variables accessible only in program block/subroutine they were declared in
why use local variables
- makes a subroutine self-contained
- easier to re-use subroutine in another program
- releases storage when subroutine terminates
decomposition
breaking a problem into a number of sub-problems that are easier to understand, program and maintain
automation
models are put into action to solve problems. involves creating algorithms for performing actions on, and with, the data that has been modelled
composition
combining procedures into compound procedures
problem abstraction / reduction
details are removed until the problem is represented in a way that is possible to solve because the problem reduces to one that has already been solved
why use meaningful variable names
easier to follow program process
array
finite, ordered set of elements of the same data type
what is a structured programming approach
- decomposition of a problem
- makes use of subroutines
- makes use of control structures - sequence / selection / iteration
what is a subroutine
named block of code performing a specific task within a program
features of a structured program
- selection, iteration, sequence
- modular
- exit gate
advantages of modular programming
- easy to understand subroutines as small units of code - easier to understand, debug, maintain
- subroutines can be tested independently, shortening dev time
- modules can be reused in other programs
why use exception handling
- avoid errors which will cause the program to crash
tasks performed during design soft-dev stage
- data structures specified
- algorithms / ui / screen designs designed
- design appropriate module structure
task performed during technical soft-dev stage
- implementation / writing of code
task performed during testing soft-dev stage
- system tested for presence of errors, using selected test data covering normal, boundary and erroneous data
- testing for logic errors, syntax errors, runtime errors
task performed during evaluation stage
- system evaluated according to given criteria
erroneous data
data outside of expected range and/or wrong data type
strategies for problem solving
- exhaustive search
- binary search
exhaustive search
trying every possible method / searching every possible item
linear search
search item compared with each element in list in linear fashion
looks at, on avg, n/2 items
binary search
- look at middle item
- if not correct item, if middle item greater than one being sought, discard second half, vice versa
- repeat until item found
if a list of data has 2^n items, it will look at, at max, n items
top-down design
decomposition of a task, where problems broken down until simple enough to be written as self-contained modules
what does a good algorithm feature
- should allow for invalid inputs
- should execute efficiently, in as few steps as possible
- designed in an easily understandable / modifiable way
- always terminates at some point
bubble sort
in an array of n items:
- go through array, comparing each item with item next to it
- if item greater, swap
- last item in the array will be in correct place after first pass
- repeat n - 1 times, reducing by 1 on each pass
representational abstraction
representation arrived at by removing unnecessary details
abstraction by generalisation or categorisation
grouping by common characteristics to arrive at a hierarchical relationship of the ‘is a kind of’ type
information hiding
process of hiding all details of an object that do not contribute to its essential characteristics
procedural abstraction
represents a computational method, actual values used in a computer separate from overall design - involves only writing a subroutine and passing abstracted parameters
functional abstraction
particular computation method is hidden - think of it like a primary school number box thing, where you put in inputs and you get outputs, and you don’t know what happens inside of the box
data abstraction
details of how data are actually represented are hidden - separate the way that a compound data object is used, from the details of how it is constructed
what is a finite state machine
abstract model of how a machine reacts to an external event
in a finite state machine:
- machine can only be in one state at a time
- transition can occur, where machine changes state in response to an event / condition
- FSM defined by a list of its states and the condition for each transition
finite state automaton
FSM with no output
FSM symbols and their meanings
- empty circle - state
- circle with arrow pointing to it - start state
- circle with inner circle - accept state
use of parameters in context of subroutines
specifies any values that must be passed to a subroutine when it is called