Testing.

Slides:



Advertisements
Similar presentations
Programming Types of Testing.
Advertisements

Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Debugging Introduction to Computing Science and Programming I.
Chapter 2: Input, Processing, and Output
Chapter 1 Program Design
Validation and Verification Today will look at: The difference between accuracy and validity Explaining sources of errors and how they could be overcome.
Fundamentals of Python: From First Programs Through Data Structures
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
Fundamentals of Python: First Programs
Noadswood Science,  To know the basics of Python coding and decoding Monday, September 07, 2015.
UNIT 3 TEMPLATE AND EXCEPTION HANDLING. Introduction  Program errors are also referred to as program bugs.  A C program may have one or more of four.
Chapter 8: Systems analysis and design
Programming Translators.
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Systems Life Cycle. Know the elements of the system that are created Understand the need for thorough testing Be able to describe the different tests.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 4 Looping.
The Software Development Process
1 Program Planning and Design Important stages before actual program is written.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
REVIEW No curveballs this time …. PROBLEM TYPE #1: EVALUATIONS.
Introduction to Testing CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Data Validation while loops. Data validation Programs get input data from different sources All data should be ‘validated’ before the program tries to.
Intermediate 2 Computing Unit 2 - Software Development.
School of Computer Science & Information Technology G6DICP - Lecture 6 Errors, bugs and debugging.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Error Handling Tonga Institute of Higher Education.
REVIEW No curveballs this time …. PROBLEM TYPE #1: EVALUATIONS.
10 Chapter 101 Using Menus and Validating Input Programming Logic and Design, Second Edition, Comprehensive 10.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Validation & Verification Today will look at: The difference between accuracy and validity Explaining sources of errors and how they could be overcome.
Algorithms and Pseudocode
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
While loops. Iteration We’ve seen many places where repetition is necessary in a problem. We’ve been using the for loop for that purpose For loops are.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
COMPUTER PROGRAMMING I 5.05 Apply Looping Structures.
In today’s lesson we will be looking at: what we mean by the software development lifecycle the phases in the lifecycle We will focus particularly on testing:
Chapter 9: Value-Returning Functions
Highcliffe ICT Department
Component 1.6.
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
Chapter 2: Input, Processing, and Output
7 - Programming 7P, Q, R - Testing.
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Testing a Solution.
Systems Life Cycle: Testing
Learning to Program in Python
While loops The while loop executes the statement over and over as long as the boolean expression is true. The expression is evaluated first, so the statement.
Program Design Introduction to Computer Programming By:
Introduction to pseudocode
Coding Concepts (Standards and Testing)
Computer Science Testing.
Programming Errors Key Revision Points.
Software Development Process
Chapter 2: Input, Processing, and Output
Introduction to Databases
Learning Intention I will learn about the different types of programming errors.
Review of Previous Lesson
WJEC GCSE Computer Science
WJEC GCSE Computer Science
Software Development Techniques
CHAPTER 6 Testing and Debugging.
Presentation transcript:

Testing

Activity 1 5 mins What is the difference between: A “Syntax Error” …and… A “Logic Error”

Testing Introduction Computers only do what they are told. Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Introduction Computers only do what they are told. If the program doesn’t work as it should (either doesn’t run or runs with unexpected results) it will be down to an error that the programmer has made. We will now look at the two types of errors found in programming and understand how we can test for these errors so that our programs work as we have intended.

Syntax Error Logic Error Testing Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. There are 2 types of error: Syntax Error & Logic Error What do you think is the difference?

Testing HOW? Syntax Errors: Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Syntax Errors: These are errors that occur when the instructions/code that is written do not follow the rules of the programming language. The code cannot be understood by the computer when it is run and an error message is generated. Most of the time the IDEs interpreter will highlight these errors as you type your code. HOW? Often with red lines!

Testing Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Syntax Errors: Now that you are proficient programmers, what syntax errors have you experienced? Examples may include: Syntax Error Example Misspelt Keywords “colour” instead of “color” Missing or extra brackets print(“Hello World”)) Missing parts from multi-line instructions Missing the ENDWHILE from WHILE/ENDWHILE Type mismatch errors Trying to multiply a string variable Referring to variables that have not been declared If x == 3: (when x is unknown)

Testing Logic Errors: Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Logic Errors: These types of error are usually not known until runtime (when the program is actually being used). They occur when there is a mistake in the algorithm which results in the program not doing what it was intended to do. The program might: Crash Get stuck in a loop Or simply produce unexpected results. What sort of things might happen if a program contains some logic errors?

Testing Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Logic Errors: Now that you are proficient programmers, what logic errors have you experienced? Examples may include: Logic Error Mistakes in maths (eg: x*(3+2), instead of (x*3)+2) Misplaced brackets Misplaced indentations Instructions in the wrong order Wrong conditions being set in a loop

Testing using Test Plans! Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. After writing your code, correcting syntax errors as we go along and checking that our program works as it should by systematically testing it as we go along, our program should be working well! But this is often not the case as we are humans and humans make mistakes! So how can we check for these remaining errors? The answer is… Testing using Test Plans!

Testing Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Test Plans: Test plans are used to interrogate the finished program. Testing is done using test data and a good test plan will use test data that covers every possible type of input: Normal Data Borderline / Extreme Data Erroneous Data

Testing Normal Data Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Normal Data This is data that should be accepted by the program. Normal input you would expect form typical use. E.G. Date of Birth = 12/04/1972

Testing Borderline / Extreme Data Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Borderline / Extreme Data Data that tests the limits of what should be accepted Data just above, just below and actually on the acceptable limit E.G. Date of Birth = 12/04/1900

Testing Erroneous Data Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Erroneous Data Data that should be rejected Also check that error messages are generated to inform the user E.G. Date of Birth = Twelfth of the fourth nineteen seventy two Error: please enter a valid date!

Testing Test Plans Learning Objectives: These are used to: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Test Plans These are used to: ensure that a system is fully tested to document the outcomes. Test plans are made up of: The test data The reason for the test The expected outcome The actual result (which is added later – after development)

Testing Actual Outcomes (after development) Learning Objectives: (p) describe syntax errors and logic errors which may occur while developing a program (q) understand and identify syntax and logic errors (r) select and justify test data for a program, stating the expected outcome of each test. Test Plans Ultimately they will test the program works as it should – has met the success criteria. So if the success criteria was: A suitable test plan might look something like this: Example Success Criteria: User should be able to enter ONLY dice number 4, 6 or 12 Program should generate a random number within the limits of the dice chosen. The program should ask if the user would like to roll again. Test Number Reason for Test Type of Test Test Data Expected Outcome 1 To see if the user can input their dice number Typical Enter a 6 when program requests The program will accept the input and pick a random number from 1-6. 2 Extreme Enter a 12 when program requests The program will accept the input and pick a random number from 1-12. 3 Erroneous Enter a 1 when program requests The program will NOT accept the input and ask for the number again. 4 To see if the user can roll again. Type in “Y” The program will ask the user for a dice number again. 5 Type in “N” The program close. 6 Type in “Yes” The program will ask the user if they would like to roll again. Actual Outcomes (after development)