Software Engineering: A Practitioner's Approach

Transcription

Software Engineering:A Practitioner's ApproachCopyright 1996, 2001R.S. Pressman & Associates, Inc.For University Use OnlyMay be reproduced ONLY for student use atthe university levelWhen used in conjunction with SoftwareEngineering: A Practitioner's Approach.Any other reproduction or use is expresslyprohibited.

Chapter1The ProductCHAPTER OVERVIEW AND COMMENTSThe goal of this chapter is to introduce the notion of software asa product designed and built by software engineers. Software isimportant because it is used by a great many people in society.Software engineers have a moral and ethical responsibility toensure that the software they design does no serious harm toany people. Software engineers tend to be concerned with thetechnical elegance of their software products. Customers tend tobe concerned only with whether or not a software productmeets their needs and is easy to use.1.1The Evolving Role of SoftwareThe main point of this section is that the primary purpose ofsoftware is that of information transformer. Software is used toproduce, manage, acquire, modify, display, and transmitinformation anywhere in the world. The days of the loneprogrammer are gone. Modern software is developed by teamsof software specialists. Yet, the software developer's concernshave remained the same. Why does software take so long tocomplete? Why does it cost so much to produce? Why can't allerrors be found and removed before software is delivered to thecustomer?1.2SoftwareSoftware is not like the artifacts produced in most otherengineering disciplines. Software is developed it is notmanufactured in the classical sense. Building a software productis more like constructing a design prototype. Opportunities forreplication without customization are not very common.Software may become deteriorate, but it does not wear out. Thechief reason for software deterioration is that many changes aremade to a software product over its lifetime. As changes are

made, defects may be inadvertently introduced to otherportions of the software that interact with the portion that waschanged.1.3Software: A Crisis on the HorizonMany people have written about the "software developmentcrisis". There seems to be an inordinate fascination with thespectacular software failures and a tendency to ignore the largenumber of successes achieved by the software industry.Software developers are capable of producing software thefunctions properly most of the time. The biggest problem facingmodern software engineers is trying to figure out how toproduce software fast enough to meet the growing demand formore products, while also having to maintain a growingvolume of existing software.1.4Software MythsThe myths presented in this section provide a good source ofmaterial for class discussion. Managers need to understand thatbuying hardware and adding people does not spontaneouslysolve all software development problems. Customers need tounderstand that computer software does not make all theirother problems go away. If the customer can not define his orher needs clearly, it is not possible to build a software productto meet these needs. If a customer does not have definedbusiness processes without computer support, buildingcomputer software will not create these processes automatically.Software engineers must be committed to the concept of doingthings right the first time. Software quality does not happen onits own after a product is finished. Quality must be built intoevery portion of the software development process.PROBLEMS AND POINTS TO PONDER1.1. Classic examples include the use of "digitalautomobile dashboards" to impart a high tech, highquality images. Appliances that "think;" the broadarray of consumer electronics; personal computers(today, differentiated more by their software functionthan the hardware), industrial instrumentation ated by software.

1.2. The apprentice/artist culture of the 1950s and1960s worked fine for single person, well constrainedprojects. Today, applications are more complex, teamswork on large projects, and software blished in the early days dies hard, leading morethan a little resistance to more disciplined methods.In addition (see Chapter 29), the new generation ofWeb application developers is repeating many of thesame mistakes that programmer made during the circa1965.1.3. This is a good problem for classroom discussion(time permitting). Rather than focusing on cliche'ridden (albeit important) issues of privacy, ght" and how software can help to exacerbateor remedy it. Another interesting possibility is touse Neumann's "Risks" column in SEN to key discussion.You might also consider new attempts at ctiveentertainment, virtual reality, e-commerce, etc.1.5. There are literally dozens of real lifecircumstances to choose from. For example, softwareerrors that have caused major telephone networks tofail, failures in avionics that have contributed toplane crashes, computer viruses (e.g., Michaelangelo)that have caused significant economic losses. Attackson major e-commerce sites.1.6. The two broadest categories encompass risksassociated with economic loss and risks to the wellbeing of people. You might suggest that each studentselect five risks (culled from the sources noted) andpresent them to the class. Encourage them to look forhumorous as well as serious risks.1.7. To be honest, most professors do not assignpapers as part of software engineering courses thatuse SEPA. Instead, a term project (or a number ofsomewhat smaller projects) are assigned. However, youmight consider discussing software engineering issuesas they relate to the topics noted in this problem.1.8Another way to characterize this problem is tosuggest that each student describe a software myththat he or she believed that has subsequently beendispelled. From the student's point of view, mythswill likely be driven by programming projects thatthey've attempted earlier in their career. To givethis problem a contemporary feel, you might considerthe myths that have evolved around the development ofWeb-based applications.

Chapter2The ProcessCHAPTER OVERVIEW AND COMMENTSThis chapter discusses several process models used byprofessional software developers to manage large-scalesoftware projects. No software process works well for everyproject. However, every project needs to conform to somesystematic process in order to manage software developmentactivities that can easily get out of control. Software processeshelp to organize the work products that need to be producedduring a software development project. Ultimately the bestindicator of how well a software process has worked is thequality of the deliverables produced. A well-managed processwill produce high quality products on time and under budget.2.1Software Engineering - A Layered TechnologySoftware engineering encompasses a process, the managementof activities, technical methods, and use of tools to developsoftware products. Software is engineered by applying threedistinct phases (definition, development, and support).Students need to understand that maintenance involves morethan fixing bugs.2.2The Software ProcessThis section discusses the concept of a software processframework and provides a brief overview of the SoftwareEngineering Institute Capability Maturity Model. It is importantto emphasize that the Capability Maturity Model does notspecify what process model needs to be used for a given projector organization. Rather, it provides a means of assessing howwell an organization's processes allow them to complete andmanage new software projects.2.3Software Process Models

The terms "software process model" and "software engineeringparadigm" are used interchangeably in the literature. Thischapter presents overviews of several software process models.It is easy for students to become so lost in the details of thevarious process models that they fail to see the features themodels have in common with each other. Another difficultystudents have is their belief that each phase of a process isperformed completely independently of the other phases. Thereality is that there tends to be lots overlap among the phases.2.4The Linear Sequential ModelThe linear sequential model is also known as the "classic lifecycle" or "waterfall model". System development proceedsthough the phases (analysis, design, coding, testing, support) inorder. This is a good model to use when requirements are wellunderstood. If a phase must be revisited in this model, processfailure is indicated (more thorough requirements analysis isneeded).2.5The Prototyping ModelThis model is good to use when the customer has legitimateneeds, but is not able to articulate the details at the start of theproject. A small mock-up of a working system is developed andpresented to the customer. Sometimes this first system isdiscarded and sometimes it is extended based on the customer'sfeedback.2.6The RAD ModelThe rapid application deployment model is a high-speedadaptation of the linear sequential model. Project requirementsmust be well understood and the project scope tightlyconstrained. Developers are often able to use component-basedconstruction techniques to build a fully functional system in ashort time period.2.7Evolutionary ModelsThe two most important models in this section are theincremental model and the spiral model. The incremental modelcombines elements of the linear sequential model appliedrepetitively with the iterative philosophy of the prototypingmodel. Each increment produces a working version of a

software product with increasing functionality. There is nothrowaway code. The spiral model also combines the iterativenature of prototyping with the systematic control found in thelinear sequential model. An essential component of the spiralmodel is that assessment of both management and technicalrisks is performed as each incremental release is completed.2.8Component-Based DevelopmentObject-based technologies provide the technical framework forcomponent-based software engineering. The component-baseddevelopment (CBD) model incorporates many of the iterativecharacteristics of the spiral model. The main difference is that inCBD the emphasis is on composing solutions from prepackagedsoftware components or classes. This CBD emphasizes softwarereusability. The unified software development process is anexample of CBD that has been proposed for industrial use. Theunified modeling language (UML) is used to define thecomponents and interfaces used in the unified softwaredevelopment process.2.9The Formal Methods ModelFormal methods in software development require the use ofrigorous mathematical notation to specify, design, and verifycomputer-based systems. Mathematical proof is used to verifythe correctness of a system (not empirical testing). Cleanroomsoftware engineering is an example of this approach. Whileformal methods have the potential to produce defect-freesoftware, the development of formal models is both timeconsuming and expensive.2.10 Fourth Generation TechniquesThis is a broad class of techniques. The general idea is that asoftware tool is used to describe a system in manner understoodby the customer using a specialized design language orgraphical notation. In the ideal case, the tool then generatessource code from this system description that can be compiledinto a running system. The running system then needs to betested and refined using other software engineering processes.There is some risk that the customer is not able to describe thesystem in sufficient detail or that the initial system will bedeployed without sufficient testing.

Section 2.12 uses a short essay by Margaret Davis toput process and product issues into perspective. If you’reteaching a graduate course, I’d recommend PhillipHoward’s The Death of Common Sense, as outside reading onthe failures of a wholly process-oriented mind set.PROBLEMS AND POINTS TO PONDER2.1. You might suggest that students use the FurtherReadings and Information Sources section of Chapter 8for pointers.2.2. The support phase is applied differently forembedded software. In most cases, embedded software isdefined and developed, but once it is placed in itshost environment, it is not likely to change until anew release of the product occurs.2.3.The latest SEI information can be obtained at:http://www.sei.cmu.edu/2.4. In each case status quo, problem definition,technical development, and solution integration areapplied at a different levels of abstraction. ts level would entail many meetings withmarketing and even potential end-users;“technicaldevelopment” at the product requirements level woulddemand the creation of a product specification;“solution integration” would require detailed reviewagainst customer requirements and modifications. At alower level of abstraction (e.g., generate code .)the nature of these activities would change, movingaway from customer related information and towardimplementation specific information.2.5. Assign this problem as is if the majority ofyour class is composed of industry practitioners. Ifyour students are "green," suggest a project scenarioand ask the students to identify the appropriateparadigm. The key here is to recognize that the "best"paradigm is a function of the problem, the customer,the environment, the people doing the work and manyother factors. My choice — all thing being equal — isthe evolutionary approach.2.6. Software applications that are relatively easyto prototype almost always involve human-machineinteraction and/or heavy computer graphics. ping are certain classes of mathematicalalgorithms, subset of command driven systems and otherapplications where results can be easily examinedwithout real-time interaction. Applications that aredifficult to prototype include control and ications and embedded software.

2.7. Any software project that has significantfunctionality that must be delivered in a very tight(too tight) time frame is a candidate for lity in increments. Example: a sophisticatedsoftware product that can be released to themarketplace with only partial functionality—new andimproved versions to follow!2.8Any project in which tight time-lines anddelivery dates preclude delivery of full functionalityis a candidate for the incremental model. Also anysoftware product in which partial functionality maystill be saleable is a candidate.2.9. As work moves outward on the spiral, the productmoves toward a more complete state and the level ofabstraction at which work is performed is reduced(i.e., implementation specific work accelerates as wemove further from the origin).2.10. I would suggest postponing this problem untilChapter 27 is assigned, unless you do not intend toassign it. In that case, it can serve to introduce theimportance of reuse.2.11. Stated simply, the concurrent process modelassumes that different parts of a project will be adifferent stages of completeness, and therefore,different software engineering activities are allbeing performed concurrently. The challenge is tomanage the concurrency and be able to assess thestatus of the project.2.12. An SQL, a spreadsheet, a CASE code generator,graphical tools like VisualBasic, Powerbuilder, Webpage construction tools2.13. The product is more important! That’s whatpeople use and what provides benefit to end users.Chapter3Project Management Concepts

CHAPTER OVERVIEW AND COMMENTSThis chapter discusses project management at a fairly generallevel. The important point to get across is that all softwareengineers are responsible for managing some portion of theprojects they work on. Modern software development is a verycomplex undertaking that involves many people working overlong periods of time. The key to successful project managementis to focus on the four P's (people, product, process, andproject). Effective communication among customers anddevelopers is essential. The process selected must beappropriate for the people and the product. The project must beplanned if the goal is to deliver high quality software, on timeand under budget.3.1The Management SpectrumThis section provides an overview of the four P's of projectmanagement. The point to emphasize is that each the P's isimportant and it is the synergy of all four working together thatyields the successful management of software products. Thisalso the time to remind students that it is customer for whomthe product is being developed. Process framework activitiesare populated with tasks, milestones, work products, andquality assurance checkpoints regardless of the project size. Toavoid project failure developers need react to warning signs andfocus their attention on practices that are associated with goodproject management.3.2PeopleCompanies that manage their people wisely prosper in the longrun. To be effective the project team must be organized in away that maximizes each person's skills and abilities. Effectivemanagers focus on problem solving and insist on high productquality. Software teams may be organized in many differentways. Two keys factors in selecting a team organizational modelare desired level of communication among its members anddifficulty level of the problems to be solved. Hierarchicallyorganized teams can develop routine software applicationswithout much communication among the team members.Teams having a more democratic style organization oftendevelop novel applications more efficiently. It is important forstudents to understand that the larger the team, the greater the

effort required to ensure effectivecoordination of team member efforts.communicationand3.3 The ProblemThe first project management activity is the determination ofsoftware scope. This is essential to ensure the productdeveloped is the product requested by the customer. It issometimes helpful to remind students that unless developersand customers agree on the scope of the project there is no wayto determine when it ends (or when they will get paid).Regardless of the process model followed, a problem must bedecomposed along functional lines into smaller, more easilymanaged subproblems.3.4The ProcessOnce a process model is chosen, it needs to be populated withthe minimum set of work tasks and work products. Avoidprocess overkill. It is important to remind students thatframework activities are applied on every project, no matterhow small. Work tasks may vary, but not the common processframework. Process decomposition can occur simultaneouslywith product decomposition as the project plan evolves.3.5The ProjectThe text lists 10 warning signs that indicate when a softwareproject is failing. Software engineers need to be on the watch forthem and take corrective action before failure occurs. Mostfailures can be avoided by doing things right the first time andavoiding the temptation to cut corners to try to shorten thedevelopment cycle. Skipping process steps often has the effectof lengthening the development time since the amount of workusually increases. Taking time to reflect on how things wentonce a project is over, is a good habit to develop in students(who should be striving to avoid repeating their past mistakeson future projects).3.6The W5HH PrincipleBoehm's W5HH principle is a simple organizing tool that canhelp both novice and experienced software engineers focus onwhat is really important to include in a project managementplan. Boehm's questions are applicable to all software projects,regardless of their size or complexity.

3.7Critical PracticesThe Airlie Council list of project integrity critical practicesprovides a good baseline for assessing how well a project teamunderstands its practices. Most of the items in this list will bediscussed in later chapters of the text. It may be helpful to havestudents begin thinking about this list in the context ofdeveloping their own project management plans. While this isdifficult undertaking for students early in the course, it does getthem thinking about the big picture without worrying about thedetails of software implementation.PROBLEMS AND POINTS TO PONDER3.1.Ten commandments:1.Thou shalt get smarter (provide education).2.Thou shalt focus on quality.3.Thou shalt listen to the customer.4.Thou shalt understand the problem.5.Thou shalt work within a repeatable process.6.Thou shalt not agree to ridiculous schedules.7.Thou shalt measure the product, the process andyourself.8.Thou shalt document the work in the mosteffective way.9.Thou shalt remember that others will also work onthe software.10. Thou shalt continually improve3.2.The latest SEI information can be obtained at:http://www.sei.cmu.edu/3.3. Same person: (1) an engineer who must develop aprogram for personal use; (2) a business personcreating a spreadsheet model for personal use; (3) anentrepreneur who has a new concept for a killer App.Different person: (1) an IS department servicing somebusiness function; (2) a software development groupservicing marketing needs; (3) a contractor buildingto customer specs.3.4. Intoday’senvironmentdownsizingandoutsourcing have the most immediate and significantimpact. In addition, "expense reduction measures" thatlead to lower product quality; unrealistic projectdeadlines; failure to "listen" to the customer, or

conversely, to warningsengineers doing the work.notedbythesoftware3.6. A controlled decentralized team is one option.Since requirements are well defined, it will bepossible to partition requirements and allocation tosubteams. The large size of the project also mitigatesin favor of a CD team. Since there is no discussion ofschedule, we assume that delivery date is reasonable.Therefore, it might be possible to use a linearsequential process model (work has been done before).However, an iterative model (e.g., spiral) is also agood possibility.3.7. The DD team is probably the only viable option,given hazy requirements and the experimental nature ofthe work. A prototyping approach or an evolutionaryprocess model should be used.3.8. A CC team is probably best, given time pressureand familiarity with the work (however, a CD teammight also work well). An incremental process model isindicated by the deadline driven nature of this work.3.9. A CD team is probably best, given that the workis experimental, but that there is a businessdeadline. Another possibility is to use a DD team. Anincremental process model or an evolutionary processmodel could be used, given the deadline driven natureof this work.3.10. Much of the problem has to do with the structureof documents and when they are created. Documentsshould be kept lean and should be generated assoftware engineering work is being conducted, NOTafter the fact. If this is done, the perceived valueof documents will improve.

3.11. The GradeAnalyzer application will obtain gradesfor all undergraduate and graduate for-credit coursescontained in the Registrar’s data base of courses fora given semester. GradeAnalyzer will read all gradesfor each course and compute the average grade using anumerical scale in which an A 4.0 and other gradesare assigned values as indicated in grade valuedocument UC29-1. GradeAnalyzer will print and/ordisplay a report that lists each course, theinstructor, the average grade. The report may besorted by department, by highest to lowest averagegrade, by instructor or by any permutation of thesecharacteristics. GradeAnalyzer will be implemented torun under Microsoft Windows 200x environment.3.12. A simple decomposition:page layoutdefine page parametersallocate text regionsallocate graphical regionsdefine emphasis (lines, shading, etc.)input/import textinput/import graphicsedit textedit graphicsoutpage/export pageend page layoutChapter4

Software Process and Project MetricsCHAPTER OVERVIEW AND COMMENTSThis chapter provides an introduction to the use of metrics as amechanism for improving the software development processand managing software projects. A more complete discussion ofsoftware quality assurance appears later in the text. Theconcepts discussed in this chapter will be difficult for thestudents to relate to prior to working on a large softwareproject. It is important to expose them to the reasons for usingmetrics and so that they can appreciate their potential inmonitoring development costs and schedules on future projects.4.1Measures, Metrics, and IndicatorsThe important point to get across in this section is thatmeasures, metrics, and indicators are distinct (though related)entities. A measure is established when a single data point iscollected. A software metric relates individual measures in ameaningful way. An indicator is a metric or combination ofmetrics that provide insight into the software project, process,or product.4.2Metrics in the Process and Project DomainsMeasurement is not used in software engineering work as oftenas it is in other branches of engineering. Software engineershave trouble agreeing on what to measure and have troubleevaluating the measures that are collected. The point to getacross to the students is that the only rational way to improve aprocess is to make strategic decisions based on metrics andindicators developed from measurements of process attributes.Students also need to understand the differences betweenprocess metrics and project metrics. Process metrics are used tomake strategic decisions about how to complete the commonprocess framework activities. Project metrics are used tomonitor progress during software development and to controlproduct quality.4.3Software Measurement

In this section the differences between direct measures (e.g.LOC or defects over time) and indirect measures (e.g.functionality or quality) in software engineering are discussed.Size-oriented metrics are derived by normalizing quality orproductivity measures over the product size (typically LOC orKLOC). Students need to appreciate some weaknesses of LOCas a measure (like language dependency). Some discussionabout what to count in LOC (e.g. executable statements) andwhat not to count (e.g. comments) might be wise here.Function points are presented as an example of a method ofindirectly measuring functionality using other direct measures.Function points can be used to normalize software. Functionpoint values (FP) are easier for students to compute (prior toimplementation) than LOC for their projects. Function pointswere originally developed for information systems applications.Feature points and 3D function points are extensions of thefunction point measures to engineering applications involvingreal-time programming or process control.4.4Reconciling Different Metrics ApproachesThis table presented in this section provides a good resource forstudents to use when estimating LOC for their projects fromfunction points prior to writing the source code. Studentsshould be cautioned against the practice of backtracking (usingthe table to compute function point from the LOC measure for acompleted program). A key point: using LOC or FP in projectestimation (discussed in Chapter 5) requires the existence ofbaseline historical data.4.5Metrics for Software QualityA detailed discussion of software quality assurance appearslater in the text. This section is intended to get students thinkingabout the role of measurement to assess product quality andprocess effectiveness during project development. Studentsshould also be made aware of the fact that the factors thatdefined software quality in the 1970's (correctness,maintainability, integrity, usability) continue to define softwarequality today. Defect removal efficiency is an importantsoftware quality metric that can useful at both the process andproject levels.4.6Integrating Metrics within the Software Engineering Process

The fact that many software developers resist the use ofmeasurement to guide their work will make it hard to convincestudents of its importance. However, the fact remains ifdevelopers do not measure they have no means of determiningwhether they are improving or not. Students need tounderstand that many current practitioners are still self-trainedand may not be following the best development practices.Current thinking among experienced software developers isthat process improvement is essential to remain competitiveeconomically. This cannot happen without means of repeatingpast successes and avoiding inefficient development practices.4.7Managing Variation—Statistical Quality ControlA complete discussion of statistical process control is beyondthe scope of this text. However, the idea of using a control chartto identify out of control processes is understandable tostudents. Implicit in using this technique is the necessity ofhaving access to baseline historic metric data to compute thestandard deviations and means required to apply the zonerules.4.8Metrics for Small OrganizationsThe important point in this section is that small projects andsmall organizations can also benefit economically from theintelligent use of software metrics. The key is to select metrics tocompute carefully and to ensure that the data collection processis not to burdensome for the software developers.4.9Establishing a Software Metrics ProgramThis section discusses the steps needed to establish a goaldriven software metrics program. The important points are tochoose your business goals and to determine what you expect tolearn from the metrics program. The measures and derivedindicators used will need to answer questions related to theattainment of these goals. It is also important to keep in mindthat the modern view of software quality assurance includescustomer satisfaction goals as well

development process. 2.9 The Formal Methods Model Formal methods in software development require the use of rigorous mathematical notation to specify, design, and verify computer-based systems. Mathematical proof is used to verify the correctness of a system (not empirical testing). Clean