5 Pages

CSIS110Lecture33

Course: CSIS 110, Fall 2009
School: Fort Lewis
Rating:
 
 
 
 
 

Word Count: 1416

Document Preview

110 CSIS - Lecture 33 Announcements: Quiz Next Wednesday. Includes material up to Wednesday, but not today. Since last quiz: 2D arrays, nested loops, user input validation, main, toString. Homework on class web site due Monday! Read: Chapter 6, sec 6.1 to 6.3. Testing When you work on your methods, does the code that you write work correctly the first time? What kinds of things are wrong? It doesn't compile you...

Register Now

Unformatted Document Excerpt

Coursehero >> Colorado >> Fort Lewis >> CSIS 110

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
110 CSIS - Lecture 33 Announcements: Quiz Next Wednesday. Includes material up to Wednesday, but not today. Since last quiz: 2D arrays, nested loops, user input validation, main, toString. Homework on class web site due Monday! Read: Chapter 6, sec 6.1 to 6.3. Testing When you work on your methods, does the code that you write work correctly the first time? What kinds of things are wrong? It doesn't compile you made a syntax error. For the most part, these are relatively easy to correct. It compiles and runs, but produces incorrect results your program has a logical error. These can be much harder to find. Experienced programmers don't make many syntax errors, and when they do they are able to correct them quickly. This is because the language details are familiar. But, they still make logical errors. In a large program it is extremely difficult to write a program that is 100% correct. Finding and correcting the defects in these programs is a serious challenge. What processes can we use to find defects? How do you go about finding problems? Three activities for improving the correctness of your programs: Testing: the process of finding out if an application or segment of code (such as a method) contains a bug. Doing a good job of testing is not easy there is much to think about when testing a program. Debugging: when testing shows that there is an error, you have to locate the error in the source code. You need to find out exactly what is causing the error. It can take a significant amount of work between knowing that there is an error and finding its cause. Writing for Maintainability: This is about following practices that lead to fewer errors in the first place. It is also about writing code so that errors are easier to find when they do occur. This is closely related to coding style and documentation. You want your code to be easy to understand both for the original programmer and for someone else who might need to read it later. There is a huge difference between well written and poorly written code when it comes to debugging effort. [Ask question about what has been done in this class to encourage this practice] For now, we can divide testing up into 2 categories: Application testing and unit testing. Application Testing is testing that examines a complete application (program) for defects. In many cases, the tester does not have access to the code all testing is done through the user interface. Unit Testing tests smaller pieces of code (such as a method). Units can be items such as a class, a group of classes, or even a single method. Unit testing can be performed long before the application is complete. Let's look at application testing: The Triangle Application How can you go about determining if this program is correct? Well, you could just try random stuff and see what happens. How would you know if the program behaved correctly or not? You need to be more methodical. You need to define some test cases, where you try to verify whether the program behaves correctly for some particular characteristic. To do this, you need to understand what the program is supposed to do. Then you need to check if it actually does this thing. Programming Assignment This brings us to our next programming assignment The assignment has 2 parts. The first part is due next Friday, and does not involve any programming! Instead, I want you to test an application that I have written. The assignment is for you to write a program that encrypts messages. [Look at the application and the assignment. Discuss Caesar cipher] For example, you would want some tests to see if it builds the key square correctly. There are a bunch of rules that say how the program is supposed to do this. You need to come up with at least one test case for each rule. You should also think about: Positive testing making sure that the program behaves correctly when given good data Negative testing making sure that the program handles incorrect data in a reasonable way. What do you think is the point of this assignment? Testing Unit What's unit testing? Testing parts of an application while you are building it: - it's never too early to start testing - Allows you to find problems earlier, when they are easier to fix - You build a set of tests, which you can reuse when you modify the code So, let's try some unit testing. Open up the diary-testing project from the chapter 6 folder. This is an early version of an appointment book. The final goal is to build an application that allows users to schedule appointments up to 1 year in advance. In this version, there are 3 classes: - Appointment: objects that keep track of an appointment's purpose and duration - Day: A Day object keeps track of a set of Appointments that have been made on a single day. Each day has a unique position in the year a value from 1 to 366. Appoints can only be made from 9AM to 5PM (using a 24 hour clock). - Week: Keeps track of the days in a week There are 2 simplifications in this project: appointments always start on an hour, and they always last for a multiple of 1 hour. Let's focus on the Day class how would we go about testing it? What kinds of questions do you have about the behavior of a Day object? - Does it have enough room to store the required number of appointments? - Doe the showAppointments method correctly display appointments that have been made? - Does the makeAppointment method correctly update the appointment field? - Does findSpace return the correct answer? We can answer all of these questions using the object bench and object inspectors. Create a Day object. Open the object inspector does the appointment field have enough elements to store the required number of appointments? Leave the object inspector open. One thing we want to do is make sure that objects behave correctly both when they are empty and when they are full. So, before we create any appointments we should make sure that showAppointments works. Another element of good testing is to check boundaries this is where mistakes are often made. What are the boundaries of the Day object? - the first appt of the day - the last appt of the day Try to create 1 hour appointments at the beginning and end of the day. Also create one in the middle of the day. Use the inspector to make sure the appointments were created. Also call the showAppointments method Are there any other boundaries? Is there anything else we should check at the boundaries? Yes- want to make...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Fort Lewis - CSIS - 350
CSIS 350 Lecture 2Last time We saw that we frequently use systems that include a database as a major component: WebOpus, on-line retailers, cell phone directory, ATMs,. Looked at definitions of database o System for storing data so that information
Fort Lewis - CSIS - 350
CSIS 350 Lecture 23Announcments Homework on web site due Thursday Any problems creating a database? CSIS 332 Java for the Internet Chapter 7 Last time we started looking at SQL DDL: The CREATE TABLE statement - define columns: name, type, constrai
Fort Lewis - CSIS - 190
CSIS 190 Fall 2007 Introduction to Computer ScienceMWF 10:10 11:05 EBH 108 Brian Hanks EBH 176 hanks_b@fortlewis.edu 247-7344Catalog Description: This course investigates the breadth of computer science. Topics include computer organization, ope
Fort Lewis - GS - 100
GS 100 Fall 2007 Freshman Seminar: Tech AcademyTuesday 1:25 2:20 EBH 60 Brian Hanks EBH 176 hanks_b@fortlewis.edu 247-7344The purpose of the freshman seminar is to engage students intellectually through rigorous academic study in small class set
Fort Lewis - CSIS - 110
CSIS 110 - Lecture 26Announcements: I will be out of town from Thursday through Monday: Professor Gordon will be covering the class on Friday There will be no class on MondayRead: Sections 5.10 and 5.11 Last Time: Modified our tech support system
Fort Lewis - CSIS - 110
CSIS 110 Lecture 36Announcements Part 2 of the last programming assignment is on the course web site. I have put my recent notes on-line also. String and StringBuffer Let's go back a revisit the String class. What are some methods provided by this
Fort Lewis - CSIS - 110
CSIS 110 Lecture 2Open BlueJ, Open shapes project. Review features ask questions about: - Class vs Object - Attributes - Creating an Object - Invoke a method - Method signature - Data types - Strings - Comment new State The set of values of all a
Fort Lewis - CSIS - 110
CSIS 110 Lecture 6Quiz next Wednesday. Material in Chapters 1 and 2. Last Time We looked at a smarter ticket machine, and discussed the following concepts: - conditional statements and boolean expressions - local variables - variable scope Chapter
Fort Lewis - CSIS - 110
CSIS 110 - Lecture 11Homework: Any questions? Last time: Collections Lets look at some declarations: private ArrayList<String> notes; private ArrayList<Student> studentBody; private ArrayList<Book> library; What is the type of the variable? What is
Fort Lewis - CSIS - 370
CSIS 370 - Lecture 5My Notes I have put copies of my lecture notes on the course web site - I will put these there some time after the lecture. These are not a substitute for coming to class, as they are frequently heavily abbreviated, randomly orde
Fort Lewis - CSIS - 370
CSIS 370 - Lecture 4Reading - due Tuesday. Chapter 13 of the text. Design What is design? Translation of user requirements into a description of how the system will satisfy those requirements. Design creates a representation or model of the software
Fort Lewis - CSIS - 370
CSIS 370 - Lecture 3Architectures Tiered or Layered architecture: system functionality is partitioned (or layered) so that each partition performs specific functionality, and only communicates with the adjoining layers. Frequently, each layer execut
Fort Lewis - CSIS - 310
import java.util.*;import java.io.*;/* * Echo the contents of a file to the standard output. * * @author Brian Hanks */public class Echo { public static void main(String[] args) { / Make sure that only 1 file name is given
Fort Lewis - CSIS - 370
Lehman's LawsPrinciples of Software Evolution1: Continuing Change A program that is used in a real world environment necessarily must change or become progressively less useful in that environment.2: Increasing Complexity As an evolving progra
Fort Lewis - CSIS - 110
CSIS 110 Lecture 37Announcements: Quiz Friday Review next time. Last Time: String and StringBuffer What are some major differences between the String and StringBuffer classes? - Strings are immutable (value cannot be changed) - StringBuffer class
Fort Lewis - CSIS - 370
CSIS 370 Lecture 22Effective PM chapter 11 & Critical Success Factors Project wrap-up and post-project reviews Size steps to project closure - client acceptance - installation - documenting the project - Post-implementation audit - Final report - Ce
Fort Lewis - CSIS - 110
CSIS 110 Lecture 33Reading: Appendix E (pages 432 - 434) Chapter 6: 6.1 to 6.3 Quiz Results Mean: 20.1 Median: 20.5 Max: 23 Distribution: 15-17: 2 17.5-19.5: 2 Last time: Array initialization Main So far, we have only executed our java classes insi
Fort Lewis - CSIS - 370
CSIS 370 - Lecture 19Reminders: Project Milestones on course web site Test Plan: March 30 Customer Acceptance Test Plan: April 13 Post Project Review: April 18 Project Presentation / Turn in final project workbook: April 25 Debugging The first `doc
Fort Lewis - CSIS - 110
CSIS 110 Lecture 2Announcements Homework due on Friday Read Ch 1 if you haven't done so already. Chapter 2, section 2.1 to 2.4 (pages 17-27)Open BlueJ, Open shapes project. Review features ask questions about: - Class vs Object - Attributes - Cr
Fort Lewis - CSIS - 370
CSIS 370 Lecture 13Project participation survey Schedule: Next reading assignment due Thursday Exam review Tuesday bring an example question (with an answer!) Exam Thursday (Evans) Career Fair! Agile Methods Draw the waterfall model, and discuss th
Fort Lewis - CSIS - 110
CSIS 110 Lecture 9Quiz Resultsmean stdev median max 20.1 5 22 24Distribution (after EC): <15: 1 15-17: 2 17.5 19.5: 320 22: 122.5+: 5Reading Assignment: Section 4.11. Potentially confusing. Read before Monday, and again after lecture. La
Fort Lewis - CSIS - 370
CSIS 370 - Lecture 20Reminders: Project Milestones on course web site Test Plan: March 30 Customer Acceptance Test Plan: April 13 Post Project Review: April 18 Project Presentation / Turn in final project workbook: April 25 Testing User Manuals Hav
Fort Lewis - CSIS - 310
CSIS 310 Lecture 37Hash Tables Hash tables provide excellent performance for insertion and searching: basically constant time. BST is O(log n) for the same operations. So, why not use a hash table for everything? What are the benefits of a BST? prim
Fort Lewis - CSIS - 110
CSIS 110 Lecture 4Announcements Read sections 2.10 to 2.15 Office Hours Notes from last week on line Last Time method signature & return type. We started looking at a ticket machine, and started looking at the parts. - class definition (outer wrapp
Fort Lewis - CSIS - 190
CSIS 190 Lecture 35Announcements Homework results? Artificial Intelligence Last time we started examining the area of artificial intelligence: what does it mean for a machine to be intelligent? Turing Test Turing was one of the first people to consi
Fort Lewis - CSIS - 110
CSIS 110 - Lecture 19Quiz Results: Homework on web site. Last Time: Arrays - what is an array? - How do we declare an array variable? - How do we allocate the array elements? - How do we access an individual element? - What is the initial value of a
Fort Lewis - CSIS - 360
CSIS 360 Lecture 23Risk Management Boehm claims that he has observed project managers successfully use waterfall, evolutionary development, and complex mixtures involving prototyping, simulation, subcontracting, tiger teams, etc. This suggests that
Fort Lewis - CSIS - 110
CSIS 110 - Lecture 17Announcements Read Section 4.12 again! Arrays A few days ago I said that Java provided two ways of keeping a set of values in a collection: 1) Collection classes in the Java library. 2) Arrays. We're going to look at arrays now.
Fort Lewis - CSIS - 110
CSIS 110 - Lecture 30Reading: Appendix E (pages 432-434) Quiz Wednesday. Covers material up through last lecture. Main So far, we have only executed our java classes inside of BlueJ. What if we wanted to share a program with someone else? Let's run
Fort Lewis - CSIS - 110
CSIS 110 Lecture 5Quiz next Wednesday. Material in Chapters 1 and 2. Homework exercises 2.59 - 2.63 and 2.65 2.67 on pages 43 - 44. Due Friday. (also on course web site). Labs make sure your names are on them! Last Time We spent more time looki
Fort Lewis - CSIS - 360
CSIS 360 Lecture 20Last time on post-iteration reviews - Be careful not to turn it into a finger-pointing exercise! UML Today we are going to start looking at some elements of the Unified Modeling Language (UML). UML is frequently used to design an
Fort Lewis - CSIS - 190
CSIS 190 Lecture 20Announcements Networking / Security We've seen how we can use a network to send messages from one computer to another. What else do we need to worry about? What if the message contains sensitive information such as medical data or
Fort Lewis - CSIS - 190
CSIS 190 Lecture 36Announcements Exam? Homework on-line Read 10.4 and 10.6 Artificial Intelligence - Reasoning Last time we started looking at AI reasoning techniques. Many reasoning problems have common characteristics that allow them to be solved
Fort Lewis - CSIS - 190
CSIS 190 Lecture 4Let's revisit pseudo-code. Homework was disappointing. Why? - I wasn't clear - Reading book? Let's look at the pseudo-code elements from the book: Assignment Form: Name Expression Used to store the result of a computation. Allows
Fort Lewis - CSIS - 110
CSIS 110 - Lecture 32Announcements: Read: Chapter 6, sec 6.1 to 6.3. Testing When you work on your methods, does the code that you write work correctly the first time? What kinds of things are wrong? It doesn't compile you made a syntax error. For
Fort Lewis - CSIS - 110
CSIS 110 Lecture 7Quiz: Wednesday. Material in Chapters 1 and 2. Read: Chapter 3, section 3.1 to 3.11. Partner assignment sheets Quiz Review Go over review questions that I handed out last time. Last Time We looked at the NumberDisplay class: - Ab
Fort Lewis - CSIS - 190
CSIS 190 Lecture 13Announcements Exam Friday. Covers material up through last Friday. Read: 3.1 to 3.3. Operating SystemsQuickTime and a TIFF (LZW) decompressor are needed to see this picture.Applications Software programs that user's use to so
Fort Lewis - CSIS - 110
CSIS 110 - Lecture 21Announcements Quiz Wednesday. Covers material up through today. Turn in homework. Homework Read sections 5.1 5.4 (pages 119 136) Next Programming Assignment on web site read the assignment, we'll discuss it next time. Class S
Fort Lewis - CSIS - 110
CSIS 110 - Lecture 21Announcements: Read Chapter 5, sections 5.1 to 5.4. Let's discuss the programming assignment any questions? I have your midterm grades if you want them, or you can wait until next week to look them up on WebOpus. No class next
Fort Lewis - CSIS - 110
CSIS 110 Lecture 10Reading Assignment: Section 4.1 to 4.7. Potentially confusing. Read before Wednesday, and again after lecture. Last time: this keyword Debugger Open the mail project again. Create a server and two mail clients: One for Fred and o
GWU - CSCI - 195
#># #Y#e# #W#X#Y#Z#[#\#]#^#_#`#a#b#c#d# # # #2# # # # #.#/#0#1 #g#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_#`#a#b# c##d#e#f#s#L # #0"# # #"#+#%#(#)#*#&#%# %#'#'#z(#(#.)#+#*)#+)#,)#-)#+# #R# #dO#)#=#,#@# #P#i#c#t#u#r#e#s# #dP#P#o#w#e#r#P#o#i#n#t# #D#o#c#u#m#e#n#
GWU - CSCI - 195
THE GEORGE WASHINGTON UNIVERSITY SCHOOL OF ENGINEERING AND APPLIED SCIENCE DEPARTMENT OF COMPUTER SCIENCECSCI 195 SENIOR COMPUTER SCIENCE DESIGN PROJECTProf. Matthew M. BurkeCourse developed by: PROF. ARNOLD C. MELTZER Modifications by: PROF. ROB
GWU - CSCI - 143
blah
GWU - CSCI - 234
/* alternating bit - version with message loss */#define MAX3mtype = { msg0, msg1, ack0, ack1 };chansender =[1] of { byte };chanreceiver=[1] of { byte };proctype Sender(){byte any;again:do: receiver!msg1;if: sender?ack1 -> b
Fort Lewis - BA - 301
BA301 Management & Organization Behavior (MOB)Fall 2007Purpose/Mission"Management and Organization Behavior" is a study of the principles, practices, and processes of administration:the organization of a system the behavior of people in the orga
Fort Lewis - BA - 301
BA301: Management and Organization Behavior (MOB) Fall 2007 Composition and Computation of GradesFINAL GRADE COMPOSIT ION: EXAMSIND IV I D UA L ELEMEN TS:POINTS: EXAM #1: Part 1 (Chapters 1-3) EXAM #2: Part 2 (Chapters 4-7) EXAM #3: Part 3 (Cha
Niagara University - CIS - 233
Which hypothesis testing method to use? Binomial test: one sample, one variable with exactly two possible values, and a population mean or hypothesis mean (sample mean, null hypothesis) Example: physician. Sample size: 10, variable: was the patient c
Rutgers - CS - 519
Introduction & Architecture RefresherCS 519: Operating System Theory Computer Science, Rutgers University Instructor: Thu D. Nguyen TA: Xiaoyan Li Spring 2002LogisticsInstructor: Thu D. Nguyen Office: CoRE 326 Office Hours: TDB TA: Xiaoyan Li Off
Rutgers - CS - 416
Recitation 6Virtual Memory Sample Questions Project 3 Build Pthread Lib Extra Office Hour: Wed 4pm-5pm HILL 3671Memory HierarchyVirtual Memory Memory Cache RegistersAnswer: Pretend we had something bigger => Virtual Memory2Memory Access C
Rutgers - CS - 352
1. Switching Considering a small network of four hosts and three links as depicted in the figure below. A 1MB message is to be sent from A to D. The bandwidth of links is 0.8 Mbyte/second. Propagation delays of the links are negligible. Host A Hos
Rutgers - CS - 416
HW#2 Solutions Problem 1 The "degree of multiprogramming" is the maximum number of processes that may be supported by a uniprocessor at any given time. Discuss some factors that must be considered in determining the degree of multiprogramming for a p
Rutgers - CS - 352
import java.io.*;import java.net.*;public class Client{public static void main(String[] args){/loop until you leave a line blank.while(true){/ Create a socket to communicate to the specified host and portSocket s = null;try{
Rutgers - CS - 352
import java.io.*;import java.net.*;public class Server{public static void main(String[] args){ServerSocket listen_socket = null;/Create the listening Socket. /Notice the cast of the String to an Integer, ServerSocket requires the po
Rutgers - CS - 205
Oeters 1 1Gary Oeters CS205 Discrete Structures Section 7 Stephen Max 3/10/2003 Project I In this project, I will determine for which directions four implications of predicate logic hold true. In other words, the goal of the assignment is to deter
Rutgers - CS - 352
PROJECT 1 Use Ethereal to debug & figure out the Bittorent protocol o Install Ethereal at your machine o Run Ethereal to capture packets. o Run a Bittorent client at your machine and try to download the file corresponding the project1.torrent o Lear
Rutgers - CS - 417
Distributed Bank Implementation=Design and implement the client and server code for a simple, distributed banking servicethat permits multiple concurrent operations while providing ACID semantics to the clients.The banking service will be able t
Rutgers - CS - 416
Program Structure- header files, source files. .h .c- .c and .h files can #include .h filesPreprocessor and conditional compilation#include"a.h"look in current directory first, then /usr/include#include<a.h>look in /usr/include first- ma
Rutgers - CS - 442
Summary of GDB commands for x86-64 Systems Command EffectStarting and stopping quit Exit gdb run Run your program run <command line args> Run your program using the specific c
Rutgers - CS - 170
Do Loop=do{put here the statements you want to loop on(they will be executed at least once)}while(condition)Example:=var a;do{a = confirm("Repeat?");} while(a =true)
Rutgers - CS - 519
Protection and SecurityCS 519: Operating System Theory Computer Science, Rutgers University Instructor: Thu D. Nguyen TA: Xiaoyan Li Spring 2002ProtectionWe have talked briefly about protection in the context of file management Main concepts: Acc
Rutgers - CS - 519
C S duling PU cheC 519: Ope S rating S mThe yste ory C pute S nce Rutge Unive om r cie , rs rsity I nstructor: Thu D. Nguye n TA: Xiaoyan Li S pring 2002What and Why?What is proce sche ssor duling? Why? At first to sharean e nsivere xpe source m