What an IDE provides
An Integrated Development Environment is a single piece of software that brings together everything needed to write, translate, run and debug a program. Without one, a programmer would use a separate text editor, a separate translator and a separate debugger, moving between them by hand.
The specification names four facilities, and asks how each can be used to help a programmer develop a program — so knowing what each one is called is only half the answer.
Two of the debugging tools are worth knowing by name, because they are what makes error diagnostics more than an error message.
A breakpoint marks a line at which execution pauses, so the programmer can inspect the values held in variables at that exact point. Stepping through executes one line at a time under the programmer's control, so the flow can be followed and the moment a value goes wrong can be seen directly. Between them, they are the practical version of the trace table from 2.1.2 — the same technique, carried out by the machine.
The specification also expects practical experience of using a range of these tools within at least one IDE, so this is a sub-topic where time actually spent in an IDE is what makes the answers concrete.
Worked example
A student's program runs without crashing but prints the wrong total. Explain how two facilities of an IDE could help find the fault.
- Identify the type of error: it runs, so this is a logic error, not a syntax error.
- That rules out the editor's syntax highlighting, which only shows breaches of the language's rules.
- Error diagnostics offer breakpoints, so execution can be paused just before the total is printed.
- Stepping through then executes one line at a time so the running total can be watched change.
- The run-time environment allows the corrected program to be re-run immediately to confirm the fix.
Answer: The error diagnostics would help most: a breakpoint set just before the total is printed pauses the program so the variables can be inspected, and stepping through line by line shows the running total after each addition, revealing the point at which it becomes wrong. The run-time environment then allows the program to be re-run inside the IDE straight after the correction to confirm the total is now right.
Common mistake
An IDE cannot find logic errors on its own. It reports syntax errors automatically, but a program producing the wrong answer runs perfectly as far as the IDE is concerned — the breakpoints and stepping tools help the programmer find the fault, they do not identify it.
- Integrated Development Environment
- an IDE: a single piece of software bringing together everything needed to write, translate, run and debug a program
Before you practise
- An IDE combines the tools for writing, translating, running and debugging a program in one place.
- The four facilities: editors, error diagnostics, run-time environment, translators.
- Editors offer line numbers, indentation, syntax highlighting and auto-completion.
- Error diagnostics report the line and description of an error and provide breakpoints and stepping.
- A breakpoint pauses execution so variable values can be inspected.
- Stepping runs one line at a time so the flow can be followed.
- The run-time environment runs the program inside the IDE so changes can be tested immediately.
- A built-in translator means no separate compiler or interpreter is needed.
- Say how each facility helps, not just what it is.