Software Development Process PDF
Document Details
Uploaded by Deleted User
Tags
Summary
This document outlines various software development approaches, including Waterfall, iterative, and incremental methods. It details key activities, characteristics of good software systems, and concepts like prototyping, decomposition, functional and non-functional requirements. The content also touches upon system analysis and various related concepts.
Full Transcript
Unit 1 in One Page M363 What are Main activities in Software Development Process? (4 basic activities) 1. Analysis 2. Design 3. Implementation 4. Testing What are Water Fa...
Unit 1 in One Page M363 What are Main activities in Software Development Process? (4 basic activities) 1. Analysis 2. Design 3. Implementation 4. Testing What are Water Fall activities in Software Development Process? (5 activities) Analysis, Design, implementation, Test and 5. Maintenance What are Full activities Software Development Process? (7 activities) Analysis, Design, implementation, Test, Maintenance and 6. Quality management 7. Project management What is the legacy system? What are important characteristics of software that affect its development? 1. Usually large Malleability- Complexity- Size 2. Critical to the business What are The Characteristics of a good software system? 3. Changed a number of times Useful- Usable- Available- Reliable- Flexible- Affordable 4. difficult to understand 5. is lacking in flexibility 6. more difficult to maintain What are forms of decomposition? Partitions: independent modules, which are easy to use. What is the A prototype? Projection: dependent modules, common elements between modules One way to improve the analysis and identification of requirements Modularization: decompose system to a smaller modules with separate boundaries What are forms of Prototype? Coupling: degree of interdependence between different modules 1. paper-based model, simple software. Cohesion: how closely activities within a single module are related to each other. 2. A mock-up of the human–computer Context dependencies: a service may be required by the module interface for group of users Low coupling and high cohesive are competing. 3. Working version of subset of functions required from the eventual product. 4. Existing piece of software has some What is the different between the customer and user? relevance to the users’ needs Customer as someone, who pays for a software system (client) Users the people who use it on a day-to-day basis Advantage of prototype: 1. to make easy of requirement analysis 2. reduce the risk of requirements Waterfall Iteration Incremental Activities allows developing arranged in improving one chunk ordered into outputs by "core" and a single to iterate adding to it sequence around one or more of over time Sequential the activities Unit 2 in One Page M363 Stakeholders Each party in system developers – users- clients Requirements engineering include: Categories of problems: Late delivery or expensive than expected, Does 1. Input of a requirements engineering process not deliver what end users want, System is unreliable and has errors. 2. Output of a requirements engineering process 3. Activities of requirement engineering process 3.1. Requirements elicitation Requirement specification: activity of translating information gathered 3.2. Analysis & negotiation: during analysis into a document that defines set of requirements; it 3.3. Requirements documentation includes two types of requirements: 3.4. Requirements validation 1- User requirements 2- software requirements. Performance requirements deal with internal factors related to a product such as: security, speed, size. What are categories of requirements? Operational requirements concern about external Functional Requirements (FR) behavior of system- Not a quality-derived factors related to product "environment of from fundamental purpose of product- Actions that product must take operation". (check, record) Types of functional requirements: Business requirement: (tasks that system should do). Intruders Technical solution requirement: a constraint on product due to technology of Hackers who test their skills against. solution. Competitors: try to gain access to commercially Non-Functional Requirements (NFR) requirement about a quality product secret information. must have. Fraudsters try to obtain financial gain. NFR Types Ecommerce: distributed system where commercial 1. look-and-feel appearance and interface transactions take place (online), sale of goods or services or banking services, so that security is a Ex: Product use only two colors, lots of animation, range of exciting major issue. sounds. Firewall is a software used to protect networks 2. Usability: ease of use, ease of learn (may be hardware). Ex: 90% of population able to fill order from a web interface within 5 minutes 3. Performance: how fast, safe and accurate functionality must be. It What are forms of attack? relate to the capacity of a system to carry out its tasks (Speed- Disclosure Capacity- Accuracy- Reliability) Modification Ex: product shall calculate a guest’s bill in 2 seconds. Denial of use or service, 4. Operational requirements: operational environment (factors external Repudiation to the product Ex: Product usable at altitudes up to 1500 m, in icy and wet conditions, and in darkness. 5. Maintainability & portability requirements: expected changes, time Fit Criteria added to FR and NFR to be measurable allowed making them. and testable at the end to see if they meet users’ need, it is a precise and testable statement of a Ex: Product able to be modified to cope (deal) with a new class of a requirement. It may specify: user, with minor changes to European law. What are benefits of attaching fit-criteria 6. Cultural and political– special requirements due to people involved in product’s development, operation Helps to clarify the requirement. Ex: language used in the interface should be formal polite. Helpful communication or negotiation tool for interacting with different stakeholders. 7. Legal requirements 8. Security requirements: security and confidentiality of product. "The system shall accept a credit card number from a client." This is a functional requirement. "Need for the function to be done securely and within a given amount of time" Associated NFR. We need NFR because we are talking about security and speed of this function. 1 Software Engineering with Objects TM345 Block I: From domain to requirements Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 2 Unit 1: Approaches to software development 1. Software: a collection of computer programs and related data provide instructions to tell computer what to do 2. Software engineering: theories, methods and tools needed to develop SW which is reliable and works efficiently 3. System is an assembly of components that are connected together in an organized way 4. System boundary: is a conceptual line divides our system from everything else (scope of a system) 5. System’s environment: Any things not part of system but can either affect the system or be affected by it. 6. Domain is a particular area of interest. 7. Software: a collection of computer programs and related data provide instructions to tell computer what to do 8.What are Characteristics Software engineering: of good software theories, methodssystem? and tools needed to develop SW Characteristics of which is reliable software and works that affect efficiently its development? 1. Useful: it meet users’ needs 9. System is an assembly of components that are connected together in anSoftware 1- Malleability: organized way to change (not replaced. is easy 2. Usable: interface is easy to use and friendly. 10. System boundary: is a conceptual line divides our system from everything 2- Complexity: else (scope complex systemofrequires a system) more explanation. 3. Available: available in our environment. 11. System’s environment: Any things not part of the system but can either affect the system or be affected by it. 3- Size: more errors in a large piece of software. 4. Reliable: errors must be minimized. 12. Domain is a particular area of interest. 5. Flexible: easy to change as times goes. 13. Software: a collection of computer programs and related data provide instructions to tell computer what to do 6. Affordable: it meet delivery date and costs 14. Software engineering: theories, methods and tools needed to develop SW which is reliable and works efficiently 15. System is an assembly of components that are connected together in an organized way What is the legacy system? 1. Usually large 2. Critical to the business 3. Changed many times. 16. System boundary: is a conceptual line divides our system from everything else (scope of a system) 4. More difficult to maintain, costly. 5. Lacking in flexibility. 17. System’s environment: Any things not part of the system but can either affect the system or be affected by it. 6. Difficult to understand (a lack of documentation, experience) 18. Domain is a particular area of interest. 19. Modularization: (Divideof&computer Software: a collection Conquer)decompose systemdata programs and related to a provide smallerinstructions sub-systemtowith separate what tell computer boundaries to do 20. Software Why we need modularization? engineering: It isand theories, methods a way toneeded tools reducetosize complexity. develop SW which is reliable and works efficiently Examples of modules: 1-Whole programs 2- software libraries 21. System is an assembly of components that are connected together in an organized 3-classes, way in Java. 22. What Systemare forms ofis decomposition? boundary: a conceptual line divides our system from everything else (scope of a system) 23. System’sindependent Partitions: environment: Any things modules, easynot to part use of the system but Projection: can either dependent affect the module, systemelement common or be affected between bymodules it. 24. Domain is a particular area of interest. 25. Software: a collection of computer programs and related data provide instructions to tell computer what to do 26. Software engineering: theories, methods and tools needed to develop SW which is reliable and works efficiently 27. System is an assembly of components that are connected together in an organized way Coupling: degree of interdependence between different modules example: 28. System boundary: 1. A inherits is aB conceptual line divides our system from everything else (scope of a system) from 2. A hasenvironment: 29. System’s an attribute of class Any B not part of the system but can either affect the system or be affected by it. things 3. A has a method uses B as an input or output 30. Domain is a particular area of interest. 4. A knows of a public attribute of class B 31. Software: Good softwarea collection of computer is loosely coupled programs system, and which is related easier data providemodify, to understand, instructions to and replace tell computer reuse what to do Cohesion: 32. Softwarehow activities within engineering: a single theories, module methods andare closely tools related needed to eachSW to develop other. which is reliable and works efficiently Component is a unit of reuse or replacement in a software system. (Module or class). A highly 33. Systemcohesion moduleofperforms is an assembly one task components thator aresingle objective. connected together in an organized way - Low coupling and high cohesive are competing. (We try to achieve balance between of coupling & cohesion) 34. System boundary: is a conceptual line divides our system from everything else (scope of a system) 35. System’s environment: Any things not part of the system but can either affect the system or be affected by it. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 36. Domain is a particular area of interest. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 37. Software: a collection of computer programs and related data provide instructions to tell computer what to do 3 Chain Dependency Module A depends on B & B depends on C (person depend on Car, Car depend on Petrol) Circular dependent: if A depends on B and B depends on C and C depends on A. context dependencies: the services required by module (student requires session – books – exercise) Architecture and components System architecture: structure of items that make up a software, it includes: responsibilities- interconnections and appropriate technology, tells the developer about the overall shape. Component as a unit of reuse or replacement. It could be a module or class with properties that make it reusable or replaceable in a given system architecture. Three-layer architecture 1. Presentation: top layer concerned with the user interface (more prone to change) 2. Application domain is the way a user performs a task, such as the customer’s order. 3. The infrastructure is the system support includes the operating system and the databases, which allows the system to be more easily ported to new platforms. A service is a unit of reuse corresponding to a piece of functionality, described in a standard language, with published interfaces through which the service execution can be requested. Similarities and differences between components and Services components Services Similarities They both promote reuse and flexibility. They both use public interfaces to allow requesters to make use of their functionality without relying on their implementation. Differences 1- Implemented in a object-oriented technology 1- Uses communication standards that so that only clients compliant with technology allow the interoperation of diverse can easily communicate and integrate with it. technologies. 2- services tend to be associated to 2- tend to be associated with business entities business processes Important: Enterprise Java Beans (EJB),.Net and CORBA are examples of standards for components A service-oriented architecture (SOA) structures software as a set of services. The notion of services being accessed remotely through a web browser – software as a service (SaaS) – is popular now with systems such as those provided by Google (for example, Gmail and Google Docs) Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 4 Section 3: An introduction to software development Software engineering: use of engineering principles in order to obtain a high quality software product that is reliable and works efficiently on real machines. Software development is a human activity that involves the activities: analysis, design, implementation and testing that leads to produce a software system. Life cycle: sequence of activities are carried out in software development Development process: is a set of rules that define how a SW should be carried out. What are the Main activities in Software Development Process? (Basic activities) 1. Analysis: understanding the problem, it included: a- Requirements elicitation: understand and review the users' needs constraints b- Requirement specification: records what you want to do to meet the user's requirements. 2. Design: how will you solve the problem? 3. Implementation: convert the design to a programming code 4. Testing: Test each part separately and integrate all parts and the test them overall Additional 3 activities: 5. Maintenance activity: allows correcting errors, Adapt SW to a changing environment, Enhance customer requirements (meet users' needs), Improve SW in anticipation of future changes. 6. Quality management: ensure that the characteristic of good SW is achieved: reliable, flexible. 7. Project management: is concerned with controlling the cost of developing such systems. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 5 What are the models of SW development? A- Waterfall model: (sequential) “Real projects rarely follow a purely sequential life cycle”. 1. It is classic model include five activities (analysis, design, implementation, testing, and maintenance) 2. Activities arranged in single sequence, so when complete an activity then moved to next one. Why Waterfall model has not proven satisfactory in practice? 1. Working software will not be available until late in the testing activity. 2. Errors will be detected in testing activity (delays delivery at end). B-Iteration model: (iterate around one or more of activities). 1. It allows improving outputs before moving on to next activity. 2. Advantage: allows to review outputs provides feedback to modify it C- Incremental development: (divide system into an independent chunks) Process begins by developing one chunk "core" and adding successive increments to it over time What are Advantages of this form are?) it deal with the complexity of requirements) 1. users obtain useful and usable software quickly 2. Enables to take feedback from users as software develops. Agile development Agile development is an approach to software development that puts people and working software at the forefront of the development process. It is an umbrella term used to describe a variety of (agile) methods that promote a set of practices that encourage simpler, more light-weight, faster and nimbler software development that can adapt to the inevitable changes in customer requirements. The continual realignment of development goals with the needs and expectations of the customer aims at software that better serves its purpose. Dealing with risks: (spiral process) four steps that are repeated for each iterate a) Determine objectives, alternatives and constraints. b) Evaluate alternatives, identify and resolve risks. c) Develop and verify solution or product. d) Review solution and plan for next iteration Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 6 Project notebook is a disciplined approach to organizing your thoughts & actions. It is a record of notes, thoughts, drawings, ideas and decisions (reasons) as you work on a project. It could be paper-based or files on a personal computer. Why you must keep accurate dates and times for information in your notebook? 1. Evidence in enquiry or even in a court of law. 2. It helps to review what have done & how long you took to do task. 3. It facilitates learning. Traceability: ability, to trace the history of each requirement from its origin in the problem domain What is the different between the customer and user? Customer as someone, who pays for a software system (client) Users the people who use it on a day-to-day basis Section 4 modeling software Modeling: is a way of thinking about things and ideas in the 'real world'. Model is an abstract representation of a specification, a design or a system. o A way of understanding problems o An aid to communicate between developers o A component of the methods used in development activities such as analysis and design. What is a good model? Concentrate on essentials of a problem by keeping out non-essential details. A modeling language is based on diagrams and their construction, meaning and use. Agile modeling: It a set of values, principles & practices to help developers become agile modelers. [Sketch a few models, discuss these sketches, and then discard them if they serve no further need. There are two rules within a diagram based modeling language: Syntax: determine what diagrams exist and what symbols are used for. Semantic: what these symbols mean. What are characteristics of a standard modeling language? Expressive- Unambiguous- Easy to use - Widely used- Supported by suitable tools What are types of models? Static model: describes objects and their relationship Dynamic model: describes the behavior of SW over time. The Unified Modeling Language (UML): is a standard modeling language, which is diagrammatic, but also allowing developers to add text, and is easy to use, expressive, unambiguous, widely used there are two distinct kinds of model: 1. Structural (static) models, describe objects and their relationships to other objects 2. Behavior (dynamic) models, describe the behavior of a system over time. Software architecture is a way of identifying the differing views. - The developers produce system architecture for the software during analysis or design. - Each view can be thought of as a model that expresses a particular aspect of the overall Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 7 Unified Process (UP) has emerged as a popular iterative and incremental process for building enterprise systems based on an object-oriented approach, and using UML. Best practices promoted by UP are: a. Development is organized in short time boxed iterations. b. Dealing with high-risk issues in early iterations c. prioritizing the user’s perspective by involving users in requirements, evaluation and feedback A UP project is organized into four major phases: 1. Inception: develop business case with the scope of system and a rough estimate of effort required. 2. Elaboration: develop core of system in an iterative fashion. All major risks are addressed and resolved, most of the requirements are identified, and a more realistic estimate of the effort required is made. 3. Construction: The final product is constructed, including the remaining lower-risk and easier elements of the system, again in an iterative fashion. 4. Transition: This includes beta testing and deploying the system. What are the views of software architecture in UP? Are functional requirements of system, Contains basic scenarios what software to do? describe users their tasks Aspects of concurrency what are the processes and Relationship between threads? How do they executable & intended computer system interact? Deals with things as response time, deadlock, Organization of and fault tolerance. modules, code and data files. Activities and artifacts in the development process Artifacts refer both to model and other document, the artifact produced from an activity is used to feed into the next activity Our core activities follow the UP disciplines: 1. domain modeling – modeling what already exists in the domain 2. requirements – identifying, categorizing, prioritizing and modeling what the system must do 3. analysis – modeling how the structure and behavior of the system will meet its specification from a user’s perspective, moving from the domain to a software solution 4. design – deciding on the distribution of responsibilities to fulfill that specification 5. implementation – producing code that will meet the user requirements 6. testing – ensuring that the software does meet its requirements 7. Deployment – configuring the code to give a runnable system. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 8 What are models produced Throughout the SW development? 1. Domain modeling: an understanding of the environment of system that. During it we produce: a- Dynamic model: business processes description. b- Business rules: constraints. c- Glossary: terms definitions 2. Requirements engineering model: what a software system must do. (use case diagrams). 3. Further analysis model: a more detailed specification of what the system must do 4. Design Model: making decisions concerning how system will meet its specification, (communication diagram), include: a-Structural model b-Behavioral models 5. Implementation Model: How classes are packaged together, and show the relationships between such packages. 6. Testing Model: against its requirements to ensure that it meets them. Tests drawn up based on the requirements, 7. Deployment Model: how components are to be mapped onto different machines, and how they will communicate. This can be represented using a deployment diagram. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 1 Block II: From analysis to design Unit 6: Dynamic modeling Design by contract (DbC): Developing software based on contract between objects. Contract: ensure that software do required functions (formal description of object service) Contract formed when sender (client) sends a message to receiver (supplier). Benefits from identifying roles in terms of clients and suppliers are: 1- −Enabling designers to specify the responsibilities of objects more precisely; 2- −Allowing clearer software to be built, and, in turn, 3- −Leading to greater confidence in the correctness of the software Assertions are true or false statements involve: 1. Preconditions: required from client, (benefit to supplier). 2. Post conditions: required from supplier, (benefit to client). 3. Invariants (constraints on relationship) What are advantages of assertions in DbC: Accurate document- Aid to testing- Controlling inheritance How DbC help to improve quality? ( find defects and provide testing) 1- Allows tracing the software. 2- check if a correct system is built (meets contract with client) So in order to improve quality: you need to find defects before executio n and provide testing to ensure the system will work under all circumstances. This is so important to build an error free system as a critical system Critical Systems are software systems where failure may have catastrophic consequences −Loss of life (safety-critical systems), −Loss of business (business-critical systems) and −Failure to meet significant objectives (mission-critical systems). It is vital that such systems be as error-free as possible. In developing critical systems, the developer will use: −Formal methods – based on mathematical notations, logic and proof. −Analysis tools to make the systems as error-free as possible. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 2 U DbC Example: figure shows a class model for lending of books to record both past & current loans. Describe the contract to borrow a book in terms of objects and links created. Your answer should differentiate between the pre and the post-conditions. Precondition: −There must be an instance of the class LibraryMember that corresponds to the real-world member; −There must be an instance of Book that corresponds to real-world book that member wants to borrow; − Instance of LibraryMember must be linked to fewer than 3 instances of Loan in role of currentLoans. Post-condition: −A new instance of the class Loan will have been created; the instance of the class LibraryMember will have been linked to the new instance of Loan in the role of currentLoans; −The instance of the class Book will have been linked to the same new instance of the class Loan. Example: Company to collect emails. You have 4 million emails, growing daily. Decide to buy a sorting program to remove duplicates.Need to sort at least 10 million at time (precondition), and to be done in less than 10 minutes (post-condition) 1. Microsoft doesn’t satisfy pre-condition N= 1 million 2. ABDC doesn’t satisfy post-condition M=20 minutes 3. AeLPP, and DictoSort satisfy your requirements are capable of doing more than is required. 4. A product that satisfies weaker conditions on inputs & stronger conditions on outputs is convenient for client. To weaken a precondition ‘fewer’ conditions (In general) it is easier for the client to satisfy the precondition To strengthen a post-condition means making the ‘better’ service, more suitable for client Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 3 Starting Dynamic Modeling: User case model show behavior, but does not show structure of classes Class model show classes, but does not show behavior ( operations) the link between use cases and class called interaction diagram: It is dynamic model record behavior defined for each class. Its types: Sequence and Communication Diagram Q1: Draw sequence diagram Q2: What are classes or objects in diagram? Q3: What are methods for each class? Q4: Draw communication diagram Q5: What is type of sequence? Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 4 Interaction Diagram (represent dynamic modeling) Sequence Diagram Communication (Collaboration Diagram) Definition Messages flow from object to other within time Messages flow along links between objects. It is an object diagram with message sends. Strengths Time extremely clear. Interconnections between objects clear. Weakness Difficult to see overall patterns of message flow, difficult to see actual sequence of messages, each diagram shows a particular sequence. So a sequential numbering system is used. In sequence diagram: time is clear, either prototypical sequence or concrete sequence 1- All object in same line ( objectName : ClassName) 2- Each object has lifeline and activation. 3- Object can send message to itself (recursive) 4- object can send message to another(synchronous ) A communication (collaborative) diagram is an object diagram with added message sends 1- Draw objects 2- draw link 3- draw message above links 4- assign number for each message. Draw a communication diagram equivalent to sequence diagram and what are methods of each class Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 5 Creation and deletion: In sequence: Object level is below other objects if it is created by calling constructor new Guest() And can be deleted by destroy() In communication: we write {new} and {destroyed} as constraints, Java provides garbage collection to remove it. Forks or cascades A fork centralizes control in the sender. A cascade delegates responsibility to another object. How to choose Fork or cascade pattern? The goal is to reduce coupling to simplify implementation. According to Law of Demeter,(favor cascades) allows an object to send messages to: 1- object has direct links – its neighbors; 2- Itself. 3-any objects as parameters of current method. 4- any new objects has created in the current method; Design Design by contract Defensive Programming It is responsibility of sender of message to It’s the responsibility of receiver to check precondition guarantee the precondition of the operation preconditions are always checked by operation itself, Main disadvantage: conditions are repeatedly checked in both the client and the supplier. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 9 Unit 2: Requirement Concept Requirements are the functions and qualities we want of a product. What are stakeholders? Each interested parties in system such as developers; users, clients Ex: hotel reservation stakeholders: hotel owners, receptionists, customers and anyone access to make reservation What are categories of problems? Late delivery, expensive, does not deliver user needs, System is unreliable (error). What are reasons of problems in Software Products? A lack of understanding, a lack of clear agreement Why specification of requirements is not an easy task? - It is not stable (keep changing within time) - Stakeholders do not have the same view or priorities. Requirements need to be: 1. Necessary & traceable: fulfill a purpose, its source is clear. 2. Complete: all functionality should be described. 3. Consistent: should not contradict each other. 4. Verifiable: possible to check that is implemented. 5. Non-ambiguous & realistic 6.Independent of design. Discuss requirements engineering process: 1. Input: for hotel system: Stakeholder needs - domain information (room's id)-regulations – an acknowledgement. 2. Output: (contract) Requirements document and models). 3. Activities: a) Requirements elicitation: consulting stakeholders, reading documents, understanding domain. What are techniques for elicitation? Interviewing, brainstorming, meetings. b) Analysis & negotiation: categories, priorities, completeness and unambiguous. c) Requirements documentation: records decisions, reference for what should be built. d) Requirements validation: ensuring that the requirements are of sufficient quality. Requirements dependencies: it conflict with each other (small screen size – scrolling text) portability conflicts usability Requirement specification: translating information into a document that defines set of requirements; It includes two types of requirements: User requirements software requirements. What are categories of requirements? Functional requirements and non-functional requirements Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 10 Functional Requirements: (FR) describes the behavior of the system- (essential, core requirements) Not a quality – for example, ‘fast’ is quality so it not functional requirements (adjectives). Actions the product must take (check, calculate, record). "Verbs are functions"(fundamental purpose). FR help a developer to identify minimum cost & time that are needed, FR should be prioritized. Types of functional requirements: a. Business requirement: (tasks that system should do, not how). b. Technical solution requirements: a constraint on product due to technology of solution. Example of functional requirements: 1. X must check a user’s identity: Functional, business requirement (states what needs to be done, not how). 2. X must check a user’s password: Functional, technical solution requirement (access to the system can be achieved in many ways: passwords are just one mechanism. 3. X must produce a statement of the user’s account: Functional, business. What are needed steps to eliciting functional requirements? 1. Understand the domain. 2. Define system scope, and business events. 3. Draw up a set of use cases. 4. Describe each use case by scenarios (steps). 5. Work through each step to determine requirements. 6. Check for similar requirements. 7. Search out and remove ambiguity. Natural language "NL" sources of ambiguity: Using pronouns (it, their, etc.) - a word may have multiple meanings How to solve ambiguity? Avoid pronouns, record abbreviations & definitions for technical meaning words In writing requirements document you should take care of the following: 1. Write clear statements, (constrained). 2. Write abstract statements for stakeholders (user requirements). 3. Do not write solutions, only requirements 4. Write functions details for designers (software requirements). Non-Functional Requirements (NFR): is a requirement about a quality that product must have. Examples of NFR: - X must validate user’s identity and password within 3 seconds. - X must be usable by users with limited dexterity (expertise). - X must operate in arctic climates. - X must work fast, secure, etc. Important: NFR is associated with FR in requirements document, NFR is as constraints on FR requirements "The system shall accept a credit card number from a client." This is a functional requirement. "Need for the function to be done securely and within a given amount of time" Associated NFR. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 11 NFR Types 1. Look-and-feel requirements –appearance, (Product match with the user-interface guidelines (user needs). 2. Usability requirements: ease of use, easy to learn (reservation websites, "nuclear control"). 3. Performance requirements: how fast, safe and accurate, (speed, capacity, Accuracy, reliability). 4. Operational requirements: (factors external to the product) environment, Involves installation needs. To find operational requirements Investigate product boundary, consider the needs of adjacent system Computer security is detection and prevention of unauthorized actions by users of a system 5. Maintainability & portability requirements: expected changes, time allowed making them. Intruders: People, who try to read, change or delete the data that is stored in. They may: Maintainability A. Keeping o Hackers who product test theirupdated B. fixing product when it fails. skills against. Portabilityoconcern need to try porttosoftware to new hardware environments at some later stage. Competitors: gain access to commercially secret information. 6. Cultural andopolitical–due Fraudsters to trypeople involved to obtain in development, financial gain. operation usually arise when: Company sells a product in a different country with different culture & language. How to protect your own PC by physical means? 7. Legal requirements –It concern o Providing withtothe authority law and the individuals standards to do that apply to the product. specific tasks 8. Security requirements: o Providingcovers confidentiality, user name integrity, and password concerned for accessing with threats against assets system. a. Confidentiality protection o Placing of data computer in from unauthorized a room access to which only andpeople certain disclosure. have (physical) access. b. Integrity refers to consistency of data. c. Availability refers to access by authorized users. Performance requirements deal with internal factors related to a product such as: security, speed, and size. Operational requirements concern about external factors related to product "environment of operation". 1. The product use only two colors, lots of animation, large range of exciting sounds. 2. University graduate should be able to learn to use 50% of functionality of product in 2 hours. (Usability) 3. 90% of population should be able to place an order from a web interface within 5 minutes. (Usability) 4. The product shall calculate a guest’s bill in 2 seconds. (performance) 5. The product shall handle up to 10 users simultaneously. (performance) 6. The product shall report wind speeds within 5 miles per hour of the actual speed. (performance) 7. The product shall, on average, operate without failure for 20 days. (performance) 8. Product usable at altitudes up to 1500 m, in icy and wet conditions, and in darkness. (operational) 9. Product used in a standard office environment, except high levels of background noise. (operational) 10. Product needs to be installed at 58 locations of race in 2 days by 3 semi-skilled workers. (operational) 11. Product able to be modified to deal with a new class of a user, with minor changes to European law. (Maintainability & portability) 12. Product shall be portable to all of operating systems currently used in our Slough office. (Cultural and political) 13. Language used in the interface should be formal polite. (Cultural and political) Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 12 Example for security: the university used a distributed computing LMS, we have following security problems: 14. Disclosure of personal information, educational materials not paid for, assignment solutions. 15. Unauthorized modification of data, alteration to students’ marks. 16. Denial of use or service. 17. Very slow replies to service requests. Computer security is detection and prevention of unauthorized actions by users of a system Intruders: People, who try to read, change or delete the data that is stored in. They may: o Hackers who test their skills against. o Competitors: try to gain access to commercially secret information. o Fraudsters try to obtain financial gain. How to protect your own PC by physical means? o Providing authority to individuals to do specific tasks o Providing user name and password for accessing system. o Placing computer in a room to which only certain people have (physical) access. What are types of interception: Passive (just listening to the communications) Active (listening and retransmitting with changes). What are Security problems arise with a distributed system? a. Communication medium is insecure. b. In an external network, communications will pass through third-party with unknown security measures. What are forms of attack? 1. Disclosure (of confidential information), read messages, steal credit card information. 2. Modification unauthorized alteration of data. (change messages), loss of integrity 3. Denial of use or service, denial of network service to its authorized (legitimate) users. 4. Repudiation, user claims that they did not send or receive a message that was sent or received Ecommerce: distributed system where commercial transactions take place (online), sale of goods or services or banking services, so that security is a major issue. Firewall is a software used to protect networks (may be hardware). Threats and attacks against assets: to ensure that all resources (assets) are accessed and used as intended, if you can prevent misuse, the computing system is secure. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 13 Fit Criteria: a quantification or measurement of a requirement that fits the requirement Criteria added to FR and NFR to make it measurable and testable, if they meet users’ need. Known as fir-criteria. A fit criterion is a precise and testable statement of a requirement. It may specify: A quantitative measure for some aspect of the system’s behavior or performance. Define some other quality that the system must possess if it is to meet the requirement. What are benefits of attaching fit-criteria to requirements? o Helps to clarify the requirement. o Helpful communication or negotiation tool for interacting with different stakeholders. The parties that need fit criteria are: Developers use the fit criteria to develop the product to meet those criteria. Testers use fit criteria to determine if the delivered product meets original requirements. Clients use the fit criteria as acceptance criteria for the product. A fit criterion for FR: specifies completion of the function that is specified by functional requirement. Example 1: FR fit criteria If FR is: Send an email to the student after a marked TMA has been uploaded by the tutor, Then fit criterion is: an email should indeed be sent to student and reflected in their mailbox. Example 2: FR fit criteria If FR is: The system shall accept a credit card number from a client. Then fit criterion is: A valid credit card number has been stored in the system. A fit criterion for NFR: specifies a value or values, on a particular scale of measurement, that must be attained by the property or quality with which the requirement is concerned. Example 1: NFR fit criteria If NFR is: The credit card number should be accepted securely. Then a fit criterion is: credit card number should be revealed to a third party in less than 0.0001% of cases. Example 2: NFR fit criteria If NFR is: the credit card number should be accepted within five seconds. Then a fit criterion is: statement contains its own fit criterion, as it is already expressed in terms of the quantity time. Example 3: Usability requirement For a public information kiosk at a railway station, the usability requirement is as follows. Description: The kiosk shall be usable by a member of the public who may not speak or read English. One possible fit criterion is as follows. Fit criterion: 15 out of 20 non-English speakers able to use kiosk without either referring to online help or walking away without the desired information. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 14 Volere template is organized into five main sections, each including a number of requirements categories. - Project drivers - Project constraints - Functional requirements - Non-functional requirements - Project issues Advantage of capturing requirements using a template - The template is divided into a fixed set of categories, which means you are less likely to forget some types of requirements. - It also saves having to work out what categories of requirements to deal with each time you start a new document. - It helps to communicate requirements to other developers because if there is a standard template then everyone will know what information to expect and in what order. - It might also allow projects to be compared and even requirements to be reused more easily. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 15 Sommerville distinguishes two types of requirements as follows: Requirements specification [is] the activity of translating the information gathered during the analysis activity into a document that defines a set of requirements. Two types of requirements may be included in this document. User requirements are abstract statements of the software requirements for the customer and end-user of the system; system requirements are a more detailed description of the functionality to be provided NFR Important examples 1 the product shall comply with the iOS human interface guidelines 2 the product shall use only two colours 3 the product should use a lot of animation 4 The product shall use a large range of exciting sounds. 5 a university graduate should be able to learn to use 50 per cent of the functionality of the product in 2 hours 6 ninety per cent of the general population should be able to place an order from a web interface within 5 minutes – 90 per cent of elderly users should be able to place an order from a web interface within 10 minutes 7 it should be possible to use the system to pay in different currencies 8 The system should comply with the Disability Discrimination Act. 9 the product shall calculate a guest’s bill in 2 seconds 10 the product shall handle up to 10 users simultaneously 11 the product shall report wind speeds within 5 miles per hour of the actual speed 12 The product shall, on average, operate without failure for 20 days. 13 the product shall be usable above an altitude of x, in icy and wet conditions, and both in the dark and in bright sunshine 14 the product will be used in a standard office environment, except that high levels of background noise may occur 15 the product will need to be installed at 58 locations around the proposed route of the race in 2 days by 3 semi-skilled workers 16 Keeping the product updated in the light of expected changes. 17 Fixing the product when it fails. 18 the product shall be able to be modified to cope with a new class of user 19 the product shall be able to be modified to cope with minor changes to European law that occur every six months on average 20 The product shall be portable to all the operating systems currently used in our Slough office. 21 The language used in the interface should be formal and polite. 22 There are penalties for non-conformance with the law: fines, imprisonment and loss of reputation. 23 ‘crackers’ who test their skills against the security measures of a system for their personal pleasure 24 competitors who try to gain access to commercially secret information 25 Fraudsters who try to obtain financial gain from the owner of the system or some third party. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 6 Unit 7: Moving from specific to the generic M363 Conditional sequence diagrams: put all cases onto a single diagram that captures a range of possible behaviors. 2- Iterative message sends in sequence Diagrams * is repeated message send A company print year’s reports by sending to Department printReportForMonth(i), using an iteration clause *[i := 1..12]; Answer *[i :=1..12]printReportForMonth(i) UML fragments (frame): is a way of encapsulating behavior inside a labeled box UML has a more structured way of indicating conditional, alternative and iterative behavior. This is based on the use of a more general notion of what is called a fragment, which is sometimes referred to as a frame, The label can be, for example, opt, alt or loop, standing for optional, alternative or looping behavior. Shows a loop fragment. The behavior is repeated a number of times as specified by a parameter. More complex loops are possible, but we don't consider them here. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 7 This is used where we want to choose from a number of mutually exclusive pieces of behavior. The box is divided, with alternatives in sub-boxes along with appropriate guard. The behavior specified inside the fragment is only executed if the guard, is true. One sub-box can be labeled with the guard else, to indicate it contains the default behavior. Hence the opt fragment is like a simplified alt fragment, with one guard and no default behavior. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 8 An introduction to state machines A State machine: shows how an object changes from state to state in response to events. (Life history of an object) A state: represents some condition or situation in the life of an object (A state is not an action) An event: is something done to an object. (Event change state of receiver or not) A car’s motor start (event) to put it into running state. An action: is something an object does such as sending message to itself or to other objects. Object's reaction event Transition: occurs as a response to an event, and cause change of state. States: Occupied and unoccupied Events: Check In; Checkout is events that fire the transitions between states. Ex: vacateRoom() / removeOccupant() : event/action An action consequence: ordered series of individual actions that are associated with a particular event. Like actions, action sequences are atomic. Note that: two objects of the same class respond differently to the same message (by the values of its attributes) Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 9 Guard What is content of A transition in a state chart diagram: 1. source state; 2. target state; 3. event trigger; 4. action (or action sequence); 5. guard. A final state: show points where object has finished or (reached the end) of its life and will be destroyed. Differences between final and initial state: -There can be zero, one or more final states but at most one initial state. -Final state can be active for a period of time, whereas initial state results in an immediate -Final state: several incoming and no outgoing transitions, but initial state has no incoming & one outgoing transition. Entry and exit events: sometimes all transitions share some actions. We avoid repetition by special actions 1. Entry event: triggered every time an object enters a state. ( Actions appropriate for all incoming transitions) 2. Exit event: triggered every time an object leaves a state. (Actions for all outgoing transitions). In the case of a self transition, both the entry and the exit events will occur. Entry and exit events are not allowed to have guards. = Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 10 An internal transition is a special transition that does not involve a change of state, It does not cause of entry or exit actions, It used to handle an interrupt some action take place. Ex: Hotel object receives message hotelLimitChanged(),and responds by sending message resetAvailableRooms() to itself – an action. What are benefits State machines have several. 1. Identifying which messages affect which attributes. 2. Help to understand behavior of an object over its lifetime. 3. Help to understand how an object responds to events. 4. They are a means of ensuring correctness. UML allows you to label a composite state with name of state machine that models its internal behavior If an object always responds in the same way to a given event, it is unlikely that you will need to produce a state diagram – it is state-independent. Those objects that do react differently to a given event are state-dependent. Packages: a way of grouping model elements into a unit called a package. A UML package is a much more general idea than a Java package, Use cases can be grouped into packages, for example – and so can other packages! , Each package defines a namespace. Any two distinct model elements in the same namespace (package) must always have different names. Elements in different namespaces (packages) can have the same name. There are three main reasons for partitioning a software system: 1. To manage size and complexity; 2. For information hiding; 3. For logical decomposition. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 11 UML allows you to mark individual elements of a package as public (+), private ( –), protected (#) or package (~). In UML, there are two stereotypes in which you may see other packages: : When you import a package, all public elements of that package is visible. ◦The «import» stereotype can give rise to a naming problem, because an «import» adds the names of the elements in the target package to the source package. ◦The result is that, if an imported name clashes with an existing name, you have to qualify the imported elements with their package name in order to distinguish them. : In this case also, all public elements of target package will be visible to source package. The «access» stereotype allows simpler traceability, because other packages must use the full name of an accessed element, such as PackageName::ElementName. So naming problem will not arise. You can also use packages to present different views of a software system, such as its architecture. Figure 24 illustrates a three-layered architecture that we introduced in Unit 1. The presentation translates the user actions into system requests. Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. (965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 15 Unit 3: From domain modeling to requirements (Activity Diagram and Use case) The main concepts in a business domain are: 1. Business resources (people, information and materials); 2. Business processes (activities that use these resources); 3. Business rules constrain how a business is run, key to modeling the business. What is difference between business processes and constraints (Business rules)? "Car rental company" - Renting a car is a business process - the lowest mileage car business rule Why business rules are important? Basis of decision making, Provide easy access whenever there is a change. Understanding the business is an essential step in developing any software solution. What are properties of business rules representation? Represented correctly, independently of other models, readable, traceable & support verification and validation. Verification: ensure that the rules are correctly modeled. Validation: ensures that the rules are appropriate rules for business. What are Business Rules techniques: Using natural language (NL) or OCL in UML: Object Constraint Language Activity diagram: Representing Business Processes: - It shows sequences activities, parallel activities. Which person is responsible for which activity? - Workflow is defined as a sequence of activities that produces a result of observable value. - Activity diagram can be an aid: 1. Help investigate workflow of control from one activity to another. 2. Help in understanding the basic behavior of a system. 3. Used to model concurrent systems. 4. Can record scenarios of use cases. 5. Identify the stages at which each role requires some interaction with the process. Example 1: Draw Activity diagram for Preparing a Cup of Coffee with milk The process starts by entering kitchen.. Then you need to: fill kettle, boil water, get a cup and add coffee. These activities can be done in any order or concurrently. After water is boiled, you need to pour water in the cup, and then add milk to it, and drink coffee uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 16 Example 2: Redraw the activity diagram of preparing a cup coffee. The new diagram should allow checking if cup is clean continuing the process, if not wash the cup. Example 3: Redraw activity diagram of figure 1 to allow the choice between coffee with milk and coffee without milk. uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 17 Example 4: Draw an activity diagram to illustrate the preparation of a pot of tea, which replaces the activities relating to coffee shown in Figure 1. The new diagram should allow the choice of both milk and sugar when the tea is poured. uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 18 Example 5: Consider the below lending process from a library to answer the below questions. "Lending library keeps a stock of books. Each member can look on shelves to select a copy to borrow. Then take out a number of books, up to a certain limit. After a given period of time, library expects members to return the books. When borrowing books, a member is expected to wait in queue, then to hand their chosen books to the librarian, who records each new loan before issuing the books to the member. After that the librarian will prepare for next member in the queue. When a book is on loan to a member, it is associated with that member: possession of the book passes from the library to the member for a defined period. The normal loan period for each book is two weeks. If the member fails to bring the book back on or before the due date, the library imposes a fine." a. What are the business processes and business rules in the above system? Business processes Find book on a shelf; wait in the queue; issue a book, and return a book. Business rules characterize the way the business operates: There is a limit to the number of books a member can take out. A loan is for a period that is normally two weeks. Late returns incur a fine. b. Draw the activity diagram of issuing a book in the above library system uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 19 Example 6: Assume below activity diagram of returning a copy of a book to library. List sequence of activities with showing roles of people One possible solution is: a) The member brings the book back into the library. b) The member will join the queue till the librarian record the returned book, c) As soon as the librarian finishes the process, the member leaves the queue. d) The librarian will put the book aside and prepare for next member in the queue. uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 20 Use case model: "what a system should do"; it is basis for contract between customers, developer. Use case diagrams: show the main tasks and related users. The main elements in use case diagram: 1. Use cases: something done by actor on system, a way of capturing functional requirements (task). 2. Actor (user of a system): a person or another system that communicate with the developed system. 3. An association is a relationship between (actor and use case) - Actor is someone or something that is external to intended system. Use case diagram can help in(purpose) : Capturing and eliciting requirements. - modeling requirements. Planning iterations of development. - Validating software systems. Use case diagram can be an aid on: Defining the scope of a system, project planning and quality assurance, acting as a discussion tool between developer and user. Example 8: Hotel chain that Involves main tasks in a hotel system: make reservation, check-in, and check-out, where the reservation can be done by the receptionist or a guest by phone or through Web. Example 9: Upon arrival, each guest provides reservation number for his or her reservation to the hotel’s receptionist, who enters it into the software system. System reveals the details of that reservation so that each guest can confirm them. System allocates a room to that guest and opens a bill, The receptionist issues a key for the room. What pre and post condition you can obtain from above description of check in process: Precondition: guest has a reservation, at least one room available and guest be able to pay for room. Post-condition: guest allocated to a room, room identified as being in use, a bill is opened and a key issued. uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 21 Use case example: A scenario is a sequence of interactions between system and some actors, there are two types: a) Main success scenario: system makes a reservation for the guest as he look for. b) Unsuccessful scenario: System presents option to guest, who rejects it. c) Exceptions: when actors cancel a use case without completing it. A scenario is an instance of a use case. When a guest checks into a hotel in person, receptionist performs check in process, and guest is passive. In some cases a relationship between actors which could be represented as generalization. uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 22 A stereotype is a way of attaching extra classifications to a model, it describe relationship between original use cases and new ones, There are two very important forms of relationship between use cases: 1. «include» stereotype (common task): two or more use cases have an overlapping area of functionality. The new use case can then be used by each of the original use cases, avoiding duplication. 1. «extend» stereotype(alternative) is when a use case has a main success scenario but also alternative scenarios– different or additional actions, an extension is conditional while an inclusion is not. The main disadvantage additional complexity it brings to a model. Example for «include»: represents sharing (common) behavior between use cases, where a use case is reused. Example 9: Members of a lending library can borrow a number of books and, he can extend loan period. Before librarian can issue a copy of a book to a member, there must be a check to make sure that there are no existing reservations for the book by others. Same check needed when a member presents a book to librarian for renewal. Reservation check is a shared behavior, a common scenario, developed separately as check reservation use case. Unconditional behavior –reservation check must be performed whenever a loan is extended or a book is issued. Example for «extend»: alternatives to main scenario, it indicates a conditional extension to original use case. The new use case (Alternative one) depends on the original. This is conditional behavior. Example 10: lending library will set an upper limit on number of books that its members can borrow at any one time. A librarian will not be allowed to issue a copy of a book if that limit would be exceeded. Figure 11 shows a fragment of a use case diagram that identifies a new use case, refuse loan, as it is only performed when the member would have too many books. (Compare this with the unconditional behavior associated with an «include» dependency.) Note: refuse loan is a conditional behavior which is only performed when member would have too many books. uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 23 3. How to Avoiding over-complex use case diagrams?(Reduce the complexity of diagram by: ) -Redrawing it at a higher abstraction. - Splitting it up into smaller modules that UML calls packages. What are Problems with use cases? 1. The focus may end up being top-down, resulting in an inflexible and difficult-to-maintain system 2. Difficulties in deciding the size and scope of each use case. 3. Focusing on the requirements in a use case may cause developers to view the system too operationally; Developers need to distinguish between requirements and preferred designs. 4. a danger of missing some of the requirements, 5. It needs to be used in a way understandable to the customer but also useful to the developers. To extends or include Exam Question: UML notation, the diagrams below are correct (they illustrate also same scenario). However, one of them has a main advantage over the other. State this advantage [3 marks]. In the second diagram, it would be difficult for the reader to see the intended purpose of the system, because we have shifted the emphasis to action of logging on and away from the primary functions. So although this is grammatically correct in UML, the second diagram probably makes less sense than the first diagram uwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor. 965) 2572 6686 - 2571 4343 (965) 2571 0775 [email protected] 1 Unit 9: Architecture, patterns and reuse What is software architecture? It is the structure of the system, which comprises software elements, the externally visible properties of those elements, and the relationships among them. 1. Client–server architecture, with the web browser client sending a request to a web server and receiving a response; and a LAMP stack platform. 2. A layered architecture. There are three layers, corresponding to the client, the web server that constructs the response and the database storage. A mixture of architectures: is the LAMP stack, (four open-source technologies). − Linux, Apache webserver, MySQL database, PHP (or Python or Perl – other languages). 3. Internet telephony service (skype) a. Small circles represent individual users. b. To go online a user contact a login server (dotted line) c. then connected to the nearest super nodes, d. Then route telephone calls from user to another It is also possible for 2 users to be connected directly Skype is all proprietary: users must download it and cannot use alternative software from third parties. Peer-to-peer (P2P): no clear distinction between clients and servers o Skype now has a mixed P2P and client– server architecture o It means nonfunctional requirement (reliability) can have a major effect on architecture. 4. Pipe-and-filter or data flow o The Windows supports some commands that allow us to process data o If we will produce a list of all the elements that begin with 'P' ( findstr/b "P" elements.txt) o The output from one filter can be ‘piped’ to another channel , The two filters each perform an independent chunk of processing and are not aware of one another. [email protected] +965 97670818 2 The twin peaks of architecture and requirements Twin-peaks model gives equal importance to requirements & architecture and uses an extension of the spiral process, to answer criticism often made that agile does not scale up to larger projects. Can architecture and agile live together? o Architecturally approach very early (what main elements of system are and how they will interact). o Agile approaches emphasize being adaptive & delaying decisions for as long as possible. Architecturally significant requirements (ASR) o What four characteristics that can be used at gathering requirements to help identify (ASRs)? 1. Quality attributes: NFR such as security, reliability, usability, maintainability, portability and so on. 2. Core features: "problem to solve’. 3. Constraints: client specified a programming language or non-technical constraints such as budget. 4. Application environment: in which the system will run. (Navigation app needs GPS connectivity). Architectural views (4+1 model’) by Kruchten 1. The logical (functional) view describes system’s functional elements, services provided. 2. The process view describes the set of independently executing processes at run-time. 3. The physical (deployment) view describes how the system will be deployed to an environment. 4. The development view describes how split software into subsystems allocated to team. TM354 view set comprises the following: 1. The logical view describes the main functional elements and how they interact. 2. The process view describes the independent processes executing at runtime. 3. The deployment view describing how the system will be deployed to an operating environment. Stakeholders, views and viewpoints [email protected] +965 97670818 3 Reuse: A major aspiration of software engineering is reuse – taking what you or others have done or created in the past and using it either unchanged or with relatively little adaptation. Why reuse is desirable? 1. It avoids duplication of effort, which saves resources. 2. It promotes reliability because developers can use tried and trusted solutions. 3. It speeds up development (no need to start from the beginning) 4. It is a mechanism for spreading good practice among software development community. Reuse on different levels, it can involve 1. Requirements patterns Knowledge in the elicitation of requirements, known as 2. Analysis patterns ways of solving conceptual analysis problems, known as 3. Architecture reusing a structural idea or creation of a series of systems (same basic architecture). 4. Design patterns: ways of solving particular problems of design and implementation. 5. Idioms ways of doing things in a particular language –(small units of reuse) Section 4: Reusing architecture : number of plans used in software architecture; architectural styles. 1- Client–server 2- Call-return caller makes a procedure call to another component and waits for the call to return server waits for requests from clients, processes, In OOP call is a method invocation by one object on and returns a response to the client another by the sending of a message 3- Layered: series of layers stacked on top of another 4- Peer-to-peer: resembles the client–server style except that all the components are both clients and servers Each layer uses services provided by layers below and supplies services to above layer, No comm between components in same layer 5- Data flow (pipes and filters): small independent subprograms process a stream of data and pass the results on to other components for further processing. Communication is unidirectional and uses fixed channels. Each filter has no knowledge of other filters [email protected] +965 97670818 4 6- Data-centered: centralized store of persistent data b- Blackboard: the store is active and informs The types of items and their relationships are stable and users of changes, so that communication change rarely or not at all. may be initiated from either end. The central store may be duplicated, to provide backup in case of failure There are two forms of the data-centred style a- Database 7- Independent components: it execute 8- Service-oriented concurrently and are decoupled as far as possible, a set of service providers makes services available but can communicate by messages that allow to a set of service consumers. them to exchange data or coordinate their operations. some cases communication is facilitated by a virtual communication channel called an Enterprise Service Bus (ESB) 9- Notification (publish– subscribe) two kinds of components are observers and subjects. Observers can register themselves with a subject in order to be kept notified whenever some particular event happens at the subject’s end. Subscribers register to receive updates (often messages) whenever a publisher posts a new item. [email protected] +965 97670818 5 Frameworks: It may be possible to reuse a large part of the architecture; along with any code the systems have in common, Frameworks: Segments of architecture and code that can be reused The framework is accompanied by documentation giving the details of how it is used. ◦ An example is the Java Swing framework Product lines: Reuse reference architectures, software components and expertise about the variations needed to fulfils customer requirements. For example, engines in motor cars are controlled by an on-board computer that uses quite sophisticated software. Different engines and cars require slightly different engine -control software, but all engine controllers are essentially the same. The product-line process: 1. Product-line initiation 2. Domain analysis 3. Architecture specification 4. Component collection 5. Specific-requirements capture 6. Architecture specialization 7. Component selection and specialization: Section 5: Reusing design:Adapter design pattern A very common situation is to have a client that expects to make calls to a particular interface but then find it needs to work with a class that has a different interface. o The pattern uses inheritance – an Adapter is a Square. o The pattern uses composition (an association) – an Adapter has a RoundedSquare as an attribute. o These two mechanisms are fundamental to design patterns Adapter pattern does. o Adapter is transparent to other classes neither Client nor RoundedSquare is aware of its existence. Interfaces: is not a class and doesn’t define any implementation for its operations, only their signatures A class can realize multiple interfaces, in which case the class has to declare all the operations found in all the interfaces, although it may also have additional operations. [email protected] +965 97670818 6 [email protected] +965 97670818 7 [email protected] +965 97670818 8 [email protected] +965 97670818 9 [email protected] +965 97670818 10 [email protected] +965 97670818 11 Revision Unit 9 (from exams): Exam1 Q1: Describe