2.5.2 The Integrated Development Environment (IDE) · Paper 2
The IDE: tools for writing code
Each section has pictures and things to try, then its key points and key words. Exam practice is at the end of the page.
You need to know
- The tools an IDE provides: editors, error diagnostics, run-time environment and translators
- How each helps a programmer
- Using at least one IDE in practice
You don't need to know
- OCR doesn't rule anything out here.
IDE tools
An IDE (integrated development environment) is a program for writing code, e.g. IDLE, Thonny, Visual Studio Code.
Try it
Explore an IDE. Tap each part to find out what it does.
Tap each part of the IDE
There are 8 parts to find. Each one helps you write, test or fix code.
Run button
Runs the program inside the IDE, in its run-time environment. You can test it and see the output straight away, without a separate program.
Line numbers
Part of the editor. Error messages give a line number, so you can find the problem quickly.
Editor
Where you write code. Syntax highlighting colours keywords like for and in, and auto-indent lines code up inside loops and ifs.
Auto-complete
Part of the editor. It suggests names as you type, so you type less and make fewer spelling mistakes.
Error diagnostics
Spots errors, like the misspelt pritn, and highlights the line. Often it does this before you even run the code.
Breakpoint and variables
More error diagnostics. The red dot is a breakpoint: the program pauses on line 3. Here it is the second time round the loop, so score is 10 and i is 1. You can watch each variable's value, then step through one line at a time to find logic errors.
Output window
Part of the run-time environment. It shows what the program prints, and any error messages while it runs.
Translator
The IDE has a built-in interpreter (here, for Python) or compiler that turns your code into machine code so it can run.
Try it
Which IDE tool helps?
- Colours keywords so they are easy to spot
- Highlights the line with a missing bracket
- Shows the program's output without leaving the IDE
- Turns your code into machine code
- Pauses the program at a breakpoint so you can check the variables
- Fills in the rest of a variable name as you type
Key points
IDE tools
Before this: 2.3.2Syntax and logic errors
- An IDE (integrated development environment) is a program for writing code, e.g. IDLE, Thonny or Visual Studio Code.
- Editor: where you write code, with line numbers, colours for keywords, auto-indent and auto-complete.
- Error diagnostics: shows where errors are, and has debugging tools like breakpoints and stepping through code.
- Run-time environment: runs the program inside the IDE so you can see the output.
- Translator: a built-in compiler or interpreter.
Key words
Say what each one means, then tap to check.
Exam practice
5 questions in the style of the OCR exam, 13 marks in total. Try each one, then check the mark scheme.
IDE tools
Hint
Think about tools that show you where an error is, and tools that let you pause the program and look inside it.
Describe means say what it is like or what happens. Make each point a separate fact.
4 marks: make 4 separate points.
Show mark scheme
- Error diagnostics: highlight / show the line of an error and explain it.
- Breakpoints: pause the program to check variable values.
- Stepping: run one line at a time.
- Variable watch: shows values of variables as the program runs.
- Syntax highlighting: colours make mistakes easier to spot.
Also accept: Translator error messages, e.g. the compiler shows which line an error is on.
Don't accept: "Debugger" with no description of what it does.
Example answer
Breakpoints let the programmer pause the program at a chosen line, so they can check the values of the variables at that point. Error diagnostics highlight the line where an error is and explain what is wrong, so the programmer knows where to look.
For each tool: 1 mark for naming it, 1 mark for describing it.
Hint
What does a programmer want to do straight after writing some code?
Describe means say what it is like or what happens. Make each point a separate fact.
2 marks: make 2 separate points.
Show mark scheme
- Run the program inside the IDE…
- …and see the output / test it without a separate program.
1 mark for each point.
Mixed questions on the whole page
Hint
This is a logic error, so the program still runs. Which IDE tools let you pause and look at the variables?
Describe means say what it is like or what happens. Make each point a separate fact.
3 marks: make 3 separate points.
Show mark scheme
- Set a breakpoint where the total is worked out, so the program pauses there…
- …step through the code one line at a time…
- …and watch the value of total to see where it goes wrong.
Also accept: Watch window / variable watch to see the value of total.
Don't accept: Error messages on their own. The program runs, so there is no syntax error to show.
1 mark for each point.
Hint
Think about what you see while you type: numbers down the side, colours, and code it fills in for you.
Describe means say what it is like or what happens. Make each point a separate fact.
2 marks: make 2 separate points.
Show mark scheme
- Syntax highlighting: keywords are coloured, so typing mistakes stand out.
- Auto-indent: code inside loops and ifs is lined up, so the structure is easy to see.
- Auto-complete: suggests the rest of a command or variable name, so there are fewer typing mistakes.
- Line numbers: help the programmer find the line that an error message points to.
- Bracket matching: shows which brackets pair up, so missing ones are spotted.
Don't accept: Naming a feature with no description, e.g. just "auto-complete".
Don't accept: The debugger or translator. These are IDE tools, but not part of the editor.
Any two. 1 mark for each feature described with how it helps.
Hint
What must happen to code before the CPU can run it? Where does that happen if you never leave the IDE?
Explain means say what happens and why. Words like “because” and “so” help.
2 marks: aim for 2 things said, such as a point and then the reason for it.
Show mark scheme
- To turn the code into machine code…
- …so it can be run and tested without leaving the IDE / needing a separate program.
1 mark for each point.