Java: Learning to Program with Robots. Chapter 11: Building Quality Software



Similar documents
(Refer Slide Time: 01:52)

Java Application Developer Certificate Program Competencies

Fourth generation techniques (4GT)

Agile Development and Testing Practices highlighted by the case studies as being particularly valuable from a software quality perspective

DATA RECOVERY SOLUTIONS EXPERT DATA RECOVERY SOLUTIONS FOR ALL DATA LOSS SCENARIOS.

Announcements. Project status demo in class

D6 INFORMATION SYSTEMS DEVELOPMENT. SOLUTIONS & MARKING SCHEME. June 2013

In the IEEE Standard Glossary of Software Engineering Terminology the Software Life Cycle is:

Test-Driven Development

Engineering Process Software Qualities Software Architectural Design

Software development life cycle. Software Engineering - II ITNP92 - Object Oriented Software Design. Requirements. Requirements. Dr Andrea Bracciali

What is a life cycle model?

The Rules 1. One level of indentation per method 2. Don t use the ELSE keyword 3. Wrap all primitives and Strings

Programming and Software Development (PSD)

Taxi Service Coding Policy. Version 1.2

Xtreme RUP. Ne t BJECTIVES. Lightening Up the Rational Unified Process. 2/9/2001 Copyright 2001 Net Objectives 1. Agenda

Testing Rails. by Josh Steiner. thoughtbot

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

Development Methodologies

Software Design. Software Design. Software design is the process that adds implementation details to the requirements.

CSC408H Lecture Notes

Efficient BPMN: from Anti-Patterns to Best Practices

(Refer Slide Time 00:56)

Week 2 Practical Objects and Turtles

Use Case Modeling. Software Development Life Cycle Training. Use Case Modeling. Set A: Requirements Analysis Part 3: Use Case Modeling

Software Process for QA

Agile Modeling: A Brief Overview

Computing Concepts with Java Essentials

Karunya University Dept. of Information Technology

An Easier Way for Cross-Platform Data Acquisition Application Development

The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0

Programming and Software Development CTAG Alignments

SOFTWARE PROCESS MODELS

EVALUATING METRICS AT CLASS AND METHOD LEVEL FOR JAVA PROGRAMS USING KNOWLEDGE BASED SYSTEMS

CS314: Course Summary

Object-Oriented Design. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C.

Axiomatic design of software systems

11.1 What is Project Management? Object-Oriented Software Engineering Practical Software Development using UML and Java. What is Project Management?

AP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities

SOFTWARE DESIGN TECHNIQUES. Nagalaxmi Telkar CSCI 5828 Presentation Slides

Outline. Lecture 13: Web Usability. Top Ten Web Design Mistakes. Web Usability Principles Usability Evaluations

Object Oriented Analysis and Design and Software Development Process Phases

Agile.NET Development Test-driven Development using NUnit

by Pearson Education, Inc. All Rights Reserved.

Software Service Engineering Architect s Dream or Developer s Nightmare?

VISION FOR LEARNING AND DEVELOPMENT

So we thought we knew money

eclips Design Packet Middle School and High School NASA Real World: Mathematics (Grades 6-8) NASA Launchpad (Grades 9-12) Educational Product

Object Classes: Notes on designing Shopping Cart

4. Multiagent Sys stems Design. Part 2: The PROMETHEUS methodology.

COURSE CODE : 4072 COURSE CATEGORY : A PERIODS / WEEK : 4 PERIODS / SEMESTER : 72 CREDITS : 4

PROJECT REPORT ON PAYROLL SYSTEM

1 INTRODUCTION TO SYSTEM ANALYSIS AND DESIGN

Transitioning Your Software Process To Agile Jeffery Payne Chief Executive Officer Coveros, Inc.

Software Life Cycle. Management of what to do in what order

Chapter 8 Approaches to System Development

Use Cases. Massimo Felici. Massimo Felici Use Cases c

Software Design. Design (I) Software Design Data Design. Relationships between the Analysis Model and the Design Model

Intro to Human Centered Service Design Thinking

Crime Scene Search and Processing

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Software Requirements Specification

Requirements Analysis Concepts & Principles. Instructor: Dr. Jerry Gao

Refactoring BPMN Models: From Bad Smells to Best Practices and Patterns

CHAPTER 11 REQUIREMENTS

10.1 Determining What the Client Needs. Determining What the Client Needs (contd) Determining What the Client Needs (contd)

AT&T MERLIN COMMUNICATIONS SYSTEM ADMINISTRATION MANUAL: MODELS 206 AND 410 WITH FEATURE PACKAGE 1

Data Flow Diagrams. Outline. Some Rules for External Entities 1/25/2010. Mechanics

COMPARISON OF OBJECT-ORIENTED AND PROCEDURE-BASED COMPUTER LANGUAGES: CASE STUDY OF C++ PROGRAMMING

Bob Kibbee, Map & GIS Librarian, Olin Library, rk14@cornell.edu

How To Develop Software

Object-oriented design methodologies

So today we shall continue our discussion on the search engines and web crawlers. (Refer Slide Time: 01:02)

THE SOFTWARE DEVELOPMENT LIFE CYCLE *The following was adapted from Glencoe s Introduction to Computer Science Using Java

System Design Approaches. System Design. Model-Driven Approaches Modern Structured Design. Model-Driven Approaches

Guideline for stresstest Page 1 of 6. Stress test

Examen Software Engineering /09/2011

Architectural Patterns (3)

Agile Business Process Automation

Application Of Business Intelligence In Agriculture 2020 System to Improve Efficiency And Support Decision Making in Investments.

Financial Management System

Basic Trends of Modern Software Development

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

Java (12 Weeks) Introduction to Java Programming Language

Introduction to Programming System Design. CSCI 455x (4 Units)

Bottlenecks in Agile Software Development Identified Using Theory of Constraints (TOC) Principles

Introduction. Introduction. Software Engineering. Software Engineering. Software Process. Department of Computer Science 1

Requirements engineering

Masters of Science in Software & Information Systems

Transcription:

Java: Learning to Program with Robots Chapter 11: Building Quality Software

Chapter Objectives After studying this chapter, you should be able to: Identify characteristics of quality software, both from the users and programmers perspectives Follow a development process that promotes quality as you develop your programs Avoid common pitfalls in designing object-oriented programs Include defensive programming measures to make errors more likely to expose themselves so they can be fixed Explain characteristics of quality user interfaces and describe an iterative methodology for developing them

11.2: Using a Development Environment Define the Requirements Describe the desired system Refine the Design Refine requirements Add new scenarios Walk through new scenarios Design the Architecture Identify classes and methods Create CRC cards List scenarios Walk through scenarios Develop a class diagram Evaluate with Users Choose a Set of Scenarios Implement the Scenarios Choose one scenario Write tests for that scenario Write code to pass tests Refactor Requirements: What the program must do. Architecture: A description of the most important classes and how they relate to each other. Scenario: A specific task a user may want to perform with the program.

Case Study 1: Defining Requirements (1/2) A program is required to help with selling tickets in a concert hall. The program must show a list of upcoming concerts and a list of existing patrons. New concerts may be added to the list of concerts. Concerts may also be deleted. Similarly, patrons may be added to or deleted from the list of patrons. When a particular concert is identified, the program must display the tickets that are still available for that concert. The user should then be able to select a patron from the patron list and one or more tickets to sell to the patron. A patron s past ticket purchases are kept for marketing purposes. Tickets are divided into three groups for pricing. Gold is the most expensive, followed by Silver, and finally Bronze. When a concert is entered into the system, the prices for Gold, Silver, and Bronze tickets are specified. Tickets are labeled with numbers for rows (1 15) and letters for seats (A T). Information must be saved in a file so the program can be stopped and restarted. A possible user interface is sketched on the next slide.

Case Study 1: Defining Requirements (2/2)

Case Study 1: Designing the Architecture Designing the architecture consists of five tasks: Identify the most important classes and methods for the program using an analysis of the nouns and verbs in the requirements. Summarize the responsibilities and collaborators for each class on index cards. List scenarios in which the software will be used. Walk through the scenarios using the index cards to further develop the responsibilities and collaborators. Develop a class diagram based on the responsibilities and collaborators listed on the index cards. The result is a class diagram used to guide implementation.

CS1: Identify Classes and Methods The program sells tickets. The program shows a list of upcoming concerts. The program shows a list of existing patrons. The program adds new concerts (to the list of concerts). The program adds patrons (to the list of patrons). The (user, patron?) identifies a concert. The program displays available tickets (for an identified concert). The user selects a patron from the patron list. The user selects one or more tickets. A patron has past ticket purchases (kept for marketing purposes). Tickets have a price group (Gold, Silver, Bronze). Concerts have prices for Gold, Silver, and Bronze tickets. Tickets have a row number (1..15). Tickets have a seat letter (A..T). The program saves information to a file.

CS 1: Create CRC Cards CRC (Class-Responsibilities-Collaborators) Cards are usually 4 x6 index cards summarize one class s responsibilities and collaborators are an inexpensive (in materials and time to develop) precursor to the class diagram ConcertHall Responsibilities Collaborators sell tickets ConcertList add a concert to list of concerts PatronList add a patron to list of patrons save information to a file

11.2.3: Iterative Development Define the Requirements Describe the desired system Refine the Design Refine requirements Add new scenarios Walk through new scenario s Design the Architecture Identify classes and methods Create CRC cards List scenarios Walk through scenarios Develop a class diagram Choose a Set of Scenarios Implement the Scenarios Evaluate with Users Choose one scenario Write tests for that scenario Write code to pass tests Refactor

11.3.1: Rules of Thumb for Quality Code Document classes and methods. Avoid nested loops. Keep methods short. Make helper methods private. Put duplicated code in a helper method. Make instance variables private. Write powerful constructors. Keep data and processing together. Write immutable classes. Delegate work to helper classes.

11.3.2: Managing Complexity (1/2) Many of these rules of thumb (heuristics) relate to four features that have been long recognized as crucial to quality code: Encapsulation: Grouping data and related services into a class. Cohesion: The extent to which each class models a single, welldefined abstraction and each method implements a single, welldefined task. Information Hiding: Hiding and protecting the details of a class s operation from others. Coupling: The extent to which interactions and dependencies between classes are minimized. Instance variable detail Interaction Method detail

11.3.2: Managing Complexity (2/2)

11.3.2: Encapsulation

11.3.2: Cohesion

11.3.2: Information Hiding

11.3.2: Coupling

11.4: Programming Defensively Exceptions Immediately alert programmers to things that have gone wrong, including helpful information for debugging the program. Design by Contract Write down exactly what a method expects of its caller and what it will do in return (a contract for the method). Assertions Specify what should be true at critical points in your code. To the extent that it s possible, check that the assertions actually are true. If they aren t, throw an exception.

Case Study 2: Refactoring a Program The Pharmacy program is poorly written and ignores many of the rules of thumb discussed earlier. As a result, its encapsulation, cohesion, information hiding, and coupling are all very poor. Refactor the program. Refactoring does not change the program s functionality. It changes its internal structure so that it has higher quality from a programmer s perspective.

User Testing and Evaluation Design Prototyping 11.5.1: Iterative User Interface Design (1/2)

11.5.1: Iterative User Interface Design (2/2) The five E s of User Interface Evaluation: Effective: The completeness and accuracy with which users achieve their goals. Efficient: The speed and accuracy with which users can complete their tasks. Engaging: The degree to which the tone and style of the interface makes the product pleasant or satisfying to use. Error Tolerant: How well the design prevents errors or helps with recovery from those that do occur. Easy to Learn: How well the product supports both initial orientation and deepening understanding of its capabilities.

11.5.2: User Interface Design Principles Well-designed user interfaces are: Controlled by the user: Give the user as much control over the process as is consistent with the user s knowledge and skill level. Responsive: Give the users constant feedback, and give it fast enough so the user can work at full speed without waiting for the computer. Understandable: Some of the techniques for understandable interfaces include consistency, good visual structure, and information recognition rather than recall. Forgiving: Prevent as many mistakes as possible; make it easy to correct the mistakes that do happen.

Concept Map is enhanced by using an iterative development process software quality repeatedly defines designs nouns and verbs implements and evaluates scenarios requirements the architecture walk thro ughs is improved by use help discover refine CRC cards defines record important classes and methods classes, responsibilities and collaborators encapsulation is improved by can be evaluated from proactively responding to exceptions weak coupling high cohesion information hiding can be evaluated from a user's perspective a programmer's perspective of quality includes includes includes testable programs understandable programs maintainable programs

Summary We have learned: that software quality involves understandability, testability, and maintainability. that a development process featuring iteration helps lead to quality software. how to use the specification s nouns and verbs to design a program. how to create CRC cards and use them in a walk-through. rules of thumb that provide guidance in implementing quality software. that strong encapsulation, high cohesion, information hiding, and weak coupling help manage software complexity. how to use exceptions, assertions, and design by contract. that iteration, prototyping, and evaluation have strong roles in developing quality user interfaces.