Software Engineering Lecture 02: Software Processes PDF
Document Details
Mansoura University
2024
Muhammad Haggag, Ph.D.
Tags
Summary
These lecture notes cover software engineering concepts, specifically focusing on software processes. The document details different process models, activities like specification, design, and implementation, and change management strategies. This material is most relevant to undergraduate computer science students.
Full Transcript
Software Engineering Lecture 02: Software Processes Muhammad Haggag, Ph.D. Computer Science Department Faculty of Computers and Information Mansoura University Fall 2024 Topics covered Software process models Process activities Coping...
Software Engineering Lecture 02: Software Processes Muhammad Haggag, Ph.D. Computer Science Department Faculty of Computers and Information Mansoura University Fall 2024 Topics covered Software process models Process activities Coping with change 2 The software process A structured set of activities required to develop a software system. Many different software processes but all involve: Specification – involves defining the functionality and any constraints on its operation; Design and implementation – defining the organization of the system and implementing the system; Validation – checking that it does what the customer wants; Evolution – changing the system in response to changing customer needs. A software process model is an abstract representation of a process. It presents a description of a process from some particular perspective. 3 Software process descriptions When we describe and discuss processes, we usually talk about the activities in these processes such as specifying a data model, designing a user interface, etc. and the ordering of these activities. Process descriptions may also include: Products, which are the outcomes of a process activity; Roles, which reflect the responsibilities of the people involved in the process; Pre- and post-conditions, which are statements that are true before and after a process activity has been enacted or a product produced. 4 Plan-driven and agile processes Plan-driven processes are processes where all of the process activities are planned in advance and progress is measured against this plan. In agile processes, planning is incremental and it is easier to change the process to reflect changing customer requirements. In practice, most practical processes include elements of both plan-driven and agile approaches. There are no right or wrong software processes. No One-Size-Fits-All: There is no universally "right" or "wrong" software process. The effectiveness of a particular approach depends on the project context, team dynamics, and customer needs. Choosing the Right Approach: Organizations should evaluate their projects and environments to determine the best blend of plan-driven and agile practices, leveraging the strengths of each to achieve successful outcomes. 5 Software process models 6 Software process models The waterfall model Plan-driven model. Separate and distinct phases of specification and development. Incremental development Specification, development and validation are interleaved. May be plan- driven or agile. Integration and configuration The system is assembled from existing configurable components. May be plan-driven or agile. In practice, most large systems are developed using a process that incorporates elements from all of these models. 7 The waterfall model 8 Waterfall model phases There are separate identified phases in the waterfall model: Requirements analysis and definition Establishes the system's services, constraints, and goals through consultations with users. System and software design Allocates requirements to hardware and software, establishing the overall system architecture. Implementation and unit testing Translates the software design into actual programs or units. Integration and system testing Integrates individual units or programs into a complete system. Operation and maintenance Represents the longest phase, where the system is installed and used in practice. The main drawback of the waterfall model is the difficulty of accommodating change after the process is underway. In principle, a phase has to be complete before moving onto the next phase. 9 Waterfall model problems Inflexible partitioning of the project into distinct stages makes it difficult to respond to changing customer requirements. Therefore, this model is only appropriate when the requirements are well- understood and changes will be fairly limited during the design process. Few business systems have stable requirements. 10 Incremental development 11 Example Project: Online Bookstore Incremental Development Goal: Develop an online bookstore in increments. Increment 1: Basic User Authentication Tasks: Create a login and registration page. Increment 2: Product Catalog Tasks: Implement a product listing page to display books with titles, authors, and prices. Increment 3: Shopping Cart Tasks: Add functionality to allow users to add books to a shopping cart and view their selections. Increment 4: Checkout Process Tasks: Implement payment processing and order confirmation. Concurrent Activities Team Structure: Frontend Team: Works on user interface design and implementation. Backend Team: Handles server-side logic and database interactions. QA Team: [Quality Assurance] Conducts testing on features as they’re completed. Concurrent Tasks: While the Frontend Team is working on the product catalog, the Backend Team can develop the API for fetching book data. Meanwhile, the QA Team prepares test cases for user authentication. Incremental Development: Feedback is typically gathered after each increment is completed, influencing future increments. Agile Development: Feedback is collected continuously and can lead to immediate adjustments within the same sprint. 12 Incremental development benefits The cost of accommodating changing customer requirements is reduced. The amount of analysis and documentation that has to be redone is much less than is required with the waterfall model. It is easier to get customer feedback on the development work that has been done. Customers can comment on demonstrations of the software and see how much has been implemented. More rapid delivery and deployment of useful software to the customer is possible. Customers are able to use and gain value from the software earlier than is possible with a waterfall process. 13 Incremental development problems The process is not visible. Managers need regular deliverables to measure progress. If systems are developed quickly, it is not cost-effective to produce documents that reflect every version of the system. System structure tends to degrade as new increments are added. Unless time and money is spent on refactoring to improve the software, regular change tends to corrupt its structure. Incorporating further software changes becomes increasingly difficult and costly. Refactoring refers to the process of restructuring existing code without changing its external behavior. The primary goal of refactoring is to improve the code's internal structure, making it cleaner, more efficient, and easier to understand and maintain. 14 Integration and configuration Based on software reuse where systems are integrated from existing components or application systems (sometimes called COTS -Commercial-off-the-shelf) systems). Reused elements may be configured to adapt their behaviour and functionality to a user’s requirements Reuse is now the standard approach for building many types of business system. 15 Types of reusable software Stand-alone application systems (sometimes called COTS) that are configured for use in a particular environment. Microsoft Office Suite - These applications can be configured for specific user needs (e.g., setting up templates, customizing toolbars) Collections of objects that are developed as a package to be integrated with a component framework such as.NET or J2EE. Web services that are developed according to service standards and which are available for remote invocation. Amazon Web Services (AWS). AWS provides a range of web services, such as Amazon S3 (for storage) and Amazon EC2 (for computing). 16 Reuse-oriented software engineering 17 Key process stages Requirements specification Software discovery and evaluation Requirements refinement Application system configuration There is an off-the-shelf application system that meets the requirements is available Component adaptation and integration There is no off-the-shelf system. 18 Advantages and disadvantages Reduced costs and risks as less software is developed from scratch Faster delivery and deployment of system But requirements compromises are inevitable so system may not meet real needs of users Loss of control over evolution of reused system elements refers to the challenges and risks associated with integrating and relying on external or previously developed components in software systems. Incompatibility Issues: As the reused components evolve independently, they may become incompatible with other parts of the system or with newer technologies Vendor Lock-In: making it difficult for organizations to switch to alternative solutions if they need to change direction or if the vendor's offerings no longer meet their needs. Impact on Development Agility: The need to manage external components can slow down development processes. Teams may need to spend additional time coordinating updates and ensuring compatibility rather than focusing on building new features. 19 End of Lecture 02 2024-10-20 20 Process activities Process Activities: Concerned with the specific tasks performed during development. Software Process Models: Concerned with the overall framework and structure for managing those tasks. 21 Process activities Real software processes are inter-leaved sequences of technical, collaborative and managerial activities with the overall goal of specifying, designing, implementing and testing a software system. The four basic process activities of specification, development, validation and evolution are organized differently in different development processes. For example, in the waterfall model, they are organized in sequence, whereas in incremental development they are interleaved. 22 The requirements engineering process 23 Software specification The process of establishing what services are required and the constraints on the system’s operation and development. Requirements engineering process Requirements elicitation and analysis What do the system stakeholders require or expect from the system? Conduct interviews, surveys, and workshops with stakeholders. Requirements specification Defining the requirements in detail Create specifications that outline functional and non-functional requirements, user stories, or use cases. Requirements validation Checking the validity of the requirements Perform testing or validation methods (e.g., prototyping , model validation ) to confirm requirements are feasible and achievable. 24 Requirements vs Specification Requirements focus on what the system should achieve. Customer need Specification focuses on how those requirements will be fulfilled Technical description Example 1: User Authentication System Requirements: The system shall allow users to create an account using an email address and password. UML used: Use Case, Activity Diagrams Specification: 1. Account Creation: 1. Input: User inputs email and password. 2. Output: A confirmation email is sent to the user. 3. Validation: Email must be in a valid format, and password must meet complexity requirements (at least 8 characters, one uppercase letter, one number). UML used: Class, Sequence, Component Diagrams 25 Software design and implementation The process of converting the system specification into an executable system. Software design Design a software structure that realises the specification; Create design diagrams (e.g., UML diagrams) to visualize the system's structure. Implementation Translate this structure into an executable program; Write the actual source code based on the design specifications. The activities of design and implementation are closely related and may be inter-leaved. 26 A general model of the design process 27 Design activities Architectural design, where you identify the overall structure of the system, the principal components (subsystems or modules), their relationships and how they are distributed. Online Bookstore System : User Interface Module/Catalog Module/Order Processing Module Database design, where you design the system data structures and how these are to be represented in a database. Users / Books / Orders tables Interface design, where you define the interfaces between system components. Interface between User Interface Module and Catalog Module: Method: getBookList() - Parameters: None - Response: List of available books with details (ID, title, price). Component selection and design, where you search for reusable components. If unavailable, you design how it will operate. Reusable Component: Use a third-party payment processing API (e.g., Stripe) for handling payments. New Component: Design an Inventory Management Component to track stock levels and manage reordering. 28 System implementation The software is implemented either by developing a program or programs or by configuring an application system. Design and implementation are interleaved activities for most types of software system. Programming is an individual activity with no standard process. Debugging is the activity of finding program faults and correcting these faults. 29 Software validation Verification and validation (V & V) is intended to show that a system conforms to its specification and meets the requirements of the system customer. Involves checking and review processes and system testing. System testing involves executing the system with test cases that are derived from the specification of the real data to be processed by the system. Testing is the most commonly used V & V activity. 30 Stages of testing 31 Testing stages Component testing Individual components are tested independently; Components may be functions or objects or coherent groupings of these entities. System testing Testing of the system as a whole. Testing of emergent properties is particularly important. Customer testing Testing with customer data to check that the system meets the customer’s needs. 32 Testing phases in a plan-driven software process (V-model) 33 Software evolution Software is inherently flexible and can change. As requirements change through changing business circumstances, the software that supports the business must also evolve and change. Although there has been a demarcation ترسيم الحدودbetween development and evolution (maintenance) this is increasingly irrelevant as fewer and fewer systems are completely new. Technology Trends: The shift to microservices allows for more flexible evolution of applications instead of creating entirely new ones. Rapid Prototyping: Creating prototypes and iterating based on user interaction often leads to significant changes. Organizations focus on refining what they have, leading to fewer brand-new systems Refactoring: Refactoring existing code [Legacy system] for better performance or scalability is a common practice, effectively turning maintenance activities into new development efforts. 34 System evolution Rather than two separate processes, it is more realistic to think of software engineering as an evolutionary process Continuous Evolution: Ongoing Changes: Software is not static; it continually evolves to meet changing requirements, adapt to new technologies, and address user feedback. This makes maintenance an integral part of the software lifecycle. 35 36 Coping with change 37 Coping with change Change is inevitable in all large software projects. Business changes lead to new and changed system requirements New technologies open up new possibilities for improving implementations Changing platforms require application changes Change leads to rework so the costs of change include both rework (e.g. re-analysing requirements) as well as the costs of implementing new functionality 38 Reducing the costs of rework Change anticipation, where the software process includes activities that can anticipate possible changes before significant rework is required. For example, a prototype system may be developed to show some key features of the system to customers. Change tolerance, where the process is designed so that changes can be accommodated at relatively low cost. This normally involves some form of incremental development. Proposed changes may be implemented in increments that have not yet been developed. If this is impossible, then only a single increment (a small part of the system) may have be altered to incorporate the change. 39 Coping with changing requirements System prototyping, where a version of the system or part of the system is developed quickly to check the customer’s requirements and the feasibility of design decisions. This approach supports change anticipation. Incremental delivery, where system increments are delivered to the customer for comment and experimentation. This supports both change avoidance and change tolerance. 40 Software prototyping A prototype is an initial version of a system used to demonstrate concepts and try out design options. A prototype can be used in: The requirements engineering process to help with requirements elicitation and validation; In design processes to explore options and develop a UI design; In the testing process to run back-to-back tests. 41 Benefits of prototyping Improved system usability. A closer match to users’ real needs. Improved design quality. Improved maintainability. Reduced development effort. 42 The process of prototype development 43 Prototype development May be based on rapid prototyping languages or tools May involve leaving out functionality Prototype should focus on areas of the product that are not well- understood; Error checking and recovery may not be included in the prototype; Focus on functional rather than non-functional requirements such as reliability and security 44 Throw-away prototypes Prototypes should be discarded after development as they are not a good basis for a production system: It may be impossible to tune the system to meet non-functional requirements; Prototypes are normally undocumented; The prototype structure is usually degraded through rapid change; The prototype probably will not meet normal organisational quality standards. 45 Incremental delivery Rather than deliver the system as a single delivery, the development and delivery is broken down into increments with each increment delivering part of the required functionality. User requirements are prioritised and the highest priority requirements are included in early increments. Once the development of an increment is started, the requirements are frozen though requirements for later increments can continue to evolve. 46 https://shorturl.at/nx6nD 47 Thank you 48