Chapter 2 Software Engineering - UMinho

Transcription

Chapter 2Software EngineeringAbstract Software engineering is an engineering discipline that is focused on allaspects concerning the development of software-based systems. This chapter beginswith an explanation of the contributions of software engineering to the issues relatedto requirements, discussing the possibility of adopting their methods on projectsof other engineering disciplines. The chapter also characterises the software engineering, identifying and describing the fifteen knowledge areas of the SWEBOKguide. Additionally, the most relevant characteristics associated with the softwareare discussed. Finally, some of the most popular development process models arepresented.2.1 Contributions for Requirements EngineeringThe advances and progresses that were made during the last 40 years in the softwareand information systems domain are, whatever the perspective, extraordinary. Despitesome negative propaganda (for instance, the eternal software crisis or the non-eventthat was the year 2000 bug (Y2K bug), there is a huge number of success cases thatchanged human daily habits, in a significative or even drastic way. Nowadays, software is present not only in traditional personal computers or in highly-sophisticatedsupercomputers, used for scientific purposes or for executing governmental activities,but also in mobile devices, like cellular phones or tablets, or in devices responsiblefor routing in computer networks.The existence of a knowledge area related to software engineering is due to thegrowing complexity of the developed systems and to economic factors that promptsoftware producers to try to optimise the processes. Therefore, they can gain a competitive advantage to be better positioned in the markets where they operate. Allthese issues have influenced the evolution of this area, which started to take shape atthe end of the 1960 decade. There are of course problems associated with softwaredevelopment and many software projects are not ready on time and cost much morethan was initially planned. It is due to the fact that those problems can occur that oneneeds to adopt an engineering approach. Springer International Publishing Switzerland 2016J.M. Fernandes and R.J. Machado, Requirements in Engineering Projects,Lecture Notes in Management and Industrial Engineering,DOI 10.1007/978-3-319-18597-2 215

162 Software EngineeringSoftware engineering is a discipline composed of theories, methods, approaches,and tools needed to construct software systems. Software engineering, like the otherengineering branches, needs to base its activity on quality . This implies that everything that is related to engineering, including obviously the developed systems, mustpossess quality, in order to satisfy the client. In a simple way, quality is the compliance with the requirements. The main objective of software engineering is todevelop software systems with quality, fulfilling the budget, meeting the deadlines,and satisfying the real needs of clients by solving their problems.“The function of good software is to make the complex appear to be simple.”Grady Booch (1955–), software engineerTo cope with the growing complexity and diversity of real-world problems andto changes in requirements during the development process, the construction ofsystems in the software and information systems domain needs to adopt engineeringapproaches, to improve the quality of those systems. This does not imply that thesystem is for sure optimal, but that normally it possesses a good quality and isproduced in a controlled way and limited by the available budget.In this context, over the last years, the software engineering discipline has accumulated an extensive scientific body of knowledge related to the requirements andtheir problems. This reality results from the need to control the enormous uncertaintyand the high number of risks normally associated with this domain, due namely tothe intangible nature of the information technologies. Operationally, the success ofprojects in the software and information systems domain requires an equilibriumbetween the capacity of reading the surrounding reality (environment) and the ability to socio-technically act upon it. These demands refer to the relationship with thestakeholders and to the technical decisions associated with the project management.Based on this track taken by the software engineering discipline, the dimension andimportance of the scientific community that is focused on the subject of requirementshas grown tremendously. This community adopted the ‘requirements engineering’concept, understood as the set of activities that in the context of developing a systemallows one to elicit, negotiate, and to document the functionalities and restrictionsof that system.In fact, the process of characterising a building, automobile, boat, or house contains different aspects than those that are relevant in the process of defining therequirements of a system in the software and information systems domain. However,it also includes many similar issues. The methods and the techniques discussed in thisbook result from the contributions made by the requirements engineering scientificcommunity. In most cases, those methods and techniques are not exclusive for thesoftware and information systems domain and can thus be applied in any engineeringproject, whatever branch or field.

2.2 Characterisation of the Discipline172.2 Characterisation of the DisciplineSoftware engineering, as a discipline, can be defined in different ways. In a simpleway, one can say that it corresponds to the application of the engineering principlesto the software development process. This line of reasoning was used by Fritz Bauer,when in 1968, he defined it as being the utilisation of the basic engineering principlesto obtain, in a economically-viable way, reliable software that runs efficiently in realcomputers.Software engineering is focused on all aspects related to the development and utilisation of software systems, from the initial steps of specification until maintenance.There are two software engineering aspects that deserve to be highlighted. On theone hand, engineers must be able to manage the development and industrialisationof useful and efficient system. On the other hand, software engineering is not justcentred in the technical aspects associated with the development, but includes alsoactivities related to managing the development process.“Leonardo Da Vinci combined art and science and aesthetics and engineering.That kind of unity is needed once again.”Ben Shneiderman (1947–), computer scientistOne can also define software engineering as a computer science field that tacklesthe construction of software systems whose complexity requires a team of softwareengineers to build it (Ghezzi et al. 1991, p. 1). Here, the emphasis is put on the systemcomplexity and, as happens in all engineering branches and fields, whenever the scaleof the systems is changed, different problems and challenges arise. Some softwaresystems have a long lifecycle, which explains the reason why they go through severalversions in order to make sure that they adapt to new realities. The systems developedwithin the scope of software engineering are also used by different types of usersand may include gigantic volumes of information.Small software programs, written and maintained by a single person (the socalled heroic programmer), are not generally considered sufficiently complex todemand the use of an engineering approach. It is relevant here to distinguish computerprogramming from software engineering, since unfortunately there are still manypersons, some professionally connected to computing, that consider both activities tobe the same. A programmer writes complete software programs. It is very difficult,even literally impossible, for a single programmer to dominate all the facets of asoftware system, since its complexity largely exceeds the human mind capacities(Booch et al. 2007, p. 8). It is very likely, according to Laplante (2007, p. 4), thata software engineer spends less than 10 % of his time in programming activities,using the remaining time for the other activities of the software engineering process.Regardless of the number being totally aligned with the reality, the relevant thing tounderstand here is its order of magnitude.

182 Software EngineeringIllustration 2.1 A typical software engineering environment, with programmers, software architects, analysts, testers, and clientsThe differentiation between software engineers and programmers is intimatelyrelated to the professional liability and accountability for acts of public trust in technologic interventions. It has been particularly difficult to convince the society andthe professionals themselves that, in contexts of great complexity, the engagementof software engineers in the implementation phase is not justifiable to execute programming tasks. Software engineers should instead technically coordinate the workof the programmers. Metaphorically, software engineering is related to programmingin the same way as civil engineering is associated with civil construction.Software engineering includes also a specific management component that doesnot exist in programming. In a small project, with one or two programmers, therelevant aspects have essentially a technologic nature. In a longer project with a teamcomposed of many members, it is indispensable to conduct management efforts, toplan and control the activities of the various professionals with differentiating roles,such as analysts, architects, programmers, and testers (Illustration 2.1).In this book, software engineering is defined as the application of a systematic,disciplined and quantifiable approach in the context of the planning, developmentand exploration of software systems, that is, it is the application of engineering tothe software domain. It is under this definition that appears the SWEBOK (softwareengineering body of knowledge) guide (Bourque et al. 1999; Abran et al. 2004),as an important reference to characterise the software engineering discipline. Thisguide is the result of an initiative jointly promoted by the IEEE Computer Society

2.2 Characterisation of the DisciplineTable 2.1 KAs of the SWEBOK1Software requirements19923Software designSoftware construction101145678Software testingSoftware maintenanceSoftware configuration managementSoftware engineering managementSoftware engineering process12131415Software engineering models andmethodsSoftware qualitySoftware engineering professionalpracticeSoftware engineering economicsComputing foundationsMathematics foundationsEngineering foundations(IEEE-CS) and the Association for Computing Machinery (ACM). The SWEBOKwas created to address the following objectives: to promote in the scientific community the existence of a coherent view of softwareengineering; to clarify how software engineering is related to other disciplines, such as computerscience, computer engineering, project management, and mathematics; to characterise the scope and thematic contents of the software engineering discipline; to ease the access to the contents of the software engineering body of knowledge; to provide a reference for the definition of curricula and professional certificationsin the software engineering discipline.The SWEBOK guide structures the software engineering corpus according to theKAs shown in Table 2.1. KAs 11–15 were only introduced in third version of theguide (IEEE 2014).Next, all the KAs are very briefly presented, to provide a generic idea of thesubjects covered by software engineering. Thus, it is possible to relate requirementsengineering (the main topic of this book) with the other activities carried out in thecontext of software engineering.Most topics detailed in this book fall within the scope of KA1 (software requirements). This KA handles the elicitation, analysis, documentation, validation, andmaintenance of software requirements. Requirements are considered as propertiesthat the systems (still in project) may manifest later after development. The softwarerequirements express the necessities and the restrictions that are put to a softwaresystem and that must be taken into account throughout its development. This KA isrecognised as having primary importance for the software industry, due to the impactthat its activities promote on stabilising and managing all the development process.Software design (KA2) is the process where the architecture, components, interfaces, and other system (or its components) characteristics are defined. From theprocess perspective and within the scope of the software development lifecycle, software design is the activity in which the software requirements are handled with thepurpose of producing a description of the internal structure and organisation of the

202 Software Engineeringsystem. From the product perspective, the final result of the process should describethe system architecture (i.e., how it can be decomposed and organised into components), the interfaces between the components, and the components with a level ofdetail that permits their construction.Software construction (KA3) represents the fundamental act associated withsoftware engineering. It consists in implementing software in accordance with therequirements and that works correctly, through a combination of coding, validation,and testing activities. The implementation of software is intimately related to design,since the former must transform into code the architectures conceived and describedby the latter. This transformation tends to be more and more automatic, since thereare tasks perfectly repetitive and mechanistic. Thus, it is in the software implementation phase that the utilisation of tools is more critical, to free the engineers fromthe less creative and error-prone activities.Software testing (KA4) constitutes a mandatory part of the software development.Simultaneously, it is an activity in which one evaluates the software system qualityand enhances it through the identification of the defects and potential problems. Testing includes, for instance, the dynamic verification of the software system behaviourin comparison with the expected one, using a finite set of test cases, especially chosento cover the most critical situations.Software maintenance (KA5) consists in introducing changes in the softwaresystem, after it was deployed and brought into operation, in order to (1) improvethe system, (2) correct defects, and (3) adapt the system to a new context. Themaintenance phase copes with the defects, the technological modifications, and theuser requirements evolution. It is recommended to prepare maintenance in advanceduring the development phases, to ease the tasks that compose it. Although softwaremaintenance is an area of software engineering, it has received a smaller attention bythe scientific community when compared, for example, with design and construction.Maintenance can be reactive, when the intervention is dictated by defects observedin the system, or proactive, whenever the intervention is performed before detecting the defects. In another dimension, maintenance can be oriented towards correction, which means that one attempts to detect and to repair the defects, or orientedtowards improvement, with the objective of enhancing the system to accommodatenew requirements or contexts of utilisation. The IEEE 14764 standard employs thesetwo dimensions, as illustrated in Table 2.2, to divide maintenance into four categories:preventive, corrective, perfective, and adaptive.“Maintenance typically consumes about 40 to 80 % of software costs. Therefore, it is probably the most important life cycle phase of software.”Robert L. Glass (1932–), software engineerChange is inevitable when developing systems, due to new business conditions,modifications on the necessities of the clients and users, reorganisations of the development teams, and financial and time restrictions in the projects. Software configu-

2.2 Characterisation of the DisciplineTable 2.2 ation management (KA6) aims to identify the configuration of the software system,in distinct moments of the lifecycle, to systematically control the changes of configuration and to maintain the integrity and traceability of the software system. Thisactivity can be part of a more extensive process that aims to manage the softwarequality. The configuration management process of a given system over time can alsobe designated as version/release management. Software configuration managementrefers to the activities of control and monitoring that start at the same time as theproject does and that terminate only when the system is no longer used.Software engineering management (KA7) corresponds to software managementactivities (planning, coordination, measurement, monitoring, control, and communication), to guarantee that the software systems are engineered in a systematic,disciplined and measurable way. This KA is considerably distinct from the management practiced in engineering processes of other branches, due to the specificitiesof software and its process, like the intangible and abstract nature of the softwareartifacts and the very high rate of technological update that is required in the softwareindustry.The software engineering process (KA8) can be seen in two distinct perspectives. In the first one, the process is considered as a set of directives that guide howthe professionals should organise and execute their activities over the project, foracquiring, developing and maintaining software systems. In the second perspective,one intends to evaluate and improve the software engineering process itself. Sincethe first perspective is already largely handled in the scope of other KAs, it is mainlywithin the second perspective that this KA contributes to. This explains why it is alsodesignated, in a more restrictive way, but that simultaneously better characterises itsfocus, as engineering of the software process.The use of software engineering models and methods (KA9) is fundamental toallow software systems to be engineered in a systematic, disciplined, quantifiable, andefficient way. Taking into consideration the abstract nature of software systems, themodels constitute an indispensable tool when taking decisions in all the developmentprocess phases. The methods allow software models and other artefacts to be createdand manipulated throughout the system lifecycle.Quality must constitute a permanent concern of the engineers, since one expectsengineering systems to possess high quality. The quality is related to the conformityof the system under development with the requirements. Software quality (KA10)is an activity that spreads all the software process and that requires the treatment ofnon-functional aspects like, for example, usability, efficiency, portability, reliability,testability, and reusability. The quality in the software must be seen as a transversalconcern to all the software process.

222 Software Engineering“Quality is never an accident. It is always the result of intelligent effort.”John Ruskin (1819–1900), social thinkerThe software engineering professional practice (KA11) has a highly multidisciplinary nature and is focused on topics related to professionalism, ethics, law, groupdynamics, psychology, multiculturalism, communication, writing, presentation.Software engineering economics (KA12) gathers contents of economic naturerelated to software systems in a business perspective. This KA includes topics likeeconomics fundamentals (finance, accounting, inflation, time-value of money), lifecycle economics (portfolio, price, investment decisions), risk and uncertainty, andeconomic analysis methods (return on investment, cost-benefit analysis, break-evenanalysis).KA13–KA15 are related to concepts and foundations of three disciplines thatare critical to the success of the software engineer: computing, mathematics, andengineering.2.3 SoftwareTo understand the full scope associated with the software engineering discipline,it is convenient to figure out what is software, if viewed as an artefact or set ofartefacts that result from the engineering process. In this section, the most relevantcharacteristics of software are presented.2.3.1 Definition of SoftwareThe term ‘software’ is relatively new and, according to Campbell-Kelly (1995), wasused for the first time in 1959. Cusumano (2004, p. 91) says that Applied DataResearch, a company founded in 1959, was the first one selling a software productseparated from the hardware. At the beginning of the popularisation of computers(1950 decade), it was common practice to sell hardware and software as a uniquesystem. Software was at that time viewed as part of the hardware and was designatedas ‘program code’. The emancipation of the software has its origin related to a relevantfact, from an historical point of view: the decision of american justice to demandIBM to distinguish, in its accounting documents, hardware and software, providingseparate prices for each one (Buxmann et al. 2013, p. 4), something that has becomereality since the 1970s.Surprisingly, defining the concept associated with the ‘software’ term is not easy.A first attempt to define software can be made by a process of elimination. In aclassic perspective, a computer consists of hardware and software and it only works

2.3 Software23in a useful way if there is a fruitful and symbiotic combination of those two parts. Incomputers that follow a classical architecture, the hardware, by itself, is not capableof realising useful tasks from the user point of view. In fact, it is necessary to provide some of the hardware components with a list of instructions (in the form of aprogram) that defines the task to be accomplished. Equally, software to be executedneeds a hardware support. Galler (1962) proposes that everything that, in the usersperspective, composes a computer, except the hardware, is the software. Galler’s definition is elegant due to its simplicity and has additionally the advantage of puttingthe users as a central element. Additionally, it induces the need to define the concept of hardware, which is not especially difficult to formulate, due to its tangiblenature. The hardware of a computer is composed of electronic and electromechanical components, including, namely, the processor, the memory, and the input/outputdevices. The hardware of a computer refers to the material components (integratedcircuits, printed circuit boards, cables, power supplies, plugs, and connectors) andnot to algorithms or instructions.“Hardware and software are logically equivalent. Any operation performedby software can also be built directly into the hardware and any instructionexecuted by the hardware can also be simulated in software.”Brian Randell (1936–), computer scientistA definition of software, elaborated without a process of elimination, is howevernecessary. According to Blundell (2008, p. 4), software refers generically to theprograms, which include the instructions that are executed by the computer (morespecifically the hardware), as well as the data that are operated by those instructions.For Ceruzzi (1998, p. 80), software is simply the set of instructions that direct acomputer to do a specific task. Alternatively, Tanenbaum (2006, p. 8) defines softwareof a computer system as being the algorithms (instructions that describe in detail howto accomplish something) and their respective representations, namely the programs.A given program can be materialised in different physical means (punched card,magnetic tape, floppy disk, compact disc, etc.), but its essence resides in the set ofinstructions that constitute it and not in the support where it is stored. The software isthe set of programs, procedures and rules (and occasionally documentation), relatedto the operation of a system that aims to acquire, store, and process the data. Softwareis the abstract element that, together with the hardware, constitutes the automatisedpart of a real-world system, implementing a stimulus-answer mechanism, with theobjective of satisfying the needs of an entity external to the system.An intermediate form between hardware and software is the so-called firmware,which consists of software embedded in electronic devices during their manufacturing. Firmware is used when it is expected, for example, that programs are never(or rarely) changed or when programs cannot fail in case of lack of power supply.Thus, firmware is typically stored in non-volatile memory. In some processors, theoperation is controlled by a microprogram, which is a form of firmware.

242 Software EngineeringIt is important to understand that the most classic view about software, as beinga program that executes in a personal computer, is nowadays far away from beingthe only one. Software is an integral and fundamental part of the so-called embedded systems, which are computer-based systems integrated in equipments (typicallyelectromechanical). In an embedded system, the main actions are performed by thehardware, but software plays a major role. Embedded systems are developed for aspecific purpose and the communication with the outside world occurs through sensors and actuators. Embedded systems normally run continuously and in real-time.The software that exists in those system is called embedded software, because it isintegrated in a system that cannot be classified as being of software. For this reason,embedded software is not sold in an independent way (Kittlaus and Clough 2009,p. 6). The end users generally do not associate to this software type the same characteristics of the most traditional software. Instead, the users perceive the softwareas a set of functions that is provided by the system.A modern automobile has today a significant percentage of its engineering effortrelated to the production of software. Pretschner et al. (2007) indicate that the BMW 7series models implement 270 functionalities which the automobile users can interactwith and that the software, in total, occupies around 65 Mb (65 106 bytes) of codein binary language (i.e., the program codified in the language that can be directlyexecuted by the hardware). These authors predicted that, in 2010, the software ofa top-of-the-range automobile could reach the 1 Gb (109 bytes) figure, but according to Ebert and Jones (2009) this fact occurred one year earlier. Cellular phonesare nowadays equipped with much more software than the one that could be foundsome years ago in computers of large organisations or corporations. According tofigures indicated by Ebert and Jones (2009), a top-quality mobile phone can posses1,000,000,000 (109 ) lines of binary code, the same being true of aerial navigationsystems or with software to control spacial missions. Even less sophisticated devices,like washing machines, low-end mobile phones, or pacemakers, have approximately1,000,000 (106 ) lines of binary code. In factories, there are so many pieces of equipment and processes controlled by tailor-made software systems. The electrical energythat arrives at homes depends, in large measure, on software that controls its management and distribution. Due to the fact that the world is becoming more digital atvarious levels, the examples are almost endless, due to the omnipresence, sometimesunnoticed, of systems with software in the modern societies.“The future lies in designing and selling computers that people don’t realiseare computers at all.”Adam Osborne (1939–2003), computer engineerThe first characteristic of a software system, that distinguishes it from other engineering systems, is its intangible nature. A software system is not a concrete andmaterial entity, that is, it has no physical existence, contrarily to what happens withmost systems from the other engineering branches (civil, mechanical, naval, chemistry, electrical). The software is not restricted by the materials properties, nor ruled

2.3 Software25by the laws of physics. Ghezzi et al. (1991, p. 17) indicate that software is soft, sinceit is relatively easy to change it. The softness of software, which is explicitly reflectedin its name, results from its condition of intangible system. This characteristic hasbeen, however, the cause of some of the problems associated with software development, since the changes imposed are often made without a careful analysis in termsof schedule, cost, quality, and impact.Due to its intangible nature, software is developed, but not fabricated or constructed in the classical meaning of the term. In this book, a company that developssoftware and where many software engineers work is designated as a software producer. Often one uses ‘software supplier’, as a synonym, although this designationmay have a more commercial connotation, since the one that supplies (i.e., sells,rents, lends, offers) something is not always the one that fabricates it.Due to the intangible nature of software, in reality producing the first replicaof a software system implies high costs, but the subsequent replicas are producedat much lower (in some cases, insignificant) costs. Additionally, copying softwareis an extremely easy operation, from a technical point of view, and that does notintroduce loss of quality, since in the digital world one can consider that there areno differences between the original and the replicas. Due to these facts, the cost ofsoftware is essentially determined by the cost of the human resources necessary todevelop it.“Software is like entropy: It is difficult to grasp, weighs nothing, and obeysthe Second Law of Thermodynamics; i.e., it always increases.”Norman R. Augustine (1935–), aeronautical engineerA second characteristic of software is related to the fact that supposedly it doesnot wear out,

Chapter 2 Software Engineering . book result from the contributions made by the requirements engineering scientific community. In most cases, those methods and techniques are not exclusive for the . one hand, engineers must be able to manage the development and industrialisation of useful and efficient system. On the other hand, software .