SlideShare a Scribd company logo
1 of 23
Testing and Debugging
‘Good’ software is…
Robust
Portable
• Produces the correct output
• from the correct input
• Copes with invalid input data
• Deals with unexpected conditions
• Runs on different platforms such as
OSX/Windows/Linux
Reliable
Testing
Lesson Aims
By the end of this lesson all pupils will be able to:
❏ Describe the types of errors that may be discovered
❏ Explain what is meant by systematic testing
❏ Explain what is meant by comprehensive testing
❏ Explain the importance for documentation at every stage of the project
A philosophical view…
“Program testing can be a very
effective way to show the
presence of bugs, but it is
hopelessly inadequate for
showing their absence.”
Edsger W. Dijkstra 1972
The Humble
Programmer (1972)
Hamilton Richards
Testing
What is the purpose of testing any product?
❏ Is it Fit for purpose - does it meet the specification
❏ Is it robust
❏ Is it reliable
MURPHY’s LAW 1
The quicker program coding is
started the longer the project will
take
MURPHY’s LAW 2
Murphy’s Law 1 is correct!
Aspects of Testing
Testing has to follow a plan.
It has to be systematic
it has to be comprehensive
What are we testing?
What is the function we want to test
What data/actions do we need to perform to test this?
What is the expected (correct) output?
Aspects of Testing (cont.)
In an ideal world testing would be exhaustive – meaning that every single possible
condition would be tested
This is unfortunately not the case.
However your testing can be comprehensive
One way is to ensure that you use a wide range of test data
Modules can be tested individually
Modules can also be tested to ensure that they integrate well
Test Data
Type Description Accepted
Normal This is data that the program should be
expected to use in normal operation YES
Extreme This is data at the edge of what is
acceptable, such as high and low limits
or boundaries
YES
Exceptional This is invalid data. Robust programs
should reject this NO
A Testing table
Imagine a program that accepted and graded pass marks between 0 and 20, a pass is 12
or more.
You should show for each input what the expected output is and the actual output and
make a comment.
This may be as simple as ‘As Expected’
Testing Table
Type Input Expected
Output
Actual
Output
Comment
NORMAL 2 FAIL FAIL As Expected
7 FAIL FAIL As Expected
12 PASS PASS As Expected
EXTREME 0 FAIL FAIL As Expected
20 PASS PASS As Expected
EXCEPTIONAL -1 Error Error Program Crashes
21 Error Error Program Crashes
Phases of Testing
Alpha Testing
Internal testing
Pre-Release
Done by Development Team
Beta Testing
Testing a program in working conditions
Members of public or independent test group
Feedback provided to the development team
Types of Errors (recap)
When testing programs there will be errors (bugs) there are different types…
1. Syntax
These are mistakes in the programming ‘grammar’
e.g. Forgetting to put a semi colon or close a bracket
1. Execution
These are errors detected during run-time. Divide by zero etc.
1. Logic
These are errors in the design of the program
Passing the wrong data into a function
Programs will fail
translation so won't run
Programs will run but give
some unintended output
Programs will usually
fail during runtime
Constructing a test plan
The purpose of a test plan is to ensure that you are systematically and
comprehensively testing your system
The test plan must test the functionality of the software
❏ A successful test is one that finds errors!
❏ Try to find the errors!
Test cases and Data
What are your test cases?
This can be thought of as the ‘user’ interaction with your system
What test data will you use - your system may not be populated
What data will you use in your system to ensure that your tests are valid?
Debugging Techniques
Debugging tools
What if it finds an error?
There are various debugging techniques/tools
❏ Dry Runs
❏ Trace Tables/Tools
❏ Breakpoints
❏ Watchpoints
Dry Runs
A dry run is when you manually stepping through the lines of code without the need
for executing the program. Can be useful for logic errors.
Trace table
When you use a trace table you step through the code recording changes to variables.
The changes can then be used to track when and what it is being changed to.
Breakpoints
You set breakpoints to stop execution of the code at specified lines of code.
At this point the contents of variables can be examined
This can be a method to ascertain if a piece of code is actually being executed,
obviously useful for debugging conditional statements.
As you can check if the variables match the conditions you think they do
Allows execution to be halted and the contents of variables inspected
Breakpoints in Python (Pycharm)
Watchpoints
Watchpoints are similar to breakpoints but they are assigned to variables
They then stop the execution of the program only when the contents of a specific
variable(s) meet a particular condition.
This can be at any point in the execution of the code
Watchpoint set for when counter == 1
Will halt the execution of the program when the variable counter changes to 1

More Related Content

What's hot

Software Testing Fundamentals | Basics Of Software Testing
Software Testing Fundamentals | Basics Of Software TestingSoftware Testing Fundamentals | Basics Of Software Testing
Software Testing Fundamentals | Basics Of Software TestingKostCare
 
Research issues in object oriented software testing
Research issues in object oriented software testingResearch issues in object oriented software testing
Research issues in object oriented software testingAnshul Vinayak
 
Software Testing
Software TestingSoftware Testing
Software TestingKiran Kumar
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.pptKomal Garg
 
Testing in multiplatform environment
Testing in multiplatform environmentTesting in multiplatform environment
Testing in multiplatform environmentshivanichauhan1953
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Ankit Prajapati
 
Software Testing Technique in Software Engineering
Software Testing Technique in Software EngineeringSoftware Testing Technique in Software Engineering
Software Testing Technique in Software EngineeringIsmail Hussain
 
SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4  SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4 Mohammad Faizan
 
Object Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesObject Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesPunjab University
 
Testing (System Analysis and Design)
Testing (System Analysis and Design)Testing (System Analysis and Design)
Testing (System Analysis and Design)Areeb Khan
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testingHaris Jamil
 
Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing StrategiesAlpana Bhaskar
 
Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing StrategiesAdeel Rasheed
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testingHimanshu
 

What's hot (19)

Software Testing Fundamentals | Basics Of Software Testing
Software Testing Fundamentals | Basics Of Software TestingSoftware Testing Fundamentals | Basics Of Software Testing
Software Testing Fundamentals | Basics Of Software Testing
 
Software testing
Software testingSoftware testing
Software testing
 
Research issues in object oriented software testing
Research issues in object oriented software testingResearch issues in object oriented software testing
Research issues in object oriented software testing
 
unit testing and debugging
unit testing and debuggingunit testing and debugging
unit testing and debugging
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
 
Testing in multiplatform environment
Testing in multiplatform environmentTesting in multiplatform environment
Testing in multiplatform environment
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
 
Software Testing Technique in Software Engineering
Software Testing Technique in Software EngineeringSoftware Testing Technique in Software Engineering
Software Testing Technique in Software Engineering
 
SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4  SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4
 
Software Testing (Contd..) SDLC Model
Software Testing (Contd..) SDLC ModelSoftware Testing (Contd..) SDLC Model
Software Testing (Contd..) SDLC Model
 
Object Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesObject Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slides
 
Testing (System Analysis and Design)
Testing (System Analysis and Design)Testing (System Analysis and Design)
Testing (System Analysis and Design)
 
Software testing methods
Software testing methodsSoftware testing methods
Software testing methods
 
Software testing
Software testingSoftware testing
Software testing
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testing
 
Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing Strategies
 
Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing Strategies
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testing
 

Similar to H testing and debugging

SE - Lecture 8 - Software Testing State Diagram.pptx
SE - Lecture 8 - Software Testing  State Diagram.pptxSE - Lecture 8 - Software Testing  State Diagram.pptx
SE - Lecture 8 - Software Testing State Diagram.pptxTangZhiSiang
 
Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Thapar Institute
 
National 5 Computing Science - Testing
National 5 Computing Science - TestingNational 5 Computing Science - Testing
National 5 Computing Science - TestingForrester High School
 
Software testing and software development process
Software testing and software development processSoftware testing and software development process
Software testing and software development processGen Aloys Ochola Badde
 
Sdd Testing & Evaluating
Sdd Testing & EvaluatingSdd Testing & Evaluating
Sdd Testing & Evaluatingmary_ramsay
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts pptRathna Priya
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts pptRathna Priya
 
Chapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docxChapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docxketurahhazelhurst
 
SOFTWARE TESTING.pptx
SOFTWARE TESTING.pptxSOFTWARE TESTING.pptx
SOFTWARE TESTING.pptxssrpr
 
1779905011SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
1779905011SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.pptx1779905011SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
1779905011SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.pptxabhivastrad007
 
Aim (A).pptx
Aim (A).pptxAim (A).pptx
Aim (A).pptx14941
 

Similar to H testing and debugging (20)

SE - Lecture 8 - Software Testing State Diagram.pptx
SE - Lecture 8 - Software Testing  State Diagram.pptxSE - Lecture 8 - Software Testing  State Diagram.pptx
SE - Lecture 8 - Software Testing State Diagram.pptx
 
Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)
 
National 5 Computing Science - Testing
National 5 Computing Science - TestingNational 5 Computing Science - Testing
National 5 Computing Science - Testing
 
L software testing
L   software testingL   software testing
L software testing
 
Software testing and software development process
Software testing and software development processSoftware testing and software development process
Software testing and software development process
 
testing
testingtesting
testing
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Sdd Testing & Evaluating
Sdd Testing & EvaluatingSdd Testing & Evaluating
Sdd Testing & Evaluating
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
SD & D Testing
SD & D TestingSD & D Testing
SD & D Testing
 
Debbuging
DebbugingDebbuging
Debbuging
 
Testing
TestingTesting
Testing
 
Chapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docxChapter 10 Testing and Quality Assurance1Unders.docx
Chapter 10 Testing and Quality Assurance1Unders.docx
 
SOFTWARE TESTING.pptx
SOFTWARE TESTING.pptxSOFTWARE TESTING.pptx
SOFTWARE TESTING.pptx
 
1779905011SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
1779905011SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.pptx1779905011SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
1779905011SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.pptx
 
Aim (A).pptx
Aim (A).pptxAim (A).pptx
Aim (A).pptx
 

More from missstevenson01

Lesson 3 - Coding with Minecraft - Variables.pptx
Lesson 3 -  Coding with Minecraft -  Variables.pptxLesson 3 -  Coding with Minecraft -  Variables.pptx
Lesson 3 - Coding with Minecraft - Variables.pptxmissstevenson01
 
Lesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptxLesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptxmissstevenson01
 
Lesson 1 - Coding with Minecraft -Introduction.pptx
Lesson 1 - Coding with Minecraft -Introduction.pptxLesson 1 - Coding with Minecraft -Introduction.pptx
Lesson 1 - Coding with Minecraft -Introduction.pptxmissstevenson01
 
Lesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptxLesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptxmissstevenson01
 
Ethical hacking trojans, worms and spyware
Ethical hacking    trojans, worms and spywareEthical hacking    trojans, worms and spyware
Ethical hacking trojans, worms and spywaremissstevenson01
 
Ethical hacking anti virus
Ethical hacking   anti virusEthical hacking   anti virus
Ethical hacking anti virusmissstevenson01
 
Ethical hacking introduction to ethical hacking
Ethical hacking   introduction to ethical hackingEthical hacking   introduction to ethical hacking
Ethical hacking introduction to ethical hackingmissstevenson01
 
S1 internet safety-chattingonline
S1 internet safety-chattingonlineS1 internet safety-chattingonline
S1 internet safety-chattingonlinemissstevenson01
 
Video Games and Copyright laws
Video Games and Copyright lawsVideo Games and Copyright laws
Video Games and Copyright lawsmissstevenson01
 

More from missstevenson01 (20)

S3 environment
S3 environmentS3 environment
S3 environment
 
The Processor.pptx
The Processor.pptxThe Processor.pptx
The Processor.pptx
 
How Computers Work
How Computers WorkHow Computers Work
How Computers Work
 
Lesson 3 - Coding with Minecraft - Variables.pptx
Lesson 3 -  Coding with Minecraft -  Variables.pptxLesson 3 -  Coding with Minecraft -  Variables.pptx
Lesson 3 - Coding with Minecraft - Variables.pptx
 
Lesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptxLesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptx
 
Lesson 1 - Coding with Minecraft -Introduction.pptx
Lesson 1 - Coding with Minecraft -Introduction.pptxLesson 1 - Coding with Minecraft -Introduction.pptx
Lesson 1 - Coding with Minecraft -Introduction.pptx
 
Lesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptxLesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptx
 
Ethical hacking trojans, worms and spyware
Ethical hacking    trojans, worms and spywareEthical hacking    trojans, worms and spyware
Ethical hacking trojans, worms and spyware
 
Ethical hacking anti virus
Ethical hacking   anti virusEthical hacking   anti virus
Ethical hacking anti virus
 
Ethical hacking introduction to ethical hacking
Ethical hacking   introduction to ethical hackingEthical hacking   introduction to ethical hacking
Ethical hacking introduction to ethical hacking
 
S1 internet safety-chattingonline
S1 internet safety-chattingonlineS1 internet safety-chattingonline
S1 internet safety-chattingonline
 
S3 wireframe diagrams
S3 wireframe diagramsS3 wireframe diagrams
S3 wireframe diagrams
 
Sql
SqlSql
Sql
 
Alien database
Alien databaseAlien database
Alien database
 
Video Games and Copyright laws
Video Games and Copyright lawsVideo Games and Copyright laws
Video Games and Copyright laws
 
Games Design Document
Games Design DocumentGames Design Document
Games Design Document
 
Video game proposal
Video game proposalVideo game proposal
Video game proposal
 
Evaluation
EvaluationEvaluation
Evaluation
 
H evaluation
H evaluationH evaluation
H evaluation
 
H file handling
H file handlingH file handling
H file handling
 

Recently uploaded

Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 

Recently uploaded (20)

Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 

H testing and debugging

  • 2. ‘Good’ software is… Robust Portable • Produces the correct output • from the correct input • Copes with invalid input data • Deals with unexpected conditions • Runs on different platforms such as OSX/Windows/Linux Reliable
  • 4. Lesson Aims By the end of this lesson all pupils will be able to: ❏ Describe the types of errors that may be discovered ❏ Explain what is meant by systematic testing ❏ Explain what is meant by comprehensive testing ❏ Explain the importance for documentation at every stage of the project
  • 5. A philosophical view… “Program testing can be a very effective way to show the presence of bugs, but it is hopelessly inadequate for showing their absence.” Edsger W. Dijkstra 1972 The Humble Programmer (1972) Hamilton Richards
  • 6. Testing What is the purpose of testing any product? ❏ Is it Fit for purpose - does it meet the specification ❏ Is it robust ❏ Is it reliable MURPHY’s LAW 1 The quicker program coding is started the longer the project will take MURPHY’s LAW 2 Murphy’s Law 1 is correct!
  • 7. Aspects of Testing Testing has to follow a plan. It has to be systematic it has to be comprehensive What are we testing? What is the function we want to test What data/actions do we need to perform to test this? What is the expected (correct) output?
  • 8. Aspects of Testing (cont.) In an ideal world testing would be exhaustive – meaning that every single possible condition would be tested This is unfortunately not the case. However your testing can be comprehensive One way is to ensure that you use a wide range of test data Modules can be tested individually Modules can also be tested to ensure that they integrate well
  • 9. Test Data Type Description Accepted Normal This is data that the program should be expected to use in normal operation YES Extreme This is data at the edge of what is acceptable, such as high and low limits or boundaries YES Exceptional This is invalid data. Robust programs should reject this NO
  • 10. A Testing table Imagine a program that accepted and graded pass marks between 0 and 20, a pass is 12 or more. You should show for each input what the expected output is and the actual output and make a comment. This may be as simple as ‘As Expected’
  • 11. Testing Table Type Input Expected Output Actual Output Comment NORMAL 2 FAIL FAIL As Expected 7 FAIL FAIL As Expected 12 PASS PASS As Expected EXTREME 0 FAIL FAIL As Expected 20 PASS PASS As Expected EXCEPTIONAL -1 Error Error Program Crashes 21 Error Error Program Crashes
  • 12. Phases of Testing Alpha Testing Internal testing Pre-Release Done by Development Team Beta Testing Testing a program in working conditions Members of public or independent test group Feedback provided to the development team
  • 13. Types of Errors (recap) When testing programs there will be errors (bugs) there are different types… 1. Syntax These are mistakes in the programming ‘grammar’ e.g. Forgetting to put a semi colon or close a bracket 1. Execution These are errors detected during run-time. Divide by zero etc. 1. Logic These are errors in the design of the program Passing the wrong data into a function Programs will fail translation so won't run Programs will run but give some unintended output Programs will usually fail during runtime
  • 14. Constructing a test plan The purpose of a test plan is to ensure that you are systematically and comprehensively testing your system The test plan must test the functionality of the software ❏ A successful test is one that finds errors! ❏ Try to find the errors!
  • 15. Test cases and Data What are your test cases? This can be thought of as the ‘user’ interaction with your system What test data will you use - your system may not be populated What data will you use in your system to ensure that your tests are valid?
  • 17. Debugging tools What if it finds an error? There are various debugging techniques/tools ❏ Dry Runs ❏ Trace Tables/Tools ❏ Breakpoints ❏ Watchpoints
  • 18. Dry Runs A dry run is when you manually stepping through the lines of code without the need for executing the program. Can be useful for logic errors.
  • 19. Trace table When you use a trace table you step through the code recording changes to variables. The changes can then be used to track when and what it is being changed to.
  • 20. Breakpoints You set breakpoints to stop execution of the code at specified lines of code. At this point the contents of variables can be examined This can be a method to ascertain if a piece of code is actually being executed, obviously useful for debugging conditional statements. As you can check if the variables match the conditions you think they do
  • 21. Allows execution to be halted and the contents of variables inspected Breakpoints in Python (Pycharm)
  • 22. Watchpoints Watchpoints are similar to breakpoints but they are assigned to variables They then stop the execution of the program only when the contents of a specific variable(s) meet a particular condition. This can be at any point in the execution of the code
  • 23. Watchpoint set for when counter == 1 Will halt the execution of the program when the variable counter changes to 1

Editor's Notes

  1. Edsger Wybe Dijkstra (11 May 1930 – 6 August 2002) was a Dutch computer scientist. He received the 1972 Turing Award for fundamental contributions to developing programming languages, and was the Schlumberger Centennial Chair of Computer Sciences at The University of Texas at Austin from 1984 until 2000. Shortly before his death in 2002, he received the ACM PODC Influential Paper Award in distributed computing for his work on self-stabilization of program computation. This annual award was renamed the Dijkstra Prize the following year, in his honor. (http://en.wikipedia.org/wiki/Edsger_W._Dijkstra)