Integrated Development Environments and Debugging – Grade 13 A/L ICT Notes 9.6

© 2026 schoolict.net (Ruwan Mangala Suraweera)

9.6 Integrated Development Environments and Debuggingඒකාබද්ධ සංවර්ධන පරිසර (IDE) සහ Debug කිරීම

Grade 13 A/L ICT · Lesson 913 ශ්‍රේණිය A/L ICT · පාඩම 9

Prints all tabs in the language you are reading. Use “Save as PDF” in the print window to keep a copy.ඔබ කියවන භාෂාවෙන් සියලු tabs මුද්‍රණය වේ. පිටපතක් තියාගන්න print window එකේ “Save as PDF” තෝරන්න.
🎬Video coming soon in this language. Switch language to watch the other video.මේ භාෂාවෙන් වීඩියෝව ඉක්මනින් එනවා. අනෙක් වීඩියෝව බලන්න භාෂාව මාරු කරන්න.

In this videoමේ වීඩියෝවේ

  • An IDE combines editor, runner and debugger.IDE editor, ධාවකය, debugger එකතු කරයි.
  • Save Python files as .py.Python ගොනු .py ලෙස සුරකින්න.
  • Breakpoints pause execution.Breakpoints ධාවනය නවත්වයි.
  • Step and watch reveal logic errors.Step සහ watch තාර්කික දෝෂ හෙළි කරයි.
  • Logic errors need testing to be found.තාර්කික දෝෂ සොයා ගැනීමට පරීක්ෂාව අවශ්‍යයි.
IDECode editorSyntax highlightingAuto-completeConsoleDebuggerBreakpoint

Notesසටහන්

Syllabus 9.6. An IDE brings together an editor, translator, runner and debugger in one program (for example IDLE, Thonny or VS Code). You learn to open and save files, run programs and use debugging facilities such as breakpoints, stepping and watching variables.විෂය නිර්දේශය 9.6. IDE එකක් editor, පරිවර්තකය, ධාවකය සහ debugger එක් වැඩසටහනක එකතු කරයි (උදා: IDLE, Thonny, VS Code). ගොනු විවෘත කිරීම සහ සුරැකීම, වැඩසටහන් ධාවනය සහ breakpoints, stepping, variables watch වැනි debug පහසුකම් ඉගෙන ගනිමු.

1. Basic features of an IDE1. IDE හි මූලික ලක්ෂණ

Main parts of an IDEMenu: File (open, save) · Run · DebugProjectfilesCode editorsyntax colouringauto-completeline numbersDebuggerbreakpointsstepwatchConsole / output and error messages
Parts of an IDEIDE හි කොටස්
  • Editor with syntax colouring, auto-indent, auto-complete and line numbers.Editor: syntax වර්ණ, ස්වයං indent, auto-complete, පේළි අංක.
  • File menu: New, Open, Save, Save As (Python files end in .py).File මෙනුව: New, Open, Save, Save As (.py ගොනු).
  • Run: translate and execute (F5 in IDLE); output and errors appear in the console.Run: පරිවර්තනය සහ ධාවනය (IDLE හි F5); ප්‍රතිදානය console හි.
  • Debugger: breakpoints, step into/over, watch variables and the call stack.Debugger: breakpoints, step into/over, විචල්‍ය watch, call stack.

2. Debugging an off-by-one error2. off-by-one දෝෂයක් debug කිරීම

🐍 Debugging an off-by-one erroroff-by-one දෝෂයක් debug කිරීම

marks = [60, 70, 80]

def average_bug(m):
    total = 0
    for i in range(len(m) - 1):   # bug: skips the last item
        total += m[i]
    return total / len(m)

def average_fixed(m):
    total = 0
    for i in range(len(m)):
        total += m[i]
    return total / len(m)

print("Buggy:", average_bug(marks))
print("Fixed:", average_fixed(marks))

▶ Outputප්‍රතිදානය

Buggy: 43.333333333333336
Fixed: 70.0
🧮 Worked exampleවිසඳූ උදාහරණය The buggy average of 60, 70, 80 is wrong. How does a debugger find the cause?60, 70, 80 හි සාමාන්‍යය වැරදියි. debugger හේතුව සොයන්නේ කෙසේද?
Set a breakpoint inside the loop and watch i and total. i takes only 0 and 1, so total reaches 130 and 130 ÷ 3 = 43.33. The range should be range(len(m)); then total = 210 and the average is 70.0.loop තුළ breakpoint තබා i සහ total watch කරන්න. i 0 සහ 1 පමණි; total 130; 130 ÷ 3 = 43.33. range(len(m)) විය යුතුය; එවිට 70.0.
Error typeදෝෂ වර්ගයFound byසොයන්නේExampleඋදාහරණය
SyntaxSyntaxTranslator, before runningපරිවර්තකය, ධාවනයට පෙරmissing colon after ifif පසු : නැත
Runtimeධාවන කාලProgram crash while runningධාවනයේදී බිඳවැටීමdivision by zeroශුන්‍යයෙන් බෙදීම
Logicතාර්කිකWrong output; use the debuggerවැරදි ප්‍රතිදානය; debuggerrange(len(m) – 1)range(len(m) – 1)
💡 Logic errors give no error message – only testing with expected results reveals them.තාර්කික දෝෂ පණිවිඩයක් නොදේ – බලාපොරොත්තු ප්‍රතිඵල සමඟ පරීක්ෂාව පමණක් ඒවා හෙළි කරයි.
🚀 Beyond the syllabus (2026 update)🚀 විෂය නිර්දේශයෙන් ඔබ්බට (2026 යාවත්කාලීනය) Not required for the exam – read for interest.විභාගයට අවශ්‍ය නැත – දැනුම සඳහා කියවන්න. In 2026 IDEs include AI assistants that explain errors and suggest fixes; always test the suggestion before accepting it.2026 IDE වල දෝෂ පැහැදිලි කර විසඳුම් යෝජනා කරන AI ඇත; පිළිගැනීමට පෙර පරීක්ෂා කරන්න.

Key Wordsප්‍රධාන පද

IDEIDE
Software combining editor, translator, runner and debugger.editor, පරිවර්තකය, ධාවකය, debugger එකතු කළ මෘදුකාංගය.
Code editorකේත editor
Part of an IDE where source code is typed.මූලාශ්‍ර කේතය ටයිප් කරන IDE කොටස.
Syntax highlightingSyntax වර්ණ
Colouring keywords and strings to aid reading.කියවීමට පහසුවට keywords වර්ණ ගැන්වීම.
Auto-completeAuto-complete
Suggesting names while typing.ටයිප් කරන විට නම් යෝජනා කිරීම.
ConsoleConsole
Window showing program output and errors.ප්‍රතිදානය සහ දෝෂ පෙන්වන කවුළුව.
DebuggerDebugger
Tool for running a program step by step to find errors.දෝෂ සෙවීමට පියවරෙන් පියවර ධාවනය කරන මෙවලම.
BreakpointBreakpoint
Marked line where execution pauses.ධාවනය නවතින සලකුණු කළ පේළිය.
Step intoStep into
Run the next line, entering any function called.ඊළඟ පේළිය ධාවනය; ශ්‍රිතය ඇතුළට යාම.
WatchWatch
Showing the current value of chosen variables.තෝරාගත් විචල්‍යවල වත්මන් අගය පෙන්වීම.
Logic errorතාර්කික දෝෂය
Mistake that gives wrong results without crashing.බිඳ නොවැටී වැරදි ප්‍රතිඵල දෙන වරද.
Off-by-one errorOff-by-one දෝෂය
Loop that runs one time too many or too few.එක් වරක් වැඩි හෝ අඩු වන ලූපය.
Call stackCall stack
List of functions currently being executed.දැනට ධාවනය වන ශ්‍රිත ලැයිස්තුව.

Sample Q&Aආදර්ශ ප්‍රශ්න සහ පිළිතුරු

1Name four IDE features.IDE ලක්ෂණ හතරක්.

Answerපිළිතුර: Editor, file open/save, run, debugger.editor, ගොනු, run, debugger.

2What is a breakpoint?Breakpoint?

Answerපිළිතුර: A line where execution pauses so you can inspect variables.ධාවනය නවතින පේළිය.

3Buggy and fixed averages?සාමාන්‍ය දෙක?

Answerපිළිතුර: 43.33 and 70.0.43.33 සහ 70.0.

4What caused the bug?දෝෂයට හේතුව?

Answerපිළිතුර: range(len(m) – 1) skipped the last item.අවසන් අයිතමය මඟ හැරුණි.

5Which errors give no message?පණිවිඩයක් නොදෙන දෝෂ?

Answerපිළිතුර: Logic errors.තාර්කික දෝෂ.

6How do you save a Python file?Python ගොනුව සුරැකීම?

Answerපිළිතුර: File → Save / Save As with a .py name.File → Save, .py.

MCQබහුවරණ ප්‍රශ්න

Choose the correct answer for each question.සෑම ප්‍රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.

Scoreලකුණු: 0 / 20

1The IDE part that pauses at a marked line is aනවතින

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B

Breakpoint.Breakpoint.

2Showing a variable value during debugging isඅගය පෙන්වීම

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E

Watch.Watch.

3The buggy program prints averagebuggy

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D

130 ÷ 3.130 ÷ 3.

4The fixed program prints averagefixed

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C

210 ÷ 3.210 ÷ 3.

5range(len(m) – 1) instead of range(len(m)) is anrange

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A

Logic.තාර්කික.

6Output and error messages appear in theප්‍රතිදානය

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C

Console.Console.

7A missing colon after if is found: නැත

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A

Syntax.Syntax.

8Python source files are saved with the extensionextension

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E

.py..py.

9Which term means: “Software combining editor, translator, runner and debugger”?“editor, පරිවර්තකය, ධාවකය, debugger එකතු කළ මෘදුකාංගය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D

IDE – Software combining editor, translator, runner and debugger.IDE – editor, පරිවර්තකය, ධාවකය, debugger එකතු කළ මෘදුකාංගය.

10Which term means: “Part of an IDE where source code is typed”?“මූලාශ්‍ර කේතය ටයිප් කරන IDE කොටස” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E

Code editor – Part of an IDE where source code is typed.කේත editor – මූලාශ්‍ර කේතය ටයිප් කරන IDE කොටස.

11Which term means: “Colouring keywords and strings to aid reading”?“කියවීමට පහසුවට keywords වර්ණ ගැන්වීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B

Syntax highlighting – Colouring keywords and strings to aid reading.Syntax වර්ණ – කියවීමට පහසුවට keywords වර්ණ ගැන්වීම.

12Which term means: “Suggesting names while typing”?“ටයිප් කරන විට නම් යෝජනා කිරීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A

Auto-complete – Suggesting names while typing.Auto-complete – ටයිප් කරන විට නම් යෝජනා කිරීම.

13Which term means: “Window showing program output and errors”?“ප්‍රතිදානය සහ දෝෂ පෙන්වන කවුළුව” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B

Console – Window showing program output and errors.Console – ප්‍රතිදානය සහ දෝෂ පෙන්වන කවුළුව.

14Which term means: “Tool for running a program step by step to find errors”?“දෝෂ සෙවීමට පියවරෙන් පියවර ධාවනය කරන මෙවලම” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C

Debugger – Tool for running a program step by step to find errors.Debugger – දෝෂ සෙවීමට පියවරෙන් පියවර ධාවනය කරන මෙවලම.

15Which term means: “Marked line where execution pauses”?“ධාවනය නවතින සලකුණු කළ පේළිය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D

Breakpoint – Marked line where execution pauses.Breakpoint – ධාවනය නවතින සලකුණු කළ පේළිය.

16Which term means: “Run the next line, entering any function called”?“ඊළඟ පේළිය ධාවනය; ශ්‍රිතය ඇතුළට යාම” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A

Step into – Run the next line, entering any function called.Step into – ඊළඟ පේළිය ධාවනය; ශ්‍රිතය ඇතුළට යාම.

17Which term means: “Showing the current value of chosen variables”?“තෝරාගත් විචල්‍යවල වත්මන් අගය පෙන්වීම” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C

Watch – Showing the current value of chosen variables.Watch – තෝරාගත් විචල්‍යවල වත්මන් අගය පෙන්වීම.

18Which term means: “Mistake that gives wrong results without crashing”?“බිඳ නොවැටී වැරදි ප්‍රතිඵල දෙන වරද” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B

Logic error – Mistake that gives wrong results without crashing.තාර්කික දෝෂය – බිඳ නොවැටී වැරදි ප්‍රතිඵල දෙන වරද.

19Which term means: “Loop that runs one time too many or too few”?“එක් වරක් වැඩි හෝ අඩු වන ලූපය” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D

Off-by-one error – Loop that runs one time too many or too few.Off-by-one දෝෂය – එක් වරක් වැඩි හෝ අඩු වන ලූපය.

20Which term means: “List of functions currently being executed”?“දැනට ධාවනය වන ශ්‍රිත ලැයිස්තුව” යන්නෙන් අදහස් වන පදය කුමක්ද?

✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E

Call stack – List of functions currently being executed.Call stack – දැනට ධාවනය වන ශ්‍රිත ලැයිස්තුව.

MCQ answer keyMCQ පිළිතුරු

  1. B – Breakpoint.Breakpoint.
  2. E – Watch.Watch.
  3. D – 130 ÷ 3.130 ÷ 3.
  4. C – 210 ÷ 3.210 ÷ 3.
  5. A – Logic.තාර්කික.
  6. C – Console.Console.
  7. A – Syntax.Syntax.
  8. E – .py..py.
  9. D – IDE – Software combining editor, translator, runner and debugger.IDE – editor, පරිවර්තකය, ධාවකය, debugger එකතු කළ මෘදුකාංගය.
  10. E – Code editor – Part of an IDE where source code is typed.කේත editor – මූලාශ්‍ර කේතය ටයිප් කරන IDE කොටස.
  11. B – Syntax highlighting – Colouring keywords and strings to aid reading.Syntax වර්ණ – කියවීමට පහසුවට keywords වර්ණ ගැන්වීම.
  12. A – Auto-complete – Suggesting names while typing.Auto-complete – ටයිප් කරන විට නම් යෝජනා කිරීම.
  13. B – Console – Window showing program output and errors.Console – ප්‍රතිදානය සහ දෝෂ පෙන්වන කවුළුව.
  14. C – Debugger – Tool for running a program step by step to find errors.Debugger – දෝෂ සෙවීමට පියවරෙන් පියවර ධාවනය කරන මෙවලම.
  15. D – Breakpoint – Marked line where execution pauses.Breakpoint – ධාවනය නවතින සලකුණු කළ පේළිය.
  16. A – Step into – Run the next line, entering any function called.Step into – ඊළඟ පේළිය ධාවනය; ශ්‍රිතය ඇතුළට යාම.
  17. C – Watch – Showing the current value of chosen variables.Watch – තෝරාගත් විචල්‍යවල වත්මන් අගය පෙන්වීම.
  18. B – Logic error – Mistake that gives wrong results without crashing.තාර්කික දෝෂය – බිඳ නොවැටී වැරදි ප්‍රතිඵල දෙන වරද.
  19. D – Off-by-one error – Loop that runs one time too many or too few.Off-by-one දෝෂය – එක් වරක් වැඩි හෝ අඩු වන ලූපය.
  20. E – Call stack – List of functions currently being executed.Call stack – දැනට ධාවනය වන ශ්‍රිත ලැයිස්තුව.

Structured Questionsව්‍යුහගත ප්‍රශ්න

1Describe four basic features of an IDE.IDE ලක්ෂණ හතර. (4 marksලකුණු 4)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Editor; file management; run/console; debugger.editor; ගොනු; run; debugger.

2List the steps to open, edit, save and run a Python file in an IDE.පියවර. (5 marksලකුණු 5)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
File Open; edit; File Save as .py; Run (F5); read console.Open; edit; Save; Run.

3Explain breakpoint, step and watch.breakpoint, step, watch. (3 marksලකුණු 3)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Pause at line; run one line; show variable values.නැවතීම; එක් පේළිය; අගය.

4Find and fix the bug in average_bug().දෝෂය සොයා නිවැරදි කිරීම. (3 marksලකුණු 3)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
range(len(m) – 1) skips last; use range(len(m)); 70.0.range; 70.0.

5Distinguish syntax, runtime and logic errors.දෝෂ වර්ග තුන. (3 marksලකුණු 3)

Show model answerආදර්ශ පිළිතුර පෙන්වන්න
Syntax grammar; runtime crash; logic wrong output.ව්‍යාකරණ; බිඳවැටීම; වැරදි ප්‍රතිදානය.

🎮 Game🎮 ක්‍රීඩා

Pick a game. Each one uses words from this lesson.ක්‍රීඩාවක් තෝරන්න. හැම එකක්ම මේ පාඩමේ වචන පාවිච්චි කරනවා.

Summary & Downloadsසාරාංශය සහ බාගත කිරීම්

Key pointsප්‍රධාන කරුණු

  • An IDE combines editor, runner and debugger.IDE editor, ධාවකය, debugger එකතු කරයි.
  • Save Python files as .py.Python ගොනු .py ලෙස සුරකින්න.
  • Breakpoints pause execution.Breakpoints ධාවනය නවත්වයි.
  • Step and watch reveal logic errors.Step සහ watch තාර්කික දෝෂ හෙළි කරයි.
  • Logic errors need testing to be found.තාර්කික දෝෂ සොයා ගැනීමට පරීක්ෂාව අවශ්‍යයි.

Downloadsබාගත කිරීම්

Full Lesson 9 PDFසම්පූර්ණ පාඩම 9 PDF: English · සිංහල

Next noteඊළඟ සටහන 9.7 →

© 2026 schoolict.net (Ruwan Mangala Suraweera). All rights reserved.සියලු හිමිකම් ඇවිරිණි.

Resource Book Lesson Note Download Questions Syllabus Sinhala LMS Simulator Tool