Title: Getting Started
1Getting Started
- You were supposed to
- Read Chapter 1
- Read the syllabus
- Any questions?
2What was chapter 1 about?
3The Software Life Cycle
- Preparation required before writing code
- Specify the problem
- Design the overall structure of the solution
- Select and analyze algorithms and data structures
- After work completed
- Testing
- Documentation
- Support
- Maintenance
4The Software Life Cycle (continued)
- No universal agreement on exact steps in software
development - Software life cycle
- Problem specification
- Program design
- Selection of algorithms and data structures
- Coding and debugging
- Testing and verification
- Documentation and support
- Maintenance
5The Software Life Cycle (continued)
6Problem Specifications
- Problem specification phase
- Complete, accurate, unambiguous statement of
exact problem - Solve a problem correctly solve the correct
problem - List inputs provided to the program
- For each input, list what outputs the program
produces - Problem specification document is an input/output
document
7Problem Specifications (continued)
8Problem Specifications (continued)
- Problem statement completed through meetings and
interviews - Document contains information about
- Delivery date
- Budget constraints
- Performance requirements
- Acceptance criteria
- Software requirements document is a contract
between user and developer
9Challenges with the Problem Specifications
- Significant errors caused by incomplete,
inaccurate, ambiguous specifications - People specifying the problem may be inaccurate,
or change their mind
10Problem Specifications (continued)
- Rapid prototyping helps users decide what they
want - Developer constructs a model of the software
- Simulates look and feel
- Little or no functionality
11Problem Specifications (continued)
- Developers must include description of programs
behavior for every possible input - Computer programs have no common sense
- Describe software behavior for all inputs, even
if unexpected - Majority of specification document describes
responses to unusual, unexpected, illegal inputs - More realistic diagram of a problem specification
12Problem Specifications (continued)
13Challenges with the Problem Specifications
- Significant errors caused by incomplete,
inaccurate, ambiguous specifications - People specifying the problem may be inaccurate,
or change their mind - Natural language is poor notation for accurate
specifications - Language has multiple meanings, differences in
interpretation - Having said that, its almost universally used
14Problem Specifications (continued)
- Formal specification languages more precise
- More difficult to read and interpret
- UML (Unified Modeling Language) visually diagrams
relationships and dependencies - What we will start looking at for the next session
15Software Design
- Follows completion of specification document
- Specify an integrated set of software components
- Component is a separately compiled program unit
- Function, procedure, class, template, package,
interface - Organizes and manages coding task
- Divide-and-conquer large problem divided into
smaller, simpler subproblems
16Software Design (continued)
- For each component, specify three items
- Interface
- Preconditions
- Postconditions
- Software design document component
specifications and their relationships - If all preconditions are true, the program unit
guarantees postconditions will be true
17Software Design (continued)
- Top-down design decomposes problem functionally
- Difficult to modify many program units need
details of data structures - Object-oriented design decomposes software by
the entities in the problem - Class models each entity in the problem
- Object instance of a class
- Methods operations an object can perform
- Information exchanged between objects via method
calls
18Software Design (continued)
19Software Design (continued)
20Algorithms and Data Structures
- Select data structures and choose algorithms
before coding - Efficiency influenced most by algorithms and data
structures - Efficient algorithm remains efficient even if
poorly coded - Inefficient algorithms cannot be made efficient
by clever programming or machine speed
21Coding and Debugging
- Coding is the software development phase covered
in the first courses in computer science - Java created as a platform-independent
environment to control embedded systems - Used for applets embedded in Web pages
- Supports object-oriented design
- Standard classes provide useful services
- Software productivity the amount of correct
code produced by a programmer
22Coding and Debugging (continued)
- Software reuse using software that already
exists - Java class library
- Java 1.5 has 166 packages, 3279 classes
- Java contains features vital to modern software
development
23Exceptions and Streams
- Exception handling is a way to handle errors,
failures during program execution - Java has classes for handling network and file
input/output in many formats - Lets the programmer view information as
- Binary or character streams
- Buffered or unbuffered
24Threads
- Thread a program unit in execution
- Multithreading more than one thread executing
at the same time - When each thread executes on a separate
processor, they are said to be executing in
parallel - Concurrent processing threads take turns
- Threading operations located in the
java.lang.Thread class
25Graphical User Interfaces
- Graphical user interface (GUI) interacts with
users - Users create visual features such as windows,
buttons, text fields, labels, choice boxes, etc. - Routines control placement, size, color of
components - Abstract Windowing Toolkit located in the package
java.awt - Swing package has additional visual components
26Graphical User Interfaces (continued)
27 Networking
- Most programs work in tandem with a computer
network - E-mail, file transfer, Web browsers
- Distributed databases, dynamic Web pages, chat
rooms, remote sensing, etc. - Java package java.net allows users to develop
client/server network applications - Uses TCP/IP and UDP network protocols
- Classes are easy to explain and understand
- Security is essential to networking packages
28Testing and Verification
- Program verification formally proves the
correctness of a program - Develop correctness proof as you write the code
- Difficult and time consuming
- Not widely used
- Empirical testing demonstrates correctness with
carefully chosen test data - Unit testing test each program unit on
carefully chosen data
29Testing and Verification (continued)
- Flow path test every execution sequence through
a program unit - Virtually infinite number of flow paths
- Exhaustive testing usually impossible
- Verify every statement executed at least once
- Integration testing test the correctness of
routines working together - Usually proceeds from the bottom up
30Testing and Verification (continued)
- Clear box testing look inside the code to
decide what test cases are needed - Also called alpha testing
- Black box testing put the program in a
realistic environment and run it - Also called beta testing, acceptance testing
- Data related to actual user operations
- If beta tests show the program operates
correctly, problem specification has been met - Program can be delivered to the user
31Documentation and Support
- User documentation complete users manual
- May include online documentation
- Users expect extensive support environment
- Phone, e-mail support, Web site
- Downloadable upgrades and patches
- Technical documentation
- Problem specification document
- Program design document
- Description of algorithms and data structures
- Program listing with inline comments
- Description of testing and acceptance procedures
32Documentation and Support (continued)
- Javadoc comment placed between / and / in the
program code - Comments contain tags that provide information
about the program unit - Four common javadoc tags
- _at_author name
- _at_version text
- _at_param name description
- _at_return description
33Program Maintenance
- Program maintenance adapts the software to
maintain correctness - Stays current with changing specifications and
new equipment - Implies software life cycle repeated more than
once - Maintenance easier if program well designed from
the start
34Summary
- Much more to programming than coding
- Time spent on implementation relatively small
compared to preparatory work - Over 5- to 15-year life of software, great deal
of time and money will be spent on maintenance - Software development is extremely complex
- Do not equate software development with coding
35Summary (continued)
- Coding preceded by preparatory work clarifying
and specifying the solution - Coding followed by testing, verifying, measuring,
and documenting - Software engineering refers to systematic
approach to software development
36Summary (continued)