Outline Announcements: –HW I key online this afternoon –HW II due Friday –Sign up to discuss projects Debugging Testging for correctness.

Slides:



Advertisements
Similar presentations
Coding and Debugging. Requirements and Specification Recall the four steps of problem solving: Orient, Plan, Execute, Test Before you start the implementation.
Advertisements

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.
Software Design Designer clothes?. Outline Announcements: –Homework I on web, due Wed., 5PM by –Starting Friday, Wed. and Fri. lectures will meet.
Programming Types of Testing.
ECE Application Programming
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
Debugging Techniques1. 2 Introduction Bugs How to debug Using of debugger provided by the IDE Exception Handling Techniques.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Debugging Introduction to Computing Science and Programming I.
Python Programming Chapter 1: The way of the program Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
Class 1: What this course is about. Assignments Reading: Chapter 1, pp 1-33 Do in Class 1: –Exercises on pages 13, 14, 22, 28 To hand in in Class 2: –Exercises.
16/27/2015 3:38 AM6/27/2015 3:38 AM6/27/2015 3:38 AMTesting and Debugging Testing The process of verifying the software performs to the specifications.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
1 L07SoftwareDevelopmentMethod.pptCMSC 104, Version 8/06 Software Development Method Topics l Software Development Life Cycle Reading l Section 1.4 – 1.5.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
6 Steps of the Programming Process
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.
CSC141 Introduction to Computer Programming
Software Engineering 2003 Jyrki Nummenmaa 1 CASE Tools CASE = Computer-Aided Software Engineering A set of tools to (optimally) assist in each.
ICAPRG301A Week 4Buggy Programming ICAPRG301A Apply introductory programming techniques Program Bugs US Navy Admiral Grace Hopper is often credited with.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
Program Development Life Cycle (PDLC)
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Outline Announcements: –Homework I on web, due Fri., 5PM by –Small error on homework –Wed and Fri in ACCEL, Attendance required –LAST DAY TO ADD/DROP!
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.
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Editing & Compiling: UNIX vs. IDE and an Intro to Architecture.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Software Design. Outline Announcements: –Homework I on web Friday –Starting Friday, Wed. and Fri. lectures will meet in ACCEL “Green” Room in Carpenter.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Errors “Computer says no..”. Types of Errors Many different types of errors new ones are being invented every day by industrious programming students..
Making Good Code AKA: So, You Wrote Some Code. Now What? Ray Haggerty July 23, 2015.
1 SEEM3460 Tutorial Compiling and Debugging C programs.
Debugging. Outline Announcements: –HW II due Fridayl db.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
School of Computer Science & Information Technology G6DICP - Lecture 6 Errors, bugs and debugging.
More Python!. Lists, Variables with more than one value Variables can point to more than one value at a time. The simplest way to do this is with a List.
Programming Errors. Errors of different types Syntax errors – easiest to fix, found by compiler or interpreter Semantic errors – logic errors, found by.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 6: Debugging in MATLAB Monday 15 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
The Hashemite University Computer Engineering Department
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development Lecture 2 Debugging,
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
1 Programming and problem solving in C, Maxima, and Excel.
1 ENERGY 211 / CME 211 Lecture 14 October 22, 2008.
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
The Software Development Cycle
Problem Solving Techniques
Common C Programming Errors, GDB Debugging
CSCE 315 – Programming Studio, Fall 2017 Tanzir Ahmed
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Programming.
Programming Fundamentals (750113) Ch1. Problem Solving
PROGRAMMING FUNDAMENTALS Lecture # 03. Programming Language A Programming language used to write computer programs. Its mean of communication between.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 15 Debugging.
The Software Development Cycle
Chapter 15 Debugging.
Presentation transcript:

Outline Announcements: –HW I key online this afternoon –HW II due Friday –Sign up to discuss projects Debugging Testging for correctness

Development Process 1.Design: What will the program (or modification) do? How will it work? 2.Specification--formal statements of what code will do 3.Prototyping--a “proof-of-concept” version. Simple version written in an interpreted language (Matlab, Python) 4.Implementation: write the code 5.Build: Get it to compile and run a) Debug I: find and fix syntax errors b) Debug II: find and fix semantic errors (testing) 6.Improve performance through tuning or re-design

Old-Fashioned Debugging The point of debugging is to find your errors Simplest technique is checkpointing –Place an output statements around calls to subroutines printf(“Entering subroutine A”) A(); printf(“Completed subroutine B”) –If your program crashes in A, you won’t see the second line Work into subroutines, bracketing sections of code with outputs until you find where the error occurs.

Old-fashioned Debugging Enhancments to checkpointing: –Print values of suspect variables –Could involve saving arrays to files Useful to have routines to write specific data types –If graphics are available, plot the data

Checkpointing is nice because it works on any system that can run your code But, requires lots of compiles as you zero in on bug. WARNING: Finding the line where the program crashes is not enough, you need to know why! –The problem could result from a previous statement –In this case, figure out where the variables on the offending line are set, and work backwards Old-Fashioned Debugging

UNIX standard debugging program is db (gdb on Linux) gdb allows you to watch your program run –Set breakpoint--position in code, execution will stop when reached –Step through program line-by-line –Examine value of variables Special compiler settings are required (-g) –db needs to know correspondence between object code and source code Middle-age debugging

IDE’s like VizStudio have graphical debuggers –On some systems, this is just a GUI for db Modern Debugging

Validation Assume your code will compile and run THIS DOESN’T MEAN YOU’RE DONE You need to verify that your code is solving the the right problem

Formal Specification This says what a program should do, but says nothing about how it will get done –No details of P We now have P (we think) –We can test that I^P=>O for some inputs and outputs

Test Cases Test cases are an important part of scientific computing Typically, these are simple problems for which the answer is known –Ideally, an analytic solution Examine output--systems like MATLAB are useful

Test cases are also useful for sharing and extending code –Provide a suite of test cases to new users Tests that code runs on their system Helps them learn to run your code –Make sure your extensions didn’t break anything! Test Cases

Specification of model problem English: Given inputs, RAD1d finds an approximate solution for PDE: at time T –Sol’n will be more accurate as dx & dt ->0

Test Cases for Model Problem Advection only: –If u is constant, then regain initial conditions at t= L/u Diffusion only, constant: –Complicated analytical solution, but know that solution should tend to mean( C ) Reaction only –Solution should agree with ODE: dC/dt=reaction (each grid point represents a unique initial condition)

Flaw of Test Cases Test cases are simple and usually won’t test all parts of the code Pick small, but hard cases to test logic of program –Small enough that you can reason them through yourself Test subroutines individually, then test program Key of testing: –Look at your output!

Next 2 weeks Wed: Debugging tools Fri: Version control & working in groups Mon & Wed: Profiling and tuning (lecture and lab) Fri: Project presentations (5 min) –General description of problem (diagram?) –Mention tools used & what you learned Other ideas?