Paper 2 - section 6 - design, testing and IDEs Flashcards
what are the differences between high-level languages and low-level languages?
- one instruction of high-level code represents many instructions of machine code, whereas one instruction of assembly code usually only represents one instruction of machine code
- high-level code will work for many different machines and processors, whereas low-level code is usually written for one type of machine or processor and won’t work on any others
- in a low-level language the programmer needs to know about the internal structure of the CPU and how it manages the memory, whereas in a high-level language you can easily store data in many different structures without fully understanding them
- high level code is easy to read, understand and modify, whereas low-level code is very difficult to read, understand and modify
- high-level code must be translated into machine code before a computer is able to understand it, whereas commands in machine code can be executed directly without the need for a translator
- in high level languages you don’t have much control over what the CPU actually does so programs will be less memory efficient and slower, whereas in low-level languages you control exactly what the CPU does and how it uses memory so programs will be more memory-efficient and faster
are high or low level languages easier for the computer to run?
low-level languages
are high or low level languages easier for humans to write?
high-level languages
give two examples of low-level languages
machine code and assembly languages
give three examples of high-level languages
python, C++ and Java
why are translators needed?
computers only understand instructions given to them as machine code, so high level languages and assembly languages need to be translated before a computer is able to execute the instructions
what are the three types of translator?
assemblers, compilers and interpreters
what are assemblers used for?
assemblers are used to turn assembly language into machine code. There are many different assembly languages (to support different CPU types) and each one needs its own unique assembler
what are compilers and interpreters used for?
to turn high-level code into machine code
what are the key features of compilers?
- translates all of the source code at the same time and creates one executable file
- only needed once to create the executable file
- returns a list of errors for the entire program once compiling is complete
- once compiled the program runs quickly, but compiling can take a long time
what are the key features of interpreters?
- translate and run the source code one instruction at a time, but doesn’t create an executable file
- needed every time you want to run the program
- the interpreter will return the first error it finds and then stop - this is useful for debugging
- programs will run more slowly because the code is being translated as the program is running
which type of translator produces one executable file?
compiler
what does the type of translator used depend on?
which programming language and IDE you’re using
what happens if a program is stored over multiple source code files?
a linker is used to join all of the separate compiled codes into one executable program
what is an integrated development environment?
a piece of software that provides features to help a programmer develop their program
what is the code editor?
the main part of an IDE, it’s where the code is written.
what are some common features of a code editor?
Most code editors will have line numbering and auto-colour coding for things like strings, functions, variables and comments. Good code editors will also have other automatic features like auto-correct, auto-indentation and auto-complete
what are 10 common features of an IDE?
- the code editor
- a run-time environment
- an explorer window
- an output window
- features to keep track of the line number and character number that you’re working on
- error diagnostics and debugging tools
- breakpoints
- a translator
- auto-documentation
- a graphical user interface (GUI) builder
what does a run-time environment do?
it allows the code to be run quickly within the IDE - this is done using a start or run button. The run-time environment can also help to identify logic errors in the program as the programmer can see which part of the code is running when errors occur
what is the point of an explorer window?
it helps you navigate through programs
what is the output window for?
it’s to show the output from a program when it is run
what do error diagnostic and debugging tools do?
they help to find and fix errors in a program - they’ll tell you the location of the error and often suggest ways to fix it
what are breakpoints?
a common debugging tool: they stop the program on certain lines so you can gather information like the value of variables as the program is running
what does auto-documentation help with?
the maintenance of programs. It can extract certain features of a program, like the names of variables, names of sub-programs and comments. This information is stored in a separate document to give a summary of what the code does
what does a GUI builder help the programmer to do?
design a user interface by building it up graphically rather than having to design it using source code. It allows you to drag and drop different objects and customise them, so you can make the interface look exactly how you want it to
what are 2 types of errors?
syntax errors and logic errors
what are syntax errors?
when the compiler or interpreter doesn’t understand something you’ve typed because it doesn’t follow the rules of the programming language - an error that prevents the program from running
what are logic errors?
when the compiler or interpreter is able to run the program, but the program does something unexpected
which type of error is hardest to identify and fix, and why?
logic errors are more difficult to identify, as compilers and interpreters won’t pick them up
how are syntax errors often found?
compilers and interpreters are unable to turn the source code into machine code, and so a syntax error (with its location) will be returned
how are logic errors usually found?
through general use of the program and by systematically testing it using a test plan
what is functionality testing useful for - what is its main aim?
functionality testing is an essential part of the development process and a good way to spot logic errors. The main aim of this testing is to see if the program actually meets your initial requirements
should functionality testing be left to the end of the program? why?
functionality testing shouldn’t be left until the end of the process - it’s so much better to spot errors and fix them as early as possible during development of the program
what do performance tests do?
test how quickly certain features run and their impact on computer resources
what do usability tests do?
test how user-friendly the interface and features are
what do security tests do?
test vulnerability to attacks and how securely data is stored