هندسة برمجيات.pdf

Full Transcript

Chapter 1- Introduction 30/10/2014 Chapter 1 Introduction 1 Topics covered  Professional software development ▪ What is meant by software engineering.  Software engineering ethics ▪ A brief introduction to ethical issues that affect software engineering.  Case stu...

Chapter 1- Introduction 30/10/2014 Chapter 1 Introduction 1 Topics covered  Professional software development ▪ What is meant by software engineering.  Software engineering ethics ▪ A brief introduction to ethical issues that affect software engineering.  Case studies ▪ An introduction to three examples that are used in later chapters in the book. 30/10/2014 Chapter 1 Introduction 2 Software engineering  The economies of ALL developed nations are dependent on software.  More and more systems are software controlled  Software engineering is concerned with theories, methods and tools for professional software development.  Expenditure on software represents a significant fraction of GNP in all developed countries. 30/10/2014 Chapter 1 Introduction 3 Software costs  Software costs often dominate computer system costs. The costs of software on a PC are often greater than the hardware cost.  Software costs more to maintain than it does to develop. For systems with a long life, maintenance costs may be several times development costs.  Software engineering is concerned with cost-effective software development. 30/10/2014 Chapter 1 Introduction 4 Software project failure  Increasing system complexity ▪ As new software engineering techniques help us to build larger, more complex systems, the demands change. Systems have to be built and delivered more quickly; larger, even more complex systems are required; systems have to have new capabilities that were previously thought to be impossible.  Failure to use software engineering methods ▪ It is fairly easy to write computer programs without using software engineering methods and techniques. Many companies have drifted into software development as their products and services have evolved. They do not use software engineering methods in their everyday work. Consequently, their software is often more expensive and less reliable than it should be. 30/10/2014 Chapter 1 Introduction 5 Professional software development 30/10/2014 Chapter 1 Introduction 6 Frequently asked questions about software engineering Question Answer What is software? Computer programs and associated documentation. Software products may be developed for a particular customer or may be developed for a general market. What are the attributes of good software? Good software should deliver the required functionality and performance to the user and should be maintainable, dependable and usable. What is software engineering? Software engineering is an engineering discipline that is concerned with all aspects of software production. What are the fundamental software Software specification, software development, software engineering activities? validation and software evolution. What is the difference between software Computer science focuses on theory and fundamentals; engineering and computer science? software engineering is concerned with the practicalities of developing and delivering useful software. What is the difference between software System engineering is concerned with all aspects of engineering and system engineering? computer-based systems development including hardware, software and process engineering. Software engineering is part of this more general process. 30/10/2014 Chapter 1 Introduction 7 Frequently asked questions about software engineering Question Answer What are the key challenges facing Coping with increasing diversity, demands for reduced software engineering? delivery times and developing trustworthy software. What are the costs of software Roughly 60% of software costs are development costs, engineering? 40% are testing costs. For custom software, evolution costs often exceed development costs. What are the best software engineering While all software projects have to be professionally techniques and methods? managed and developed, different techniques are appropriate for different types of system. For example, games should always be developed using a series of prototypes whereas safety critical control systems require a complete and analyzable specification to be developed. You can’t, therefore, say that one method is better than another. What differences has the web made to The web has led to the availability of software services software engineering? and the possibility of developing highly distributed service- based systems. Web-based systems development has led to important advances in programming languages and software reuse. 30/10/2014 Chapter 1 Introduction 8 Software products  Generic products ▪ Stand-alone systems that are marketed and sold to any customer who wishes to buy them. ▪ Examples – PC software such as graphics programs, project management tools; CAD software; software for specific markets such as appointments systems for dentists.  Customized products ▪ Software that is commissioned by a specific customer to meet their own needs. ▪ Examples – embedded control systems, air traffic control software, traffic monitoring systems. 30/10/2014 Chapter 1 Introduction 9 Product specification  Generic products ▪ The specification of what the software should do is owned by the software developer and decisions on software change are made by the developer.  Customized products ▪ The specification of what the software should do is owned by the customer for the software and they make decisions on software changes that are required. 30/10/2014 Chapter 1 Introduction 10 Essential attributes of good software Product characteristic Description Maintainability Software should be written in such a way so that it can evolve to meet the changing needs of customers. This is a critical attribute because software change is an inevitable requirement of a changing business environment. Dependability and Software dependability includes a range of characteristics security including reliability, security and safety. Dependable software should not cause physical or economic damage in the event of system failure. Malicious users should not be able to access or damage the system. Efficiency Software should not make wasteful use of system resources such as memory and processor cycles. Efficiency therefore includes responsiveness, processing time, memory utilisation, etc. Acceptability Software must be acceptable to the type of users for which it is designed. This means that it must be understandable, usable and compatible with other systems that they use. 30/10/2014 Chapter 1 Introduction 11 Software engineering  Software engineering is an engineering discipline that is concerned with all aspects of software production from the early stages of system specification through to maintaining the system after it has gone into use.  Engineering discipline ▪ Using appropriate theories and methods to solve problems bearing in mind organizational and financial constraints.  All aspects of software production ▪ Not just technical process of development. Also project management and the development of tools, methods etc. to support software production. 30/10/2014 Chapter 1 Introduction 12 Importance of software engineering  More and more, individuals and society rely on advanced software systems. We need to be able to produce reliable and trustworthy systems economically and quickly.  It is usually cheaper, in the long run, to use software engineering methods and techniques for software systems rather than just write the programs as if it was a personal programming project. For most types of system, the majority of costs are the costs of changing the software after it has gone into use. 30/10/2014 Chapter 1 Introduction 13 Software process activities  Software specification, where customers and engineers define the software that is to be produced and the constraints on its operation.  Software development, where the software is designed and programmed.  Software validation, where the software is checked to ensure that it is what the customer requires.  Software evolution, where the software is modified to reflect changing customer and market requirements. 30/10/2014 Chapter 1 Introduction 14 General issues that affect software  Heterogeneity ▪ Increasingly, systems are required to operate as distributed systems across networks that include different types of computer and mobile devices.  Business and social change ▪ Business and society are changing incredibly quickly as emerging economies develop and new technologies become available. They need to be able to change their existing software and to rapidly develop new software. 30/10/2014 Chapter 1 Introduction 15 General issues that affect software  Security and trust ▪ As software is intertwined with all aspects of our lives, it is essential that we can trust that software.  Scale ▪ Software has to be developed across a very wide range of scales, from very small embedded systems in portable or wearable devices through to Internet-scale, cloud-based systems that serve a global community. 30/10/2014 Chapter 1 Introduction 16 Software engineering diversity  There are many different types of software system and there is no universal set of software techniques that is applicable to all of these.  The software engineering methods and tools used depend on the type of application being developed, the requirements of the customer and the background of the development team. 30/10/2014 Chapter 1 Introduction 17 Application types  Stand-alone applications ▪ These are application systems that run on a local computer, such as a PC. They include all necessary functionality and do not need to be connected to a network.  Interactive transaction-based applications ▪ Applications that execute on a remote computer and are accessed by users from their own PCs or terminals. These include web applications such as e-commerce applications.  Embedded control systems ▪ These are software control systems that control and manage hardware devices. Numerically, there are probably more embedded systems than any other type of system. 30/10/2014 Chapter 1 Introduction 18 Application types  Batch processing systems ▪ These are business systems that are designed to process data in large batches. They process large numbers of individual inputs to create corresponding outputs.  Entertainment systems ▪ These are systems that are primarily for personal use and which are intended to entertain the user.  Systems for modeling and simulation ▪ These are systems that are developed by scientists and engineers to model physical processes or situations, which include many, separate, interacting objects. 30/10/2014 Chapter 1 Introduction 19 Application types  Data collection systems ▪ These are systems that collect data from their environment using a set of sensors and send that data to other systems for processing.  Systems of systems ▪ These are systems that are composed of a number of other software systems. 30/10/2014 Chapter 1 Introduction 20 Software engineering fundamentals  Some fundamental principles apply to all types of software system, irrespective of the development techniques used: ▪ Systems should be developed using a managed and understood development process. Of course, different processes are used for different types of software. ▪ Dependability and performance are important for all types of system. ▪ Understanding and managing the software specification and requirements (what the software should do) are important. ▪ Where appropriate, you should reuse software that has already been developed rather than write new software. 30/10/2014 Chapter 1 Introduction 21 Internet software engineering  The Web is now a platform for running application and organizations are increasingly developing web-based systems rather than local systems.  Web services (discussed in Chapter 19) allow application functionality to be accessed over the web.  Cloud computing is an approach to the provision of computer services where applications run remotely on the ‘cloud’. ▪ Users do not buy software but pay according to use. 30/10/2014 Chapter 1 Introduction 22 Web-based software engineering  Web-based systems are complex distributed systems but the fundamental principles of software engineering discussed previously are as applicable to them as they are to any other types of system.  The fundamental ideas of software engineering apply to web-based software in the same way that they apply to other types of software system. 30/10/2014 Chapter 1 Introduction 23 Web software engineering  Software reuse ▪ Software reuse is the dominant approach for constructing web- based systems. When building these systems, you think about how you can assemble them from pre-existing software components and systems.  Incremental and agile development ▪ Web-based systems should be developed and delivered incrementally. It is now generally recognized that it is impractical to specify all the requirements for such systems in advance. 30/10/2014 Chapter 1 Introduction 24 Web software engineering  Service-oriented systems ▪ Software may be implemented using service-oriented software engineering, where the software components are stand-alone web services.  Rich interfaces ▪ Interface development technologies such as AJAX and HTML5 have emerged that support the creation of rich interfaces within a web browser. 30/10/2014 Chapter 1 Introduction 25 Software engineering ethics 30/10/2014 Chapter 1 Introduction 26 Software engineering ethics  Software engineering involves wider responsibilities than simply the application of technical skills.  Software engineers must behave in an honest and ethically responsible way if they are to be respected as professionals.  Ethical behaviour is more than simply upholding the law but involves following a set of principles that are morally correct. 30/10/2014 Chapter 1 Introduction 27 Issues of professional responsibility  Confidentiality(privacy) ▪ Engineers should normally respect the confidentiality of their employers or clients irrespective of whether or not a formal confidentiality agreement has been signed.  Competence(specialization) ▪ Engineers should not misrepresent their level of competence. They should not knowingly accept work that is outside their competence. 30/10/2014 Chapter 1 Introduction 28 Issues of professional responsibility  Intellectual property rights ▪ Engineers should be aware of local laws governing the use of intellectual property such as patents, copyright, etc. They should be careful to ensure that the intellectual property of employers and clients is protected.  Computer misuse ▪ Software engineers should not use their technical skills to misuse other people’s computers. Computer misuse ranges from relatively trivial (game playing on an employer’s machine, say) to extremely serious (dissemination of viruses). 30/10/2014 Chapter 1 Introduction 29 ACM/IEEE Code of Ethics  The professional societies in the US have cooperated to produce a code of ethical practice.  Members of these organisations sign up to the code of practice when they join.  The Code contains eight Principles related to the behaviour of and decisions made by professional software engineers, including practitioners, educators, managers, supervisors and policy makers, as well as trainees and students of the profession. 30/10/2014 Chapter 1 Introduction 30 Rationale for the code of ethics ▪ Computers have a central and growing role in commerce, industry, government, medicine, education, entertainment and society at large. Software engineers are those who contribute by direct participation or by teaching, to the analysis, specification, design, development, certification, maintenance and testing of software systems. ▪ Because of their roles in developing software systems, software engineers have significant opportunities to do good or cause harm, to enable others to do good or cause harm, or to influence others to do good or cause harm. To ensure, as much as possible, that their efforts will be used for good, software engineers must commit themselves to making software engineering a beneficial and respected profession. 30/10/2014 Chapter 1 Introduction 31 The ACM/IEEE Code of Ethics Software Engineering Code of Ethics and Professional Practice ACM/IEEE-CS Joint Task Force on Software Engineering Ethics and Professional Practices PREAMBLE The short version of the code summarizes aspirations at a high level of the abstraction; the clauses that are included in the full version give examples and details of how these aspirations change the way we act as software engineering professionals. Without the aspirations, the details can become legalistic and tedious; without the details, the aspirations can become high sounding but empty; together, the aspirations and the details form a cohesive code. Software engineers shall commit themselves to making the analysis, specification, design, development, testing and maintenance of software a beneficial and respected profession. In accordance with their commitment to the health, safety and welfare of the public, software engineers shall adhere to the following Eight Principles: 30/10/2014 Chapter 1 Introduction 32 Ethical principles 1. PUBLIC - Software engineers shall act consistently with the public interest. 2. CLIENT AND EMPLOYER - Software engineers shall act in a manner that is in the best interests of their client and employer consistent with the public interest. 3. PRODUCT - Software engineers shall ensure that their products and related modifications meet the highest professional standards possible. 4. JUDGMENT - Software engineers shall maintain integrity and independence in their professional judgment. 5. MANAGEMENT - Software engineering managers and leaders shall subscribe to and promote an ethical approach to the management of software development and maintenance. 6. PROFESSION - Software engineers shall advance the integrity and reputation of the profession consistent with the public interest. 7. COLLEAGUES - Software engineers shall be fair to and supportive of their colleagues. 8. SELF - Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession. 30/10/2014 Chapter 1 Introduction 33 Case studies 30/10/2014 Chapter 1 Introduction 34 Ethical dilemmas  Disagreement in principle with the policies of senior management.  Your employer acts in an unethical way and releases a safety-critical system without finishing the testing of the system.  Participation in the development of military weapons systems or nuclear systems. 30/10/2014 Chapter 1 Introduction 35 Case studies  A personal insulin pump ▪ An embedded system in an insulin pump used by diabetics to maintain blood glucose control.  A mental health case patient management system ▪ Mentcare. A system used to maintain records of people receiving care for mental health problems.  A wilderness weather station ▪ A data collection system that collects data about weather conditions in remote areas.  iLearn: a digital learning environment ▪ A system to support learning in schools 30/10/2014 Chapter 1 Introduction 36 Insulin pump control system  Collects data from a blood sugar sensor and calculates the amount of insulin required to be injected.  Calculation based on the rate of change of blood sugar levels.  Sends signals to a micro-pump to deliver the correct dose of insulin.  Safety-critical system as low blood sugars can lead to brain malfunctioning, coma and death; high-blood sugar levels have long-term consequences such as eye and kidney damage. 30/10/2014 Chapter 1 Introduction 37 Insulin pump hardware architecture 30/10/2014 Chapter 1 Introduction 38 Activity model of the insulin pump 30/10/2014 Chapter 1 Introduction 39 Essential high-level requirements  The system shall be available to deliver insulin when required.  The system shall perform reliably and deliver the correct amount of insulin to counteract the current level of blood sugar.  The system must therefore be designed and implemented to ensure that the system always meets these requirements. 30/10/2014 Chapter 1 Introduction 40 Mentcare: A patient information system for mental health care  A patient information system to support mental health care is a medical information system that maintains information about patients suffering from mental health problems and the treatments that they have received.  Most mental health patients do not require dedicated hospital treatment but need to attend specialist clinics regularly where they can meet a doctor who has detailed knowledge of their problems.  To make it easier for patients to attend, these clinics are not just run in hospitals. They may also be held in local medical practices or community centres. 30/10/2014 Chapter 1 Introduction 41 Mentcare  Mentcare is an information system that is intended for use in clinics.  It makes use of a centralized database of patient information but has also been designed to run on a PC, so that it may be accessed and used from sites that do not have secure network connectivity.  When the local systems have secure network access, they use patient information in the database but they can download and use local copies of patient records when they are disconnected. 30/10/2014 Chapter 1 Introduction 42 Mentcare goals  To generate management information that allows health service managers to assess performance against local and government targets.  To provide medical staff with timely information to support the treatment of patients. 30/10/2014 Chapter 1 Introduction 43 The organization of the Mentcare system 30/10/2014 Chapter 1 Introduction 44 Key features of the Mentcare system  Individual care management ▪ Clinicians can create records for patients, edit the information in the system, view patient history, etc. The system supports data summaries so that doctors can quickly learn about the key problems and treatments that have been prescribed.  Patient monitoring ▪ The system monitors the records of patients that are involved in treatment and issues warnings if possible problems are detected.  Administrative reporting ▪ The system generates monthly management reports showing the number of patients treated at each clinic, the number of patients who have entered and left the care system, number of patients sectioned, the drugs prescribed and their costs, etc. 30/10/2014 Chapter 1 Introduction 45 Mentcare system concerns  Privacy ▪ It is essential that patient information is confidential and is never disclosed to anyone apart from authorised medical staff and the patient themselves.  Safety ▪ Some mental illnesses cause patients to become suicidal or a danger to other people. Wherever possible, the system should warn medical staff about potentially suicidal or dangerous patients. ▪ The system must be available when needed otherwise safety may be compromised and it may be impossible to prescribe the correct medication to patients. 30/10/2014 Chapter 1 Introduction 46 Wilderness weather station  The government of a country with large areas of wilderness decides to deploy several hundred weather stations in remote areas.  Weather stations collect data from a set of instruments that measure temperature and pressure, sunshine, rainfall, wind speed and wind direction. ▪ The weather station includes a number of instruments that measure weather parameters such as the wind speed and direction, the ground and air temperatures, the barometric pressure and the rainfall over a 24-hour period. Each of these instruments is controlled by a software system that takes parameter readings periodically and manages the data collected from the instruments.  30/10/2014 Chapter 1 Introduction 47 The weather station’s environment 30/10/2014 Chapter 1 Introduction 48 Weather information system  The weather station system ▪ This is responsible for collecting weather data, carrying out some initial data processing and transmitting it to the data management system.  The data management and archiving system ▪ This system collects the data from all of the wilderness weather stations, carries out data processing and analysis and archives the data.  The station maintenance system ▪ This system can communicate by satellite with all wilderness weather stations to monitor the health of these systems and provide reports of problems. 30/10/2014 Chapter 1 Introduction 49 Additional software functionality  Monitor the instruments, power and communication hardware and report faults to the management system.  Manage the system power, ensuring that batteries are charged whenever the environmental conditions permit but also that generators are shut down in potentially damaging weather conditions, such as high wind.  Support dynamic reconfiguration where parts of the software are replaced with new versions and where backup instruments are switched into the system in the event of system failure. 30/10/2014 Chapter 1 Introduction 50 iLearn: A digital learning environment  A digital learning environment is a framework in which a set of general-purpose and specially designed tools for learning may be embedded plus a set of applications that are geared to the needs of the learners using the system.  The tools included in each version of the environment are chosen by teachers and learners to suit their specific needs. ▪ These can be general applications such as spreadsheets, learning management applications such as a Virtual Learning Environment (VLE) to manage homework submission and assessment, games and simulations. 30/10/2014 Chapter 1 Introduction 51 Service-oriented systems  The system is a service-oriented system with all system components considered to be a replaceable service.  This allows the system to be updated incrementally as new services become available.  It also makes it possible to rapidly configure the system to create versions of the environment for different groups such as very young children who cannot read, senior students, etc. 30/10/2014 Chapter 1 Introduction 52 iLearn services  Utility services that provide basic application- independent functionality and which may be used by other services in the system.  Application services that provide specific applications such as email, conferencing, photo sharing etc. and access to specific educational content such as scientific films or historical resources.  Configuration services that are used to adapt the environment with a specific set of application services and do define how services are shared between students, teachers and their parents. 30/10/2014 Chapter 1 Introduction 53 iLearn architecture 30/10/2014 Chapter 1 Introduction 54 iLearn service integration  Integrated services are services which offer an API (application programming interface) and which can be accessed by other services through that API. Direct service-to-service communication is therefore possible.  Independent services are services which are simply accessed through a browser interface and which operate independently of other services. Information can only be shared with other services through explicit user actions such as copy and paste; re-authentication may be required for each independent service. 30/10/2014 Chapter 1 Introduction 55 Key points  Software engineering is an engineering discipline that is concerned with all aspects of software production.  Essential software product attributes are maintainability, dependability and security, efficiency and acceptability.  The high-level activities of specification, development, validation and evolution are part of all software processes.  The fundamental notions of software engineering are universally applicable to all types of system development. 30/10/2014 Chapter 1 Introduction 56 Key points  There are many different types of system and each requires appropriate software engineering tools and techniques for their development.  The fundamental ideas of software engineering are applicable to all types of software system.  Software engineers have responsibilities to the engineering profession and society. They should not simply be concerned with technical issues.  Professional societies publish codes of conduct which set out the standards of behaviour expected of their members. 30/10/2014 Chapter 1 Introduction 57 Chapter 2 – Software Processes 30/10/2014 Chapter 2 Software Processes 1 Topics covered ✧ Software process models ✧ Process activities ✧ Coping with change ✧ Process improvement 30/10/2014 Chapter 2 Software Processes 2 The software process ✧ A structured set of activities required to develop a software system. ✧ Many different software processes but all involve: ▪ Specification – defining what the system should do; ▪ 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. 30/10/2014 Chapter 2 Software Processes 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. 30/10/2014 Chapter 2 Software Processes 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. 30/10/2014 Chapter 2 Software Processes 5 Software process models 30/10/2014 Chapter 2 Software Processes 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. 30/10/2014 Chapter 2 Software Processes 7 The waterfall model 30/10/2014 Chapter 2 Software Processes 8 Waterfall model phases ✧ There are separate identified phases in the waterfall model: ▪ Requirements analysis and definition ▪ System and software design ▪ Implementation and unit testing ▪ Integration and system testing ▪ Operation and maintenance ✧ 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. 30/10/2014 Chapter 2 Software Processes 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. ✧ The waterfall model is mostly used for large systems engineering projects where a system is developed at several sites. ▪ In those circumstances, the plan-driven nature of the waterfall model helps coordinate the work. 30/10/2014 Chapter 2 Software Processes 10 Incremental development 30/10/2014 Chapter 2 Software Processes 11 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. 30/10/2014 Chapter 2 Software Processes 12 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. 30/10/2014 Chapter 2 Software Processes 13 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 ▪ Reuse covered in more depth in Chapter 15. 30/10/2014 Chapter 2 Software Processes 14 Types of reusable software ✧ Stand-alone application systems (sometimes called COTS) that are configured for use in a particular environment. ✧ 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. 30/10/2014 Chapter 2 Software Processes 15 Reuse-oriented software engineering 30/10/2014 Chapter 2 Software Processes 16 Key process stages ✧ Requirements specification ✧ Software discovery and evaluation ✧ Requirements refinement ✧ Application system configuration ✧ Component adaptation and integration 30/10/2014 Chapter 2 Software Processes 17 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 30/10/2014 Chapter 2 Software Processes 18 Process activities 30/10/2014 Chapter 2 Software Processes 19 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. 30/10/2014 Chapter 2 Software Processes 20 The requirements engineering process 30/10/2014 Chapter 2 Software Processes 21 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? ▪ Requirements specification Defining the requirements in detail ▪ Requirements validation Checking the validity of the requirements 30/10/2014 Chapter 2 Software Processes 22 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; ✧ Implementation ▪ Translate this structure into an executable program; ✧ The activities of design and implementation are closely related and may be inter-leaved. 30/10/2014 Chapter 2 Software Processes 23 A general model of the design process 30/10/2014 Chapter 2 Software Processes 24 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. ✧ Database design, where you design the system data structures and how these are to be represented in a database. ✧ Interface design, where you define the interfaces between system components. ✧ Component selection and design, where you search for reusable components. If unavailable, you design how it will operate. 30/10/2014 Chapter 2 Software Processes 25 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. 30/10/2014 Chapter 2 Software Processes 26 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/10/2014 Chapter 2 Software Processes 27 Stages of testing 30/10/2014 Chapter 2 Software Processes 28 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. 30/10/2014 Chapter 2 Software Processes 29 Testing phases in a plan-driven software process (V-model) 30/10/2014 Chapter 2 Software Processes 30 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. 30/10/2014 Chapter 2 Software Processes 31 System evolution 30/10/2014 Chapter 2 Software Processes 32 Coping with change 30/10/2014 Chapter 2 Software Processes 33 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 30/10/2014 Chapter 2 Software Processes 34 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. 30/10/2014 Chapter 2 Software Processes 35 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. 30/10/2014 Chapter 2 Software Processes 36 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. 30/10/2014 Chapter 2 Software Processes 37 Benefits of prototyping ✧ Improved system usability. ✧ A closer match to users’ real needs. ✧ Improved design quality. ✧ Improved maintainability. ✧ Reduced development effort. 30/10/2014 Chapter 2 Software Processes 38 The process of prototype development 30/10/2014 Chapter 2 Software Processes 39 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 30/10/2014 Chapter 2 Software Processes 40 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. 30/10/2014 Chapter 2 Software Processes 41 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. 30/10/2014 Chapter 2 Software Processes 42 Incremental development and delivery ✧ Incremental development ▪ Develop the system in increments and evaluate each increment before proceeding to the development of the next increment; ▪ Normal approach used in agile methods; ▪ Evaluation done by user/customer proxy. ✧ Incremental delivery ▪ Deploy an increment for use by end-users; ▪ More realistic evaluation about practical use of software; ▪ Difficult to implement for replacement systems as increments have less functionality than the system being replaced. 30/10/2014 Chapter 2 Software Processes 43 Incremental delivery 30/10/2014 Chapter 2 Software Processes 44 Incremental delivery advantages ✧ Customer value can be delivered with each increment so system functionality is available earlier. ✧ Early increments act as a prototype to help elicit requirements for later increments. ✧ Lower risk of overall project failure. ✧ The highest priority system services tend to receive the most testing. 30/10/2014 Chapter 2 Software Processes 45 Incremental delivery problems ✧ Most systems require a set of basic facilities that are used by different parts of the system. ▪ As requirements are not defined in detail until an increment is to be implemented, it can be hard to identify common facilities that are needed by all increments. ✧ The essence of iterative processes is that the specification is developed in conjunction with the software. ▪ However, this conflicts with the procurement model of many organizations, where the complete system specification is part of the system development contract. 30/10/2014 Chapter 2 Software Processes 46 Process improvement 30/10/2014 Chapter 2 Software Processes 47 Process improvement ✧ Many software companies have turned to software process improvement as a way of enhancing the quality of their software, reducing costs or accelerating their development processes. ✧ Process improvement means understanding existing processes and changing these processes to increase product quality and/or reduce costs and development time. 30/10/2014 Chapter 2 Software Processes 48 Approaches to improvement ✧ The process maturity approach, which focuses on improving process and project management and introducing good software engineering practice. ▪ The level of process maturity reflects the extent to which good technical and management practice has been adopted in organizational software development processes. ✧ The agile approach, which focuses on iterative development and the reduction of overheads in the software process. ▪ The primary characteristics of agile methods are rapid delivery of functionality and responsiveness to changing customer requirements. 30/10/2014 Chapter 2 Software Processes 49 The process improvement cycle 30/10/2014 Chapter 2 Software Processes 50 Process improvement activities ✧ Process measurement ▪ You measure one or more attributes of the software process or product. These measurements forms a baseline that helps you decide if process improvements have been effective. ✧ Process analysis ▪ The current process is assessed, and process weaknesses and bottlenecks are identified. Process models (sometimes called process maps) that describe the process may be developed. ✧ Process change ▪ Process changes are proposed to address some of the identified process weaknesses. These are introduced and the cycle resumes to collect data about the effectiveness of the changes. 30/10/2014 Chapter 2 Software Processes 51 Process measurement ✧ Wherever possible, quantitative process data should be collected ▪ However, where organisations do not have clearly defined process standards this is very difficult as you don’t know what to measure. A process may have to be defined before any measurement is possible. ✧ Process measurements should be used to assess process improvements ▪ But this does not mean that measurements should drive the improvements. The improvement driver should be the organizational objectives. 30/10/2014 Chapter 2 Software Processes 52 Process metrics ✧ Time taken for process activities to be completed ▪ E.g. Calendar time or effort to complete an activity or process. ✧ Resources required for processes or activities ▪ E.g. Total effort in person-days. ✧ Number of occurrences of a particular event ▪ E.g. Number of defects discovered. 30/10/2014 Chapter 2 Software Processes 53 Capability maturity levels 30/10/2014 Chapter 2 Software Processes 54 The SEI capability maturity model ✧ Initial ▪ Essentially uncontrolled ✧ Repeatable ▪ Product management procedures defined and used ✧ Defined ▪ Process management procedures and strategies defined and used ✧ Managed ▪ Quality management strategies defined and used ✧ Optimising ▪ Process improvement strategies defined and used 30/10/2014 Chapter 2 Software Processes 55 Key points ✧ Software processes are the activities involved in producing a software system. Software process models are abstract representations of these processes. ✧ General process models describe the organization of software processes. ▪ Examples of these general models include the ‘waterfall’ model, incremental development, and reuse-oriented development. ✧ Requirements engineering is the process of developing a software specification. 30/10/2014 Chapter 2 Software Processes 56 Key points ✧ Design and implementation processes are concerned with transforming a requirements specification into an executable software system. ✧ Software validation is the process of checking that the system conforms to its specification and that it meets the real needs of the users of the system. ✧ Software evolution takes place when you change existing software systems to meet new requirements. The software must evolve to remain useful. ✧ Processes should include activities such as prototyping and incremental delivery to cope with change. 30/10/2014 Chapter 2 Software Processes 57 Key points ✧ Processes may be structured for iterative development and delivery so that changes may be made without disrupting the system as a whole. ✧ The principal approaches to process improvement are agile approaches, geared to reducing process overheads, and maturity-based approaches based on better process management and the use of good software engineering practice. ✧ The SEI process maturity framework identifies maturity levels that essentially correspond to the use of good software engineering practice. 30/10/2014 Chapter 2 Software Processes 58 Chapter 4 – Requirements Engineering 30/10/2014 Chapter 4 Requirements Engineering 1 Topics covered  Functional and non-functional requirements  Requirements engineering processes  Requirements elicitation  Requirements specification  Requirements validation  Requirements change 30/10/2014 Chapter 4 Requirements Engineering 2 Requirements engineering  The process of establishing the services that acustomer requires from a system and the constraints under which it operates and is developed.  The system requirements are the descriptions of the system services and constraints that are generated during the requirements engineering process. 30/10/2014 Chapter 4 Requirements Engineering 3 What is a requirement?  It may range from a high-level abstract statement of a service or of a system constraint to a detailed mathematical functional specification.  This is inevitable as requirements may serve a dual function ▪ May be the basis for a bid for a contract - therefore must be open to interpretation; ▪ May be the basis for the contract itself - therefore must be defined in detail; ▪ Both these statements may be called requirements. 30/10/2014 Chapter 4 Requirements Engineering 4 Requirements abstraction (Davis) “If a company wishes to let a contract for a large software development project, it must define its needs in a sufficiently abstract way that a solution is not pre-defined. The requirements must be written so that several contractors can bid for the contract, offering, perhaps, different ways of meeting the client organization’s needs. Once a contract has been awarded, the contractor must write a system definition for the client in more detail so that the client understands and can validate what the software will do. Both of these documents may be called the requirements document for the system.” 30/10/2014 Chapter 4 Requirements Engineering 5 Types of requirement  User requirements ▪ Statements in natural language plus diagrams of the services the system provides and its operational constraints. Written for customers.  System requirements ▪ A structured document setting out detailed descriptions of the system’s functions, services and operational constraints. Defines what should be implemented so may be part of a contract between client and contractor. 30/10/2014 Chapter 4 Requirements Engineering 6 User and system requirements 30/10/2014 Chapter 4 Requirements Engineering 7 Readers of different types of requirements specification 30/10/2014 Chapter 4 Requirements Engineering 8 System stakeholders  Any person or organization who is affected by the system in some way and so who has a legitimate interest  Stakeholder types ▪ End users ▪ System managers ▪ System owners ▪ External stakeholders 30/10/2014 Chapter 4 Requirements Engineering 9 Stakeholders in the Mentcare system  Patients whose information is recorded in the system.  Doctors who are responsible for assessing and treating patients.  Nurses who coordinate the consultations with doctors and administer some treatments.  Medical receptionists who manage patients’ appointments.  IT staff who are responsible for installing and maintaining the system. 30/10/2014 Chapter 4 Requirements Engineering 10 Stakeholders in the Mentcare system  A medical ethics manager who must ensure that the system meets current ethical guidelines for patient care.  Health care managers who obtain management information from the system.  Medical records staff who are responsible for ensuring that system information can be maintained and preserved, and that record keeping procedures have been properly implemented. 30/10/2014 Chapter 4 Requirements Engineering 11 Agile methods and requirements  Many agile methods argue that producing detailed system requirements is a waste of time as requirements change so quickly.  The requirements document is therefore always out of date.  Agile methods usually use incremental requirements engineering and may express requirements as ‘user stories’ (discussed in Chapter 3).  This is practical for business systems but problematic for systems that require pre-delivery analysis (e.g. critical systems) or systems developed by several teams. 30/10/2014 Chapter 4 Requirements Engineering 12 Functional and non-functional requirements 30/10/2014 Chapter 4 Requirements Engineering 13 Functional and non-functional requirements  Functional requirements ▪ Statements of services the system should provide, how the system should react to particular inputs and how the system should behave in particular situations. ▪ May state what the system should not do.  Non-functional requirements ▪ Constraints on the services or functions offered by the system such as timing constraints, constraints on the development process, standards, etc. ▪ Often apply to the system as a whole rather than individual features or services.  Domain requirements ▪ Constraints on the system from the domain of operation 30/10/2014 Chapter 4 Requirements Engineering 14 Functional requirements  Describe functionality or system services.  Depend on the type of software, expected users and the type of system where the software is used.  Functional user requirements may be high-level statements of what the system should do.  Functional system requirements should describe the system services in detail. 30/10/2014 Chapter 4 Requirements Engineering 15 Mentcare system: functional requirements  A user shall be able to search the appointments lists for all clinics.  The system shall generate each day, for each clinic, a list of patients who are expected to attend appointments that day.  Each staff member using the system shall be uniquely identified by his or her 8-digit employee number. 30/10/2014 Chapter 4 Requirements Engineering 16 Requirements imprecision  Problems arise when functional requirements are not precisely stated.  Ambiguous requirements may be interpreted in different ways by developers and users.  Consider the term ‘search’ in requirement 1 ▪ User intention – search for a patient name across all appointments in all clinics; ▪ Developer interpretation – search for a patient name in an individual clinic. User chooses clinic then search. 30/10/2014 Chapter 4 Requirements Engineering 17 Requirements completeness and consistency  In principle, requirements should be both complete and consistent.  Complete ▪ They should include descriptions of all facilities required.  Consistent ▪ There should be no conflicts or contradictions in the descriptions of the system facilities.  In practice, because of system and environmental complexity, it is impossible to produce a complete and consistent requirements document. 30/10/2014 Chapter 4 Requirements Engineering 18 Non-functional requirements  These define system properties and constraints e.g. reliability, response time and storage requirements. Constraints are I/O device capability, system representations, etc.  Process requirements may also be specified mandating a particular IDE, programming language or development method.  Non-functional requirements may be more critical than functional requirements. If these are not met, the system may be useless. 30/10/2014 Chapter 4 Requirements Engineering 19 Types of nonfunctional requirement 30/10/2014 Chapter 4 Requirements Engineering 20 Non-functional requirements implementation  Non-functional requirements may affect the overall architecture of a system rather than the individual components. ▪ For example, to ensure that performance requirements are met, you may have to organize the system to minimize communications between components.  A single non-functional requirement, such as a security requirement, may generate a number of related functional requirements that define system services that are required. ▪ It may also generate requirements that restrict existing requirements. 30/10/2014 Chapter 4 Requirements Engineering 21 Non-functional classifications  Product requirements ▪ Requirements which specify that the delivered product must behave in a particular way e.g. execution speed, reliability, etc.  Organisational requirements ▪ Requirements which are a consequence of organisational policies and procedures e.g. process standards used, implementation requirements, etc.  External requirements ▪ Requirements which arise from factors which are external to the system and its development process e.g. interoperability requirements, legislative requirements, etc. 30/10/2014 Chapter 4 Requirements Engineering 22 Examples of nonfunctional requirements in the Mentcare system Product requirement The Mentcare system shall be available to all clinics during normal working hours (Mon–Fri, 0830–17.30). Downtime within normal working hours shall not exceed five seconds in any one day. Organizational requirement Users of the Mentcare system shall authenticate themselves using their health authority identity card. External requirement The system shall implement patient privacy provisions as set out in HStan-03-2006-priv. 30/10/2014 Chapter 4 Requirements Engineering 23 Goals and requirements  Non-functional requirements may be very difficult to state precisely and imprecise requirements may be difficult to verify.  Goal ▪ A general intention of the user such as ease of use.  Verifiable non-functional requirement ▪ A statement using some measure that can be objectively tested.  Goals are helpful to developers as they convey the intentions of the system users. 30/10/2014 Chapter 4 Requirements Engineering 24 Usability requirements  The system should be easy to use by medical staff and should be organized in such a way that user errors are minimized. (Goal)  Medical staff shall be able to use all the system functions after four hours of training. After this training, the average number of errors made by experienced users shall not exceed two per hour of system use. (Testable non-functional requirement) 30/10/2014 Chapter 4 Requirements Engineering 25 Metrics for specifying nonfunctional requirements Property Measure Speed Processed transactions/second User/event response time Screen refresh time Size Mbytes Number of ROM chips Ease of use Training time Number of help frames Reliability Mean time to failure Probability of unavailability Rate of failure occurrence Availability Robustness Time to restart after failure Percentage of events causing failure Probability of data corruption on failure Portability Percentage of target dependent statements Number of target systems 30/10/2014 Chapter 4 Requirements Engineering 26 Requirements engineering processes 30/10/2014 Chapter 4 Requirements Engineering 27 Requirements engineering processes  The processes used for RE vary widely depending on the application domain, the people involved and the organisation developing the requirements.  However, there are a number of generic activities common to all processes ▪ Requirements elicitation; ▪ Requirements analysis; ▪ Requirements validation; ▪ Requirements management.  In practice, RE is an iterative activity in which these processes are interleaved. 30/10/2014 Chapter 4 Requirements Engineering 28 A spiral view of the requirements engineering process 30/10/2014 Chapter 4 Requirements Engineering 29 Requirements elicitation 30/10/2014 Chapter 4 Requirements Engineering 30 Requirements elicitation and analysis  Sometimes called requirements elicitation or requirements discovery.  Involves technical staff working with customers to find out about the application domain, the services that the system should provide and the system’s operational constraints.  May involve end-users, managers, engineers involved in maintenance, domain experts, trade unions, etc. These are called stakeholders. 30/10/2014 Chapter 4 Requirements Engineering 31 Requirements elicitation 30/10/2014 Chapter 4 Requirements Engineering 32 Requirements elicitation  Software engineers work with a range of system stakeholders to find out about the application domain, the services that the system should provide, the required system performance, hardware constraints, other systems, etc.  Stages include: ▪ Requirements discovery, ▪ Requirements classification and organization, ▪ Requirements prioritization and negotiation, ▪ Requirements specification. 30/10/2014 Chapter 4 Requirements Engineering 33 Problems of requirements elicitation  Stakeholders don’t know what they really want.  Stakeholders express requirements in their own terms.  Different stakeholders may have conflicting requirements.  Organisational and political factors may influence the system requirements.  The requirements change during the analysis process. New stakeholders may emerge and the business environment may change. 30/10/2014 Chapter 4 Requirements Engineering 34 The requirements elicitation and analysis process 30/10/2014 Chapter 4 Requirements Engineering 35 Process activities  Requirements discovery ▪ Interacting with stakeholders to discover their requirements. Domain requirements are also discovered at this stage.  Requirements classification and organisation ▪ Groups related requirements and organises them into coherent clusters.  Prioritisation and negotiation ▪ Prioritising requirements and resolving requirements conflicts.  Requirements specification ▪ Requirements are documented and input into the next round of the spiral. 30/10/2014 Chapter 4 Requirements Engineering 36 Requirements discovery  The process of gathering information about the required and existing systems and distilling the user and system requirements from this information.  Interaction is with system stakeholders from managers to external regulators.  Systems normally have a range of stakeholders. 30/10/2014 Chapter 4 Requirements Engineering 37 Interviewing  Formal or informal interviews with stakeholders are part of most RE processes.  Types of interview ▪ Closed interviews based on pre-determined list of questions ▪ Open interviews where various issues are explored with stakeholders.  Effective interviewing ▪ Be open-minded, avoid pre-conceived ideas about the requirements and are willing to listen to stakeholders. ▪ Prompt the interviewee to get discussions going using a springboard question, a requirements proposal, or by working together on a prototype system. 30/10/2014 Chapter 4 Requirements Engineering 38 Interviews in practice  Normally a mix of closed and open-ended interviewing.  Interviews are good for getting an overall understanding of what stakeholders do and how they might interact with the system.  Interviewers need to be open-minded without pre- conceived ideas of what the system should do  You need to prompt the use to talk about the system by suggesting requirements rather than simply asking them what they want. 30/10/2014 Chapter 4 Requirements Engineering 39 Problems with interviews  Application specialists may use language to describe their work that isn’t easy for the requirements engineer to understand.  Interviews are not good for understanding domain requirements ▪ Requirements engineers cannot understand specific domain terminology; ▪ Some domain knowledge is so familiar that people find it hard to articulate or think that it isn’t worth articulating. 30/10/2014 Chapter 4 Requirements Engineering 40 Ethnography  A social scientist spends a considerable time observing and analysing how people actually work.  People do not have to explain or articulate their work.  Social and organisational factors of importance may be observed.  Ethnographic studies have shown that work is usually richer and more complex than suggested by simple system models. 30/10/2014 Chapter 4 Requirements Engineering 41 Scope of ethnography  Requirements that are derived from the way that people actually work rather than the way I which process definitions suggest that they ought to work.  Requirements that are derived from cooperation and awareness of other people’s activities. ▪ Awareness of what other people are doing leads to changes in the ways in which we do things.  Ethnography is effective for understanding existing processes but cannot identify new features that should be added to a system. 30/10/2014 Chapter 4 Requirements Engineering 42 Focused ethnography  Developed in a project studying the air traffic control process  Combines ethnography with prototyping  Prototype development results in unanswered questions which focus the ethnographic analysis.  The problem with ethnography is that it studies existing practices which may have some historical basis which is no longer relevant. 30/10/2014 Chapter 4 Requirements Engineering 43 Ethnography and prototyping for requirements analysis 30/10/2014 Chapter 4 Requirements Engineering 44 Stories and scenarios  Scenarios and user stories are real-life examples of how a system can be used.  Stories and scenarios are a description of how a system may be used for a particular task.  Because they are based on a practical situation, stakeholders can relate to them and can comment on their situation with respect to the story. 30/10/2014 Chapter 4 Requirements Engineering 45 Photo sharing in the classroom (iLearn)  Jack is a primary school teacher in Ullapool (a village in northern Scotland). He has decided that a class project should be focused around the fishing industry in the area, looking at the history, development and economic impact of fishing. As part of this, pupils are asked to gather and share reminiscences from relatives, use newspaper archives and collect old photographs related to fishing and fishing communities in the area. Pupils use an iLearn wiki to gather together fishing stories and SCRAN (a history resources site) to access newspaper archives and photographs. However, Jack also needs a photo sharing site as he wants pupils to take and comment on each others’ photos and to upload scans of old photographs that they may have in their families. Jack sends an email to a primary school teachers group, which he is a member of to see if anyone can recommend an appropriate system. Two teachers reply and both suggest that he uses KidsTakePics, a photo sharing site that allows teachers to check and moderate content. As KidsTakePics is not integrated with the iLearn authentication service, he sets up a teacher and a class account. He uses the iLearn setup service to add KidsTakePics to the services seen by the pupils in his class so that when they log in, they can immediately use the system to upload photos from their mobile devices and class computers. 30/10/2014 Chapter 4 Requirements Engineering 46 Scenarios  A structured form of user story  Scenarios should include ▪ A description of the starting situation; ▪ A description of the normal flow of events; ▪ A description of what can go wrong; ▪ Information about other concurrent activities; ▪ A description of the state when the scenario finishes. 30/10/2014 Chapter 4 Requirements Engineering 47 Uploading photos iLearn)  Initial assumption: A user or a group of users have one or more digital photographs to be uploaded to the picture sharing site. These are saved on either a tablet or laptop computer. They have successfully logged on to KidsTakePics.  Normal: The user chooses upload photos and they are prompted to select the photos to be uploaded on their computer and to select the project name under which the photos will be stored. They should also be given the option of inputting keywords that should be associated with each uploaded photo. Uploaded photos are named by creating a conjunction of the user name with the filename of the photo on the local computer.  On completion of the upload, the system automatically sends an email to the project moderator asking them to check new content and generates an on-screen message to the user that this has been done. 30/10/2014 Chapter 4 Requirements Engineering 48 Uploading photos  What can go wrong:  No moderator is associated with the selected project. An email is automatically generated to the school administrator asking them to nominate a project moderator. Users should be informed that there could be a delay in making their photos visible.  Photos with the same name have already been uploaded by the same user. The user should be asked if they wish to re-upload the photos with the same name, rename the photos or cancel the upload. If they chose to re-upload the photos, the originals are overwritten. If they chose to rename the photos, a new name is automatically generated by adding a number to the existing file name.  Other activities: The moderator may be logged on to the system and may approve photos as they are uploaded.  System state on completion: User is logged on. The selected photos have been uploaded and assigned a status ‘awaiting moderation’. Photos are visible to the moderator and to the user who uploaded them. 30/10/2014 Chapter 4 Requirements Engineering 49 Requirements specification 30/10/2014 Chapter 4 Requirements Engineering 50 Requirements specification  The process of writing donw the user and system requirements in a requirements document.  User requirements have to be understandable by end- users and customers who do not have a technical background.  System requirements are more detailed requirements and may include more technical information.  The requirements may be part of a contract for the system development ▪ It is therefore important that these are as complete as possible. 30/10/2014 Chapter 4 Requirements Engineering 51 Ways of writing a system requirements specification Notation Description Natural language The requirements are written using numbered sentences in natural language. Each sentence should express one requirement. Structured natural The requirements are written in natural language on a standard form or language template. Each field provides information about an aspect of the requirement. Design description This approach uses a language like a programming language, but with more languages abstract features to specify the requirements by defining an operational model of the system. This approach is now rarely used although it can be useful for interface specifications. Graphical notations Graphical models, supplemented by text annotations, are used to define the functional requirements for the system; UML use case and sequence diagrams are commonly used. Mathematical These notations are based on mathematical concepts such as finite-state specifications machines or sets. Although these unambiguous specifications can reduce the ambiguity in a requirements document, most customers don’t understand a formal specification. They cannot check that it represents what they want and are reluctant to accept it as a system contract 30/10/2014 Chapter 4 Requirements Engineering 52 Requirements and design  In principle, requirements should state what the system should do and the design should describe how it does this.  In practice, requirements and design are inseparable ▪ A system architecture may be designed to structure the requirements; ▪ The system may inter-operate with other systems that generate design requirements; ▪ The use of a specific architecture to satisfy non-functional requirements may be a domain requirement. ▪ This may be the consequence of a regulatory requirement. 30/10/2014 Chapter 4 Requirements Engineering 53 Natural language specification  Requirements are written as natural language sentences supplemented by diagrams and tables.  Used for writing requirements because it is expressive, intuitive and universal. This means that the requirements can be understood by users and customers. 30/10/2014 Chapter 4 Requirements Engineering 54 Guidelines for writing requirements  Invent a standard format and use it for all requirements.  Use language in a consistent way. Use shall for mandatory requirements, should for desirable requirements.  Use text highlighting to identify key parts of the requirement.  Avoid the use of computer jargon.  Include an explanation (rationale) of why a requirement is necessary. 30/10/2014 Chapter 4 Requirements Engineering 55 Problems with natural language  Lack of clarity ▪ Precision is difficult without making the document difficult to read.  Requirements confusion ▪ Functional and non-functional requirements tend to be mixed-up.  Requirements amalgamation ▪ Several different requirements may be expressed together. 30/10/2014 Chapter 4 Requirements Engineering 56 Example requirements for the insulin pump software system 3.2 The system shall measure the blood sugar and deliver insulin, if required, every 10 minutes. (Changes in blood sugar are relatively slow so more frequent measurement is unnecessary; less frequent measurement could lead to unnecessarily high sugar levels.) 3.6 The system shall run a self-test routine every minute with the conditions to be tested and the associated actions defined in Table 1. (A self-test routine can discover hardware and software problems and alert the user to the fact the normal operation may be impossible.) 30/10/2014 Chapter 4 Requirements Engineering 57 Structured specifications  An approach to writing requirements where the freedom of the requirements writer is limited and requirements are written in a standard way.  This works well for some types of requirements e.g. requirements for embedded control system but is sometimes too rigid for writing business system requirements. 30/10/2014 Chapter 4 Requirements Engineering 58 Form-based specifications  Definition of the function or entity.  Description of inputs and where they come from.  Description of outputs and where they go to.  Information about the information needed for the computation and other entities used.  Description of the action to be taken.  Pre and post conditions (if appropriate).  The side effects (if any) of the function. 30/10/2014 Chapter 4 Requirements Engineering 59 A structured specification of a requirement for an insulin pump 30/10/2014 Chapter 4 Requirements Engineering 60 A structured specification of a requirement for an insulin pump 30/10/2014 Chapter 4 Requirements Engineering 61 Tabular specification  Used to supplement natural language.  Particularly useful when you have to define a number of possible alternative courses of action.  For example, the insulin pump systems bases its computations on the rate of change of blood sugar level and the tabular specification explains how to calculate the insulin requirement for different scenarios. 30/10/2014 Chapter 4 Requirements Engineering 62 Tabular specification of computation for an insulin pump Condition Action Sugar level falling (r2 < r1) CompDose = 0 Sugar level stable (r2 = r1) CompDose = 0 Sugar level increasing and rate of CompDose = 0 increase decreasing ((r2 – r1) < (r1 – r0)) Sugar level increasing and rate of CompDose = increase stable or increasing round ((r2 – r1)/4) ((r2 – r1) ≥ (r1 – r0)) If rounded result = 0 then CompDose = MinimumDose 30/10/2014 Chapter 4 Requirements Engineering 63 Use cases  Use-cases are a kind of scenario that are included in the UML.  Use cases identify the actors in an interaction and which describe the interaction itself.  A set of use cases should describe all possible interactions with the system.  High-level graphical model supplemented by more detailed tabular description (see Chapter 5).  UML sequence diagrams may be used to add detail to use-cases by showing the sequence of event processing in the system. 30/10/2014 Chapter 4 Requirements Engineering 64 Use cases for the Mentcare system 30/10/2014 Chapter 4 Requirements Engineering 65 The software requirements document  The software requirements document is the official statement of what is required of the system developers.  Should include both a definition of user requirements and a specification of the system requirements.  It is NOT a design document. As far as possible, it should set of WHAT the system should do rather than HOW it should do it. 30/10/2014 Chapter 4 Requirements Engineering 66 Users of a requirements document 30/10/2014 Chapter 4 Requirements Engineering 67 Requirements document variability  Information in requirements document depends on type of system and the approach to development used.  Systems developed incrementally will, typically, have less detail in the requirements document.  Requirements documents standards have been designed e.g. IEEE standard. These are mostly applicable to the requirements for large systems engineering projects. 30/10/2014 Chapter 4 Requirements Engineering 68 The structure of a requirements document Chapter Description Preface This should define the expected readership of the document and describe its version history, including a rationale for the creation of a new version and a summary of the changes made in each version. Introduction This should describe the need for the system. It should briefly describe the system’s functions and explain how it will work with other systems. It should also describe how the system fits into the overall business or strategic objectives of the organization commissioning the software. Glossary This should define the technical terms used in the document. You should not make assumptions about the experience or expertise of the reader. User requirements Here, you describe the services provided for the user. The nonfunctional definition system requirements should also be described in this section. This description may use natural language, diagrams, or other notations that are understandable to customers. Product and process standards that must be followed should be specified. System architecture This chapter should present a high-level overview of the anticipated system architecture, showing the distribution of functions across system modules. Architectural components that are reused should be highlighted. 30/10/2014 Chapter 4 Requirements Engineering 69 The structure of a requirements document Chapter Description System This should describe the functional and nonfunctional requirements in more detail. requirements If necessary, further detail may also be added to the nonfunctional requirements. specification Interfaces to other systems may be defined. System models This might include graphical system models showing the relationships between the system components and the system and its environment. Examples of possible models are object models, data-flow models, or semantic data models. System evolution This should describe the fundamental assumptions on which the system is based, and any anticipated changes due to hardware evolution, changing user needs, and so on. This section is useful for system designers as it may help them avoid design decisions that would constrain likely future changes to the system. Appendices These should provide detailed, specific information that is related to the application being developed; for example, hardware and database descriptions. Hardware requirements define the minimal and optimal configurations for the system. Database requirements define the logical organization of the data used by the system and the relationships between data. Index Several indexes to the document may be included. As well as a normal alphabetic index, there may be an index of diagrams, an index of functions, and so on. 30/10/2014 Chapter 4 Requirements Engineering 70 Requirements validation 30/10/2014 Chapter 4 Requirements Engineering 71 Requirements validation  Concerned with demonstrating that the requirements define the system that the customer really wants.  Requirements error costs are high so validation is very important ▪ Fixing a requirements error after delivery may cost up to 100 times the cost of fixing an implementation error. 30/10/2014 Chapter 4 Requirements Engineering 72 Requirements checking  Validity. Does the system provide the functions which best support the customer’s needs?  Consistency. Are there any requirements conflicts?  Completeness. Are all functions required by the customer included?  Realism. Can the requirements be implemented given available budget and technology  Verifiability. Can the requirements be checked? 30/10/2014 Chapter 4 Requirements Engineering 73 Requirements validation techniques  Requirements reviews ▪ Systematic manual analysis of the requirements.  Prototyping ▪ Using an executable model of the system to check requirements. Covered in Chapter 2.  Test-case generation ▪ Developing tests for requirements to check testability. 30/10/2014 Chapter 4 Requirements Engineering 74 Requirements reviews  Regular reviews should be held while the requirements definition is being formulated.  Both client and contractor staff should be involved in reviews.  Reviews may be formal (with completed documents) or informal. Good communications between developers, customers and users can resolve problems at an early stage. 30/10/2014 Chapter 4 Requirements Engineering 75 Review checks  Verifiability ▪ Is the requirement realistically testable?  Comprehensibility ▪ Is the requirement properly understood?  Traceability ▪ Is the origin of the requirement clearly stated?  Adaptability ▪ Can the requirement be changed without a large impact on other requirements? 30/10/2014 Chapter 4 Requirements Engineering 76 Requirements change 30/10/2014 Chapter 4 Requirements Engineering 77 Changing requirements  The business and technical environment of the system always changes after installation. ▪ New hardware may be introduced, it may be necessary to interface the system with other systems, business priorities may change (with consequent changes in the system support required), and new legislation and regulations may be introduced that the system must necessarily abide by.  The people who pay for a system and the users of that system are rarely the same people. ▪ System customers impose requirements because of organizational and budgetary constraints. These may conflict with end-user requirements and, after delivery, new features may have to be added for user support if the system is to meet its goals. 30/10/2014 Chapter 4 Requirements Engineering 78 Changing requirements  Large systems usually have a diverse user community, with many users having different requirements and priorities that may be conflicting or contradictory. ▪ The final system requirements are inevitably a compromise between them and, with experience, it is often discovered that the balance of support given to different users has to be changed. 30/10/2014 Chapter 4 Requirements Engineering 79 Requirements evolution 30/10/2014 Chapter 4 Requirements Engineering 80 Requirements management  Requirements management is the process of managing changing requirements during the requirements engineering process and system development.  New requirements emerge as a system is being developed and after it has gone into use.  You need to keep track of individual requirements and maintain links between dependent requirements so that you can assess the impact of requirements changes. You need to establish a formal process for making change proposals and linking these to system requirements. 30/10/2014 Chapter 4 Requirements Engineering 81 Requirements management planning  Establishes the level of requirements management detail that is required.  Requirements management decisions: ▪ Requirements identification Each requirement must be uniquely identified so that it can be cross-referenced with other requirements. ▪ A change management process This is the set of activities that assess the impact and cost of changes. I discuss this process in more detail in the following section. ▪ Traceability policies These policies define the relationships between each requirement and between the requirements and the system design that should be recorded. ▪ Tool support Tools that may be used range from specialist requirements management systems to spreadsheets and simple database systems. 30/10/2014 Chapter 4 Requirements Engineering 82 Requirements change management  Deciding if a requirements change should be accepted ▪ Problem analysis and change specification During this stage, the problem or the change proposal is analyzed to check that it is valid. This analysis is fed back to the change requestor who may respond with a more specific requirements change proposal, or decide to withdraw the request. ▪ Change analysis and costing The effect of the proposed change is assessed using traceability information and general knowledge of the system requirements. Once this analysis is completed, a decision is made whether or not to proceed with the requirements change. ▪ Change implementation The requirements document and, where necessary, the system design

Use Quizgecko on...
Browser
Browser