Download presentation
Presentation is loading. Please wait.
Published byBlanche Helen Hutchinson Modified over 9 years ago
1
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance
2
2 Problem Analysis and Specification Computer Science programming assignment - specific statement of problem quantitative description clearly defined requirements: input, output, calculations, test data Computer Science programming assignment - specific statement of problem quantitative description clearly defined requirements: input, output, calculations, test data Easy in CS courses, not always in the real world.
3
3 Problem Analysis and Specification “Real World” request - general statement of problem qualitative not quantitative precision missing for input, output, processing “Real World” request - general statement of problem qualitative not quantitative precision missing for input, output, processing
4
4 Statement of specifications the formal statement of the problem’s requirements the major reference document a benchmark used to evaluate the final system The program should display on the screen a prompt for an amount to be depreciated and the number of years over which it is to be depreciated. If should then read these two values from the keyboard. Once it has the amount and the number of years, it should compute the sum of the integers 1, 2,... up to the number of years. It should then display on the screen a table with appropriate headings that shows the year number and the number and the depreciation for that year, for the specified number of years. Sometimes stated precisely using a formal method.
5
5 Design CS courses –small systems few hundred lines of code simple, straightforward self-contained “Real” world –large systems thousands of lines of code complex many components
6
6 OCD: Object-Centered Design 1. Identify the ____________ in the problem's specification and their types. 2. Identify the _____________ needed to solve the problem. 3. Arrange the operations in a sequence of steps, called an ____________________, which, when applied to the objects, will solve the problem.
7
7 Algorithm May be written in pseudocode Characteristics of steps (instructions), see pg 9: –Definite and unambiguous –Simple –Finite Difference between correctness and efficiency, see pp 7-8 –________ — grows linearly with size (n) of the input –________ — is constant, i.e. independent of size of input Should be well-structured Data Types Can't separate data structures and algorithms Algorithms + Data Structures = Programs
8
8 Algorithm (Structured Version) / * Algorithm to read and count several triples of distinct numbers and print the largest number in each triple. * / 1. Initialize count to 0. 2. Read the first triple of numbers x, y, z. 3. While x is not the end-of-data-flag do the following: a. Increment count by 1. b. If x > y and x > z then display x. Else if y > x and y > z then display y Else display z. c. Read the next triple x, y, z. 4. Display count.
9
9 Implementation (Coding) Select ________________________________ Encode the ______________ Verify ______________ –combining program units into a complete software system. Insure ______________ –programs must be correct, readable, and understandable –well-structured, documented, stylistic (see guidelines on pp. 15-18) Why? See p. 15
10
10 Testing, Execution, and Debugging –_________________: "Are we building the right product?" check that documents, program modules, etc. match the customer's requirements. –_________________: "Are we building the product right?" check that products are correct, complete, consistent with each other and with those of the preceding phases.
11
11 Errors may occur in any of the phases –Specifications don't accurately reflect given information or the user's needs/requests –Logic errors in algorithms –Incorrect coding or integration –Failure to handle boundary data or test values
12
12 Different kinds of tests required –______________: Each individual program unit works? –Program components tested in isolation – ______________: Units combined correctly? –Component interface and information flow tested –______________: Overall system works correctly?
13
13 The "V" Life Cycle Model
14
14 Unit testing –probably the most rigorous and time-intenstive –surely the most fundamental and important –kinds of errors tested: —
15
15 Black box or functional test Program unit is viewed as a black box that accepts inputs and produces outputs, but the inner workings of the box are not visible.
16
16 White box or structural test
17
17 Example: Binary search (pp. 19-23)
18
18 Black box test Use n = 7 and sample array a of integers
19
19 Boundary Testing
20
20 Techniques to locate error
21
21 White-box test
22
22 Maintenance –Large % of computer center budgets –Large % of programmer's time –Largest % of software development cost Why? –Includes modifications and enhancements –Poor structure, poor documentation, poor style less likely to catch bugs before release make fixing of bugs difficult and time-consuming impede implementation of enhancements
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.