CSC 1029 Week 5 Class Session: Software Development Lifecycle PDF

Document Details

DivineZebra9695

Uploaded by DivineZebra9695

Whatcom Community College

2017

null

null

Tags

software development lifecycle programming languages structured programming computer science

Summary

This document is a lecture or class session on responsible software development and the software development lifecycle. It covers topics such as defining the problem, designing algorithms, coding solutions, testing, and debugging. It also examines the security development lifecycle (SDL).

Full Transcript

CSC 1029 Week 05 Class Session Responsible Software Development The Software Development Lifecycle This document is licensed with a Creative Creative...

CSC 1029 Week 05 Class Session Responsible Software Development The Software Development Lifecycle This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Learning Objectives Upon completion of this unit: Students will be able to describe the security development lifecycle (SDL). Students will be able to illustrate the analysis phase of the software development lifecycle (SDLC) for simple problems. Students will be able to recognize the three basic control structures. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Overview Software development lifecycle (SDLC) Security development lifecycle (SDL) Programming languages Structured programming Defining the problem This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Software Development Lifecycle (SDLC) 1. Define the problem (analysis) 2. Design the solution (algorithm) 3. Code solution (program) 4. Test and debug 5. Maintain and document This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Software Development Lifecycle (continued) This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Security Development Lifecycle (SDL) Steve Lipner from Microsoft coined the term Security Development Lifecycle (SDL). SDL takes each element of the software development lifecycle (SDLC) and specifically considers how it pertains to security. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org 1. Analysis WHAT? Defining the problem Requirements Most common cause of software system failure traced to poor requirements gathering Generate and document a clear problem statement IPO diagram Consider security This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org 2. Design HOW? Planning Algorithm – expansion of steps in the IPO diagram Flowchart Pseudocode Consider security This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Design Tools pseudocode flowchart Can be done easily on word Standardized processor Visual Implements structured Difficult to modify design elements well Requires special software to Not visual do on computer No Standard This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Flowchart and Pseudocode This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Algorithm Step-by-step procedures for solving a problem in a finite amount of time. We are learning to write algorithms, and the computer is simply a fast and flexible tool for implementing algorithms. An algorithm is an ordered set of instructions such that: 1. There are a finite number of steps. 2. It takes a finite amount of time to execute the steps. 3. Each step is precise in meaning and is “doable.” 4. It solves a general class of problems. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org 3. Implement Code the solution: Choose language. Edit – create source program. Code responsibly. Compile (translate) and Link. Syntax error: Syntax – Each programming language has its own rules of the language Syntax error – violation of the rules of the programming language Compiler issued message Example: Programming language rule: Each statement ends in a semicolon. A syntax error would be leaving off the semicolon. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org 3. Implement (continued) Create an executable program. Consider security. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Structured Programming Top-down Design – divide and conquer. Modularity Subprograms Stepwise refinement The Structure Theorem – use three basic control structures to solve any problem. 1. Sequence 2. Selection (if-then-else) 3. Repetition (loop) This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Basic Control Structure 1: Sequence Statement Statement Statement Display “Enter Name”. Input name. Display “Hello” name. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Basic Control Structure 2: Selection (Branch) IF Condition THEN Statement1 ELSE Statement2 Statement1 Condition... Statement2 If (num > 0) Display “Positive” Else Display “Negative” This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Basic Control Structure 3: Repetition (Loop) WHILE Condition DO Statement1 False... Condition Statement This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Subprogram (Function) Subprogram1... Subprogram1 a meaningful collection of sequences, selections, loops, and subprograms This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org 4. Test and Debug Test with variety of data. Debugging: locating and correcting errors Logic error or bug — flaw in the algorithm Run-time error (e.g., divide by zero) Programming packages usually have debugger software to help programmers. Consider security. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org 5. Maintain and Document Maintenance – changing and maintaining existing programs Most coding is actually maintenance. Documentation – sometimes done by technical writers Reliable documentation is a must Helps keep track of all aspects of an application Makes complex programs easier to read and understand Key in knowledge transfer Consider security. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Tire Swing Illustration As proposed by the As specified in the As designed by the project sponsor. project request. senior analyst. As produced by the As installed at the What the user wanted. programmers. user's site. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Analysis: Defining the Problem This is Step 1 of the Software Development Lifecycle (SDLC). Use an IPO (Input, Processing, Output) chart: Helps to analyze a problem Graphical representation of the input, processing, and output steps of a problem Three columns: Input Processing Output This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Elements of an IPO Chart Input — the data that goes into the program Typed in from the user Read from file Processing What happens to the data inside the program Output Result of the processing Displayed on screen, printed, or saved to a file This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Identifying the Contents of an IPO Chart How to determine Input, Processing, Output: Step A. Input: Determine what is given => nouns, adjectives Step B. Output: Determine what is required => nouns, adjectives Step C. Processing: Determine the transformations / actions needed to produce the required output => verbs, adverbs This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Assign Names to Variables Variables are needed for the Input and Output data Use nouns Follow established naming conventions: No spaces Meaningful names Usually begin with lowercase Examples: roomWidth, numPeople, studentName This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Example 1 Read three numbers, add them together, and print the total. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Step A. Identify Inputs Underline the nouns. Example: Read three numbers, add them together, and display the total. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Step A. Identify Inputs (cont. 1) Break up multiple values into separate variables. Read three numbers, add them together, and display the total. num1 num3 num2 This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Step A. Identify Inputs (cont. 2) Fill the Input column first. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Step B. Identify Outputs Identify the Output variables. Read three numbers, add them together, and display the total. total This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Step B. Identify Outputs (continued) Fill in the Output column next. Notice that no verbs are being used at this point — the inputs and output are nouns only. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Step C. Processing Determine the transformations / actions needed to produce the required output. Define processing steps by bolding verbs. Read three numbers, add them together, and print the total. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Step C. Processing (cont. 1) Each verb is a process step Usually follows the pattern input - process - output This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Step C: Processing (cont. 2) Define the list of actions. Hint: Use verbs. These steps usually involve the input and output defined in the earlier steps. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Example 2 (Fill in the chart) Write a program to prompt the operator for the maximum and minimum temperature readings on a particular day, accept those readings as integers, and calculate and display on the screen the average temperature. Input Process Output This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Example 3 (Fill in the chart) Read the name and age of a dog; calculate and display its age in people years. Input Process Output This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Example 4 (Fill in the chart) Input the length and width of a room in inches and calculate the total square footage of the room. Input Process Output This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Computing Profession Ethics Copy software only with permission from the copyright holder. Give credit to another programmer by name whenever using his/her code. Use computer resources only with permission. Guard the privacy of confidential data. Use software engineering principles to develop software free from errors. This document is licensed with a Creative Creative License Commons Attribution 4.0 International Commons Attribution Creative Commons Attribution 4.0 www.C5colleges.org 4.0 International International License License ©2017 www.C5colleges.org Catalyzing Computing and Cybersecurity in Community Colleges is funded by a National Science Foundation grant and is located at Whatcom Community College 237 West Kellogg Road Bellingham, WA 98226 www.C5colleges.org

Use Quizgecko on...
Browser
Browser