Review of Previous Lesson

Slides:



Advertisements
Similar presentations
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Advertisements

30/04/ Selection Nested If structures & Complex Multiple Conditions.
Exception Handling Chapter 12.  Errors- the various bugs, blunders, typos and other problems that stop a program from running successfully  Natural.
Programming Types of Testing.
Debugging Techniques1. 2 Introduction Bugs How to debug Using of debugger provided by the IDE Exception Handling Techniques.
Debugging Introduction to Computing Science and Programming I.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Programming Translators.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
26/10/ Selection Nested If structures & Complex Multiple Conditions.
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.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
22/11/ Selection If selection construct.
The Software Development Process
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
1 Program Planning and Design Important stages before actual program is written.
Intermediate 2 Computing Unit 2 - Software Development.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Chapter 6 Testing and running a solution. Errors X Three types Syntax Logic Run-time.
11 Making Decisions in a Program Session 2.3. Session Overview  Introduce the idea of an algorithm  Show how a program can make logical decisions based.
Component 1.6.
Introduction to Computing Science and Programming I
Chapter 10 Programming Fundamentals with JavaScript
Topic: Python’s building blocks -> Variables, Values, and Types
3.1 Fundamentals of algorithms
Topics Designing a Program Input, Processing, and Output
ME 142 Engineering Computation I
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.
Lecture 1 Introduction Richard Gesick.
7 - Programming 7P, Q, R - Testing.
Different Types of Testing
The Software Development Cycle
Testing UW CSE 160 Winter 2017.
Software Design and Development
The Selection Structure
Testing Key Revision Points.
Lesson Outcomes Be able to identify differentiate between types of error in programs Be able to interpret error messages and identify, locate.
Chapter 10 Programming Fundamentals with JavaScript
Chapter 15 Debugging.
Testing UW CSE 160 Winter 2016.
CS1100 Computational Engineering
Programming Fundamentals (750113) Ch1. Problem Solving
If selection construct
Computational Thinking for KS3
Coding Concepts (Standards and Testing)
If selection construct
Chapter 15 Debugging.
Algorithm and Ambiguity
Software Development Process
Flowcharts and Pseudo Code
Topics Designing a Program Input, Processing, and Output
ICT Gaming Lesson 2.
An Introduction to Debugging
Topics Designing a Program Input, Processing, and Output
Review of Previous Lesson
Review of Previous Lesson
Review of Previous Lesson
Review of Previous Lesson
Review of Previous Lesson
Review of Previous Lesson
Review of Previous Lesson
IPC144 Introduction to Programming Using C Week 2 – Lesson 2
CHAPTER 6 Testing and Debugging.
The Software Development Cycle
Presentation transcript:

Review of Previous Lesson 25/05/2019 Review of Previous Lesson State as many Vocabulary words and Learning Objectives that you remember from the last lesson as you can. Remember to grade yourself from 0 - 3.

Conditionals & Control Flow 25/05/2019 Conditionals & Control Flow Complex Multiple Conditions

Language Features and other Testable Topics 25/05/2019 Tested in the AP CS A Exam Notes Not tested in the AP CS A Exam, but potentially relevant/useful Operators Logical: !, &&, || 1, 3 Control Statements if, if/else

Language Features and other Testable Topics 25/05/2019 Notes: 1. Students are expected to understand the operator precedence rules of the listed operators. 3. Students need to understand the “short circuit” evaluation of the && and ||

25/05/2019 Program Analysis The analysis of programs includes examining and testing programs to determine whether they correctly meet their specifications. It also includes the analysis of programs or algorithms in order to understand their time and space requirements when applied to different data sets.

Program Analysis A. Testing B. Debugging C. Runtime exceptions 25/05/2019 Program Analysis A. Testing 1. Development of appropriate test cases, including boundary cases 2. Unit testing 3. Integration testing B. Debugging 1. Error categories: compile-time, run-time, logic 2. Error identification and correction 3. Techniques such as using a debugger, adding extra output statements, or hand-tracing code. C. Runtime exceptions

25/05/2019 Black box testing Use of different input values to determine whether the program gives you expected results (compare actual results with expected ones) and can cope with them without crashing. These values should include Different types of input e.g. Typical values Borderline values Unacceptable values Do not look into the program (box) all you see are the inputs (what goes in) and outputs (what comes out at the end).

Example 1 of Black Box Testing 25/05/2019 Example 1 of Black Box Testing A program which uses marks out of 100 from a math's examination as input. Normal data like: 27, 73.., Borderline data: 0 and 100 Invalid data like: –34, 123, 16.345 Note that you should try one piece of invalid data at a time otherwise, if there is an error or problem, you will not be able to tell which piece of invalid data is causing the problem (one, more than one or all). For example using -16.445 means that, if there was an error, you would not know if it was because you used a negative (-) number or because you used a decimal (real) number. You should use -16 and then 16.445 (in any order) first, if there are no errors, then you could try -16.445.

Manual White Box Testing / Dry Runs / Desk Checking 25/05/2019 Manual White Box Testing / Dry Runs / Desk Checking Basically manually Tracing or Variable Watching with a table which the programmer fills in. FirstNumber SecondNumber Total

There are 2 main types program error (bug) 25/05/2019 There are 2 main types program error (bug)

1. Syntax errors / Compile-time errors 25/05/2019 1. Syntax errors / Compile-time errors Discussed in the “How to Compile & Run your First Java Program” presentation. Programming languages have a particular format you have to stick to when telling the computer what to do. This format is called syntax. When code is written in a way that the computer can understand, we say the code is syntactically correct. When the code is written in a way the computer cannot understand, we say there is a syntax error. Please also note that Java is case sensitive. Almost all syntax errors will stop Javac from compiling a program, if so they are also known as ‘compile-time errors’.

25/05/2019 2. Logic errors (can also be known as run-time errors if found when a program is run) A mistake in the way the program solution has been designed. e.g. An instruction in a program may tell the computer to jump to the wrong part of the program. Total_number = Previous_total – New_number Known as logic errors if found whilst not running a program and using white box testing. Can also be known as run-time errors if found when actually running a program during black box testing. Don’t necessarily lead to a program ‘crashing’, may just lead the program to give incorrect/unexpected results. This does mean to say that logic errors will not make a program ‘crash’ (e.g. division by 0 will lead a program to crash if code is not written to deal with it), just not necessarily. This is known as a “runtime exception” as it is not checked by Javac during compile time.

25/05/2019 Write your own programs: Write your own programs from “scratch”. Of course you should use previous programs for reference, but write your code from “scratch” (do not copy and paste).

Rent a property Specification: 25/05/2019 Illustrate complex multiple conditions: More specifically to illustrate the order of precedence of the And & Or logical operators. A customer wants to rent a holiday property which has 4 or more bedrooms, and it must be a cottage (C) or a detached (D) house. Start with the following code: Run the program and test all possibilities. You should find a problem! What is it? Please solve and explain the issues in a comment. Note: I believe the terms ‘cottage’ & ‘detached’ are British terms. Other types of houses are terraced (‘T’), semi-detached (‘S’), ‘flat’ (‘F’), (‘apartment’ (‘A’), etc…. You can look up these terms in Google or Bing etc.. images on the net. Continued on the next slide.

25/05/2019 Rent a property You should find that if it is a cottage and the number of bedrooms is lower than 4 the program still says ‘Rent it!’. This is because && is done before ||. So the program interprets the code like this: type == "C" Or type == "D" And bedrooms >= 4 So if it is Detached then this works as both the type and the number of bedrooms has to be true but if it is a cottage then the type or the number of bedrooms is required to be true; so it doesn’t work. How can we fix this? See if you can fix this yourself before looking at the solution on the next slide. Continued on the next slide.

Rent a property How can we fix this? 25/05/2019 Replace the previous code with:

Deciding Exam Grades Extended 2 25/05/2019 Deciding Exam Grades Extended 2 Change the “Deciding Exam Grades” Program written in a previous presentation. Use a logical expression that is true when the mark is within the range and false when the mark is outside the range of 0 – 100 and. Therefore use one IF statement with an initial IF test with And, to test if the mark is valid proceeded with a nested IF statement to produce the appropriate valid messages: Merit (60 or more), Pass (40 – 59), Fail (under 40). With a final “Else” to produce the general error message: “You have entered an invalid mark!” Note: Make a copy of the previous program to keep the original program but rename it.

5/25/2019 Grade yourself Grade yourself on the vocabulary and learning objectives of the presentation.