0.9 and 1.0
- Created by: Schofe98
- Created on: 03-06-17 17:13
Logical Operators
Exact definition of logic is a use of operators the outcome of a given argument
- Applying these consistently to all the data you are given
- Two outputs:True (1) or False (0)
Implementinglogicaldecisions – makingdecisionsin programs happens during selections
- The computer must choose one of a number of statements to execute based on the result
- Decide whether or not to repeat a set of instructions
Standard and Custom Functions
When programming a solution it is common to require code written by someone else
- Tend to come in the form of a library
Librarysoftwareisacollectionofclassesorfunctionsthatprovidecommonservices for programmers.
- Searchingandsorting are classic examples
- Normally carefully tested and work as efficiently as possible
Data Compression
Reducing the amount of file space (bytes) that a given file takes up.
1.Lossy: means that the file is compressed to a smaller size but some information is lost in the process
- Run lengthencodingreplacesasequenceofrepeatedcharacters with a flag character, followed by a character itself and the number of times its repeated.
- Dictionaryencoding have sequences replaced by pointers to relevant places in the dictionary
2.Lossless: reduce file size without any loss of information
Comparing:
- Compression ratio – a ratio between the original file and the new compressed file
- Compression/decompression time – the amount of time it takes to compress or decompress a file (sometimes size saving maybe scraficied to speed)
- Savingpercentage– apercentagemeasureofhowmuchsmallerthecompressed fileis.
Testing
Without testing there is a chance that the code, under certain circumstances, it may not work.
- Logic errors (where the code produces the wrong result) are difficult to spot when coding and can be even harder to solve
The moretesting, the most robustthefinalsolutionwillbe
- End users do not like software which crashes often or produces unexpected results.
Tests must be repeatable
- So that if it fails, the coder can put the same data in to diagnose the issue.
•Normal: values which would occur under normal running conditions •Invalid:Valueswhich shouldnotbeacceptedandmustnot crash the algorithm •Borderline: values which are at the edge of acceptable range
Programming Paradigms
The fundamental structure and approach of a programming language.
- Programswritten in a procedural language will run from the start to end sequentially intol a control statement is encountered.
Procedural: worksequentially andaremadeof a series of commands intended to run one after another.
- Madeupofstatements
- Use statements to change the state of the program
- Simplest form of programming paradigm and normally learnt first
Visual: use of intuitive user interfaces to help build programs rather than relying on text
- Scratch – made upofaseriesofcharactersthatcanhaveactions applied to them by dragging and dropping code blocks.
- Not idealforlarge or more advanced problems
Event driven: programs that rely heavily on user interaction.
- Programs will sit in a loop waiting from the user to perform an action.
- Will be a nested loop structure to direct the event to the correct listener.
Object Oriented programming: allows programs to be well structured and offer the potential forreusable code.
- Encapsulation: the hiding of the implementation of a class and controlling access to its methods and attributes
- Inheritance: passing attributes down like with parental genes
- Objects:combinationofdataandactionsthat can operate on that data
- Classes:definitionofanobjectwhichembodies all the information needed to create and manipulate objects of a particular type.
Standardisation
Standards are set up and developed for companies to use to ensure that their products willintegrate withoneanother.
- Importance relates to interoperability of software and hardware.
- By implementing a standard you can have the confident that your product will work as part of a larger system
- Issues due to the inherent complexities of software.
- Challenging to tie down a single set of standards.
Backus Naur Form
A way of writing down the grammar of a programming language
- It definesrules that must be followed in order for the source code to be syntactically correct
- Any tilesforaprogramminglanguage mustnot be ambiguous.
Keyelements:
- The ruleiswrittenas<rulename> ::-
- Concatenation: elements of the BNF are written next to each others
- Disjunction: elements are separated by the | symbol and effectively offer a choice of options
- <digit> ::- 0|1|2|3|4|5|6|7|8|9
- Recursion: allows rules to be iterative
- <digits?::-<digit>|<digit><digits>
Systems Analysis
A stakeholder is anyone who has a vested interest in the development of a system. Include:
- User
- Programmer
- Project manager
- System analyst
Analyst of the computing system will include:
- Problem definition: the current problem with the system will be investigated and initially agreed upon.
- Feasibility: an investigation to ensure that the project is feasible by checking the following factors:
- Economic
- Time
- Technical
- Legal
- Fact finding: gather information needed to accuracy define the new system to be built, using the following methods:
- Observation
- Questionnaire
- Interview
- Collecting documentation
Design
Based on the requirements specification and is broken down into output, input, processing and storage design.
Input: interface design shows how information will be input into the new system and also how it will be displayed after processing.
Output: be carried out in a similar way to input design. Triggers are used when a new order is sent into the system; if the trigger can not be identified then output will never be seen.
Data structure: fundamental to how a system will. It dictates what data needs to be stored and how that data will be organised.
Abstraction
Abstraction – the process of separating concrete instances of a solution from the ideas that were used to solve them.
- Control abstraction: hides actions and programming control, such as if statements.
- Data abstraction: hides how bits are organised for primitive data types such as floating point or dates.
Maintenance
Adaptive – the developers fixes bugs and adds extra functionality to the system.
- New features tend to be added based on external needs.
Corrective – simply fixes problems as they arise to ensure that the system closely matches the original specification
- Fix problems without breaking the system or adding functionality
Perfective – completely matches the original specification with no problems at all.
- Direct mapping from requirements to implementation.
- Requires performance is impossible when possible
Development
Incremental – the entire system is designed before being divided into separate modules or subsystems
- Software is generated quickly so users get a chance to give feedback
- New functionality can easily be added to the existing product
- Encourages very thorough testing, as each individual module is tested before released
Iterative – deliver a filly working system up front but then build on this functionality with every additional release.
- Enable customers to experience the system from an early stage in development and to provide feedback on changes they would like to be made.
- Easy to spot problems early on
Prototyping – seeks to combine the iterative and incremental developments by providing a cut down version of the final product
- allows a system to be quickly built in order to demonstrate ideas and concepts to the customer.
Compilers and Interpreters
Compiler converts source code written in a high level language into machine code
- Produces a standalone executable file which can be released to others without need for further compilation
- if software is to be ported to other systems and operating systems, it need not only to be recompiled, but also coded differently
Interpreters handles the job of translating code differently
- it translates each code into machine code line by line
- can be run on any system as long as an interpreter is installed
AD:
- Source code has to be written only once and can run on any computer
- easily inspect the contents of variables
- test code more efficiently
DIS
- Must have an interpreter on the computer
- Runs slowly
- Developers can view the source code
Intermediate Code, Assemblers and Opcode
Virtual machines represent a generic computer residing within the computer that running it.
- Process virtual machines act as interpreters for generic machine code instrcutions known as intermediate code.
Assemblers allows the coder to write using mnemonics that represent machine code instructions.
- Binary representation of an instruction that can be on CPU architecture
- A form of translator
Opcodes are part of machine code instructions
- A specific binary value that represents a single instruction
- Sometimes data is split overmultiplebytes meaning the next set of bytes fetched will actually be the data from the last instruction
Compilation
Lexical Analysis: parses source code and decides whether each line contains keywords, variables, constants,etc accepted by the language
- A token is a numeric representation of a keyword or identifier
- Does notchecksyntax or the order of keywords and operators; simply prepares the code for syntax analysis.
SyntaxorSemantic Analysis: once tokens are generated, checks the order of expressions using the token stream
- Abstract syntax trees (is passed on to the next phase of compilation which can guarantee correct syntax)
Machine Code Generation: matches parts of syntax to machine code to optimise the generated machine code
- Converts elements of the abstract tree into machine code
- Allocate registers to minimise memory access
- Optimise themachinecodetoimproveefficiency
Linking: links the generated machine code to library software; it will add loaders to the code to enable dynamic library linking.
Comments
No comments have yet been made