CS 160: Software Engineering October 15 Class Meeting

Slides:



Advertisements
Similar presentations
CS 160: Software Engineering September 8 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Advertisements

Instant Messaging Questions welcome after session.
The Sherlock Project Purdue University, Department of Computer Sciences Sponsored by Tellabs, Inc. Doug Clark - Group Leader Tobey Pasheilich Raj Talwar.
CS 185C/286: The History of Computing October 31 Class Meeting Department of Computer Science San Jose State University Fall 2011 Instructor: Ron Mak
Management 421 Computer Science 350. Overview Project Roles Software Development Process Extreme Programming Management/Developer Interaction in Extreme.
CS 153: Concepts of Compiler Design August 25 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
UML exam advice. Minimal, yet sufficient UML course 80% of modeling can be done with 20% of the UML. Which 20% was that again? We’re supposed to be “Use.
CS 235: User Interface Design January 22 Class Meeting
CS 160: Software Engineering August 25 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 160: Software Engineering August 27 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 160: Software Engineering October 20 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 235: User Interface Design August 27 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
CS 235: User Interface Design August 27 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 46B: Introduction to Data Structures July 30 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak.
Roles Managers Technical Team Leaders Programmers Customers Database Administrators Instructors.
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
CS 46B: Introduction to Data Structures July 7 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
University of Palestine Faculty of Engineering and Urban planning Software Engineering department Software Engineering Group Project Requirements Project.
CS 160: Software Engineering October 8 Class Meeting
CS 235: User Interface Design August 25 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 160: Software Engineering September 10 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 157B: Database Management Systems II April 29 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
CS 174: Web Programming September 23 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 174: Web Programming September 21 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 157B: Database Management Systems II February 6 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
CS 46B: Introduction to Data Structures June 16 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak.
(Chapter 10 continued) Our examples feature MySQL as the database engine. It's open source and free. It's fully featured. And it's platform independent.
CS 157B: Database Management Systems II January 28 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
CS 46B: Introduction to Data Structures July 9 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
CS 235: User Interface Design September 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 160: Software Engineering October 1 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
JDBC Java and Databases. RHS – SOC 2 JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
CS 160: Software Engineering October 6 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Chapter 8 Databases.
CPSC 121: Models of Computation Unit 0 Introduction George Tsiknis Based on slides by Patrice Belleville and Steve Wolfman.
MSE Presentation 1 By Padmaja Havaldar- Graduate Student Under the guidance of Dr. Daniel Andresen – Major Advisor Dr. Scott Deloach-Committee Member Dr.
CS 151: Object-Oriented Design September 26 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 153: Concepts of Compiler Design August 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 235: User Interface Design September 3 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Ashley Montebello – CprE Katie Githens – SE Wayne Rowcliffe – SE Advisor/Client: Akhilesh Tyagi.
CS 160: Software Engineering September 3 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Courselist Project Automated Graduate Student Information System Final project for CS 3354.
CS 157B: Database Management Systems II April 3 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
CS 151: Object-Oriented Design September 12 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 151: Object-Oriented Design August 27 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 160: Software Engineering October 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Class Scheduler Team Members Bernard Battle Jerad Blake James Knoch Chris Louallen Lenora Pride.
CS 151: Object-Oriented Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 174: Web Programming October 14 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 151: Object-Oriented Design August 29 Class Meeting Department of Computer Science San Jose State University Spring 2012 Instructor: Ron Mak
CS 46B: Introduction to Data Structures June 30 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak.
CS 174: Web Programming November 2 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 146: Data Structures and Algorithms June 11 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
CS 160 and CMPE/SE 131 Software Engineering February 18 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
Intro to JDBC Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL.
1 Management Information Systems M Agung Ali Fikri, SE. MM.
CS 160 and CMPE/SE 131 Software Engineering March 22 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
CS 160 and CMPE/SE 131 Software Engineering March 15 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
CS 160 and CMPE/SE 131 Software Engineering May 12 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
CS 160 and CMPE/SE 131 Software Engineering March 24 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
CS 157B: Database Management Systems II January 23 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
CS320 Web and Internet Programming Database Access with JDBC Chengyu Sun California State University, Los Angeles.
CMPE 280 Web UI Design and Development August 29 Class Meeting
Using a Database with JDBC
CMPE/SE 131 Software Engineering March 9 Class Meeting
CMPE/SE 131 Software Engineering March 23 Class Meeting
CMPE/SE 131 Software Engineering March 7 Class Meeting
CS 151: Object-Oriented Design October 8 Class Meeting
Presentation transcript:

CS 160: Software Engineering October 15 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak www.cs.sjsu.edu/~mak

Midterm Question 1 Briefly discuss how each of the following software engineering techniques, technologies, and methodologies deal with the challenges of complexity and change. Model-view-controller (MVC) architecture complexity Break a GUI application into three coherent, loosely-coupled parts. Enable parallel development. change Changes to one part won’t affect the other parts.

Midterm Question 1, cont’d Agile programming complexity Break development into multiple short iterations. Each iteration has design, code, and test. Always build on already working code. change Not the old waterfall model. Able to handle design and requirements changes.

Midterm Question 1, cont’d Client-server architecture complexity Break a web application into three coherent, loosely-coupled parts. Enable parallel development. change Changes to one part won’t affect the other parts.

Midterm Question 1, cont’d Data access layer complexity Encapsulate database connection, JDBC, etc. from the rest of the application. Object-relational mapping. change Isolate changes in the application code and in the database structure from each other.

Midterm Question 1, cont’d Database table normalization complexity Eliminate multi-valued fields, repeating fields. Make tables coherent. change Easier to modify tables via insert, delete, and update operations.

Midterm Question 2 You are going to develop a new version of the online class registration system that you use to sign up for classes each semester. List seven (7) functional requirements. Students shall log in securely with their student IDs. System shall access the SJSU courses database. Administrator shall be able to add, delete, modify classes. Students shall add and drop displayed classes. System shall check course prerequisites. System shall check for time conflicts. System shall maintain wait lists.

Midterm Question 2, cont’d List three (3) nonfunctional requirements. System shall be web-based. System shall be secure from hackers. System shall respond within 1 second.

Midterm Question 2, cont’d Draw a UML use case diagram that shows at least two (2) actors and five (5) use cases. Start up system Shut down system Update classes Add class Drop class admin database student

Midterm Question 3 You are going to use Java on the server to implement the class registration system in Question 2. Briefly name and describe three (3) servlets. LogInStudent Log in a student securely using the student’s ID. AddClass Student adds a class. DropClass Student drops a class.

Midterm Question 3, cont’d Briefly name and describe three (3) JSPs. LogInPage Displays the log in form. ClassListPage Display the list of classes the student can choose from. SchedulePage Display a student’s class schedule.

Midterm Question 3, cont’d Briefly name and describe four (4) JavaBeans. Class A class that a student can take. A prerequisite class Student A student. Admin An administrator. Schedule A student’s class schedule

Midterm Question 4 Our example school database needs to support team teaching, where more than one instructor can teach a class. Draw an ER diagram. PK FK FK FK PK PK PK FK FK FK

Midterm Question 4, cont’d Write the Java method that uses JDBC and prints the results of the query: CommonClasses(int teacherId_1, int teacherId_2) Given two teachers, which classes do they teach in common?

Midterm Question 4, cont’d The 10-point description: We can assume the method can be called multiple times, so we should use a prepared statement. The prepared statement uses a teacher ID to make the query that returns the classes taught by that teacher. We can also assume that we’ve already defined a Klass JavaBean to represent a class, and we’ll use object-relational mapping to put the returned Klass objects into an array list. We’ll use the prepared statement to generate two array lists of Klass objects, one array per teacher. Then we’ll use Java to find and print the common classes.

Midterm Question 4, cont’d The 15-point solution: private static String CLASSES_OF = "SELECT code, subject " + "FROM class, teacher_class " + "WHERE teacher_id = ? " + "AND code = class_code”; private static Connection conn; private static PreparedStatement ps1; … conn = DriverManager.getConnection (DB_URL, USERNAME, PASSWORD); ps1 = conn.prepareStatement(CLASSES_OF);

Midterm Question 4, cont’d private static ArrayList<Klass> classesOf(int id) throws SQLException { ArrayList<Klass> klasses = new ArrayList<>(); ps1.setInt(1, id); ResultSet rs = ps1.executeQuery(); while (rs.next()) { Klass klass = new Klass(rs.getInt("code"), rs.getString("subject")); klasses.add(klass); } return klasses; Object-relational mapping. Return an array list of classes taught by the teacher.

Midterm Question 4, cont’d private static void commonClasses1(int teacherId_1, int teacherId_2) throws SQLException { ArrayList<Klass> klasses_1 = classesOf(teacherId_1); ArrayList<Klass> klasses_2 = classesOf(teacherId_2); ArrayList<Klass> common = new ArrayList<>(); for (Klass k1 : klasses_1) { for (Klass k2 : klasses_2) { if (k1.getCode() == k2.getCode()) { common.add(k1); } printCommon(common, teacherId_1, teacherId_2); Array list of common classes.

Midterm Question 4, cont’d An alternate solution Requires a bit more advanced SQL. private static String COMMON_CLASSES = "SELECT code, subject " + "FROM teacher_class tc1, teacher_class tc2, class " + "WHERE tc1.teacher_id = ? AND tc2.teacher_id = ? " + "AND tc1.class_code = tc2.class_code " + "AND tc1.class_code = class.code " + "ORDER BY class.code"; private static PreparedStatement ps2; … ps2 = conn.prepareStatement(COMMON_CLASSES);

Midterm Question 4, cont’d private static void commonClasses2(int teacherId_1, int teacherId_2) throws SQLException { ps2.setInt(1, teacherId_1); ps2.setInt(2, teacherId_2); ResultSet rs = ps2.executeQuery(); ArrayList<Klass> common = new ArrayList<>(); while (rs.next()) { Klass klass = new Klass(rs.getInt("code"), rs.getString("subject")); common.add(klass); } printCommon(common, teacherId_1, teacherId_2); Array list of common classes.

Managing Expectations Estimation How long will tasks take, or how many resources will they consume. Should be an unbiased, analytical process. Goal is accuracy, not to seek a particular result. Project planning A biased, goal-seeking process. Goal is to achieve specific outcomes. _

Managing Expectations, cont’d Estimates form the foundation for plans. But plans don’t have to be the same as estimates. Combining estimating and planning activities leads to bad estimates and poor plans. A large gap between estimates and planning targets results in a high risk project. _

Estimates, Targets, and Commitments An all-too-familiar scenario: Product manager: We need to demo these features at a trade show in 3 months. [target] How long will it take? Project lead: I estimate it will us take 5 months. Manager: Wrong answer! Try again. Lead: OK, in 3 months, we can have the highest priority features done. [commitment] Moral: When you’re asked for an estimate, determine whether you’re really being told to make a commitment to meet a target.

Primary Purpose of Software Estimation Determine whether a project’s targets are realistic enough to allow the project to be controlled to meet them. Good estimates are usually possible if the initial targets and the initial estimates are within 20% of each other. _

“Good” Estimates Estimates don’t need to be perfectly accurate as much as they need to be useful. “A good estimate is an estimate that provides a clear enough view of the project reality to allow the project leadership to make good decisions about how to control the project to hit its targets.” Steve McConnell, Software Estimation

Time Unit Inflation of Estimates Time unit inflation: hours → days → weeks → months → years “It should take me two hours to do this.” Reality: It will take two days. _

Estimation Techniques Complex mathematical formulas Best for the very largest projects. Done by professional estimators. History and analogy How long did similar tasks take in the past? Expert opinions But do you have similar skills as the experts?

Estimation Techniques Off-the-cuff “guesstimates” Based on personal experience. The smaller the task, the more accurate the estimate. _