Topics covered Information Science 1 Terms and concepts from Week 05 The software development process Program'Development /Algorithms'and'Problem'Solving/'' ' software software life cycle life-cycle models Software design Week$06$ College of Information Science and Engineering Ritsumeikan University algorithm design (and development) formal tools Quiz Recall Week 05 Signed, unsigned Positive, negative Real numbers, floating point numbers Signed magnitude, sign-magnitude Two s complement (2 s complement) Invert, flip, 1 s complement Duplicate, sign extension Range, out of range, overflow IEEE 754 ( I triple E 754 ) Exponent, fraction, infinity, NaN Our goals today To understand the software development process To introduce the concept of the software product life cycle and software process models To learn what an algorithm is To survey popular formal tools used in program design and development The concept of software product A specific set of computer programs and associated documentation (such as user requirements, design models, user manuals, etc) are called a software product A software product may be developed for a particular customer custom software or for a general market generic software A new software product can be created by developing new programs, configuring generic software systems, or reusing existing software The software development process The software development process is a set of activities having their goal as the development or evolution of software. It always includes: Specification: What the system should do and its development constraints Development: Production of the software system Validation: Checking that the developed software is what the customer wants Evolution: Changing the software in response to changing demands
Software life cycle: A simplified view Software life cycle All the processes of software development and use are called the software processes. The software life cycle is an ordered set of software processes Fundamental assumptions of software product development: Feasibility study and Planning Good software processes lead to good products Good software processes reduce risk Design Software process models are simplified representations of the software life cycle, presented from a specific perspective Implementation Requirements analysis This phase of the software life cycle is to establish system's services, constraints, and goals through interaction with system prospective users (i.e. the client) The requirements analysis phase is usually comprised of activities related to: Assumed order Feasibility study (which is often carried out separately from other activities) Requirements elicitation (i.e. understanding and analysis of what the client needs) Requirements definition Requirements specification Software processes Operation and Maintenance The Waterfall model Requirements System and Program design The system design phase is to establish an overall system architecture, and to partition all the requirements into hardware requirements and software requirements During the program design phase, the previously established system functions are represented in a form that can unambiguously be understood and can be transformed into one or more executable programs Coding and Unit testing Through coding (or, in other words, programming), the software design is realized as a set of programs or program units. These programs can be written specifically, acquired from elsewhere, or obtained by modifying programs developed previously Individual programs and subsystems are tested against specifications during the unit testing phase
Integration, System testing, and Acceptance testing Operation and Maintenance Integration and system testing are usually concurrent activities that include: Integration of individual programs into larger modules (subsystems) and, ultimately, into a complete system Testing the subsystems and, then, the whole system against the specified requirements Delivering the system to the client During acceptance testing, the client performs independent testing before accepting the system and putting it into operation Feedback and the Waterfall model Each phase may need to be iteratively refined due to new understanding emerging at later stages The concept of algorithm Definition: An algorithm is a finite set of unambiguous, executable instructions that direct a terminating activity In an algorithm, always the number of steps (instructions) is finite we are able to do each of the instructions when we have followed all of the steps, we obtain a solution, and then stop This phase of the software life cycle includes activities related to System operation: The product is put into practical use System maintenance: Errors/ bugs and other problems are identified and fixed System evolution: The product evolves over time as requirements change, to add new functions or adapt to the technical environment Phasing out of the software product: The system is withdrawn from service System documentation Each (sub)system s documentation describes the purpose of the processing system, and it usually includes: Computer system flowcharts Input and output descriptions File descriptions Error messages System documentation also assigns responsibility for performing each control and processing procedure, as well as error-correction procedures Algorithm pseudo-code & flowchart # Class' Grade Average (Algorithm) 10 students (fixed) Set total to zero Set grade counter to one While grade counter is less than or equal to ten Input the next grade Add the grade into the total Increment grade counter by one Set the class average to the total divided by ten Print the class average. # python total = 0.0 counter = 1 N = 10 while counter <= N : grade = int(raw_input()) total += grade counter += 1 class_average = total / N print class_average
Designing Algorithms: A Methodology 1. Read the problem and establish the input and the output 2. Identify, what variables are needed? 3. Figure out, what computations are required to achieve the output? Usually, first steps in your algorithm are to bring input values to the variables Usually, last steps are to display the output So, the middle steps are to do the computation If processes are to be repeated, add loops Flowchart: Example Suppose you want to calculate the squares of the integers from 2 to 7 a simple solution would be to arrange a loop for both calculation and display i=i+1 Start Display i 2 NO i=2 is i > 7? YES Stop Algorithm design tools: Flowchart A flowchart is a logic diagram used to describe each step that the program must perform to arrive at the solution It is a very popular design tool used for showing an algorithm in a graphical form. Most common flowchart symbols are: Direction of logic flow Beginning or Input/output end of a task operation Logic flow connectors Logic comparison operation. Always has one entry and two exit points Data manipulation operations e.g arithmetic 5 purposes of flowcharting 1. An aid in developing the logic of a program 2. Verification that all possible conditions have been considered in a program 3. Provides a means of communicating with others about algorithms (especially good for international communication) 4. A guide in coding the program 5. Documentation for the program Algorithm design tools: Pseudocode Pseudocode is a textual description of a program Basic pseudocode operations: Read the input from user Print/Display the output to the user Carry out basic arithmetical computations Conditional operations: Execute an operation if the condition is true Repeat operations: Execute a block operation multiple times until a certain condition is met Pseudocode is a simplified form of English (or any other natural language Japanese, Vietnamese, Arabic, etc), but looks like programming Pseudo-code & flowchart (example) # Class' Grade Average (Algorithm) 10 students (fixed) Set total to zero Set grade counter to one While grade counter is less than or equal to ten Input the next grade Add the grade into the total Increment grade counter by one Set the class average to the total divided by ten Print the class average. # python total = 0.0 grade_counter = 1 N = 10 while grade_counter <= N : grade = int(raw_input()) total += grade grade_counter += 1 class_average = total / N print class_average
Algorithm design tools: Hierarchy chart! Hierarchy chart is a graphical description of how parts of a (sub)system are connected! A hierarchy chart: Shows the overall system structure Describes what each part, or module, of the system does Also shows how each module relates to other modules in the system! There are two hierarchy chart symbols: rectangles (to indicate the parts) and lines (to connect related modules). Arrows may also be used to show the flow Algorithm design tools: UML! The Unified Modeling Language (UML) is a language for visualizing, specifying, constructing, and documenting an information system! UML is not just for software development, and it can be used outside the domain of computer (information) science UML things UML diagrams Structural 1. Class 2. Interface 3. Collaboration 4. Use case 5. Active class 6. Components 7. Nodes Behavioral 1. Interaction 2. State mechanism Grouping 1. Packages Annotational 1. Notes! A UML diagram is a graphical presentation of a set of elements, most often in the form of a connected graph of things and relationships. UML includes 9 diagrams: 1. Class (and Object) Diagrams 2. Use Case Diagrams 3. Collaboration Diagrams 4. Sequence Diagrams 5. Package Diagrams 6. Component Diagrams 7. Deployment Diagrams 8. Activity Diagrams, and 9. State Diagrams Class Abstract Class Generalization Customer Rental Item {abstract} DVD Movie VHS Movie Video Game 1 UML: Example (a class diagram) 1..* Composition (Dependency) Multiplicity Simple Aggregation 1 Rental Invoice 0..1 Checkout Screen Simple Association What you are supposed to know after this class! The phases of the software life cycle (as in the Waterfall model)! Algorithm definition! Software design tools: flowchart and pseudocode! You are also advised to learn hierarchy charts and, especially, (in the future) the UML
! Read these slides Homework! Do the self-preparation work! Learn the vocabulary! Consult, whenever necessary, the textbook materials Next class! Overview and mid-semester evaluation for the first six weeks: from Week 01 to Week 06 1. Quiz 03 Write your name (in English), student ID number, and solve the following problems (write only answers):