bBookCh11

65
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 11: Managing the Software Process Timing: 90 minutes The most likely way for the world to be destroyed, most The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents." we're computer professionals. We cause accidents."

description

dhdh

Transcript of bBookCh11

  • Object-Oriented Software Engineering Practical Software Development using UML and JavaChapter 11: Managing the Software ProcessTiming: 90 minutesThe most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents."

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*A lot of computer science people think: I dont want to code for the rest of my life. Maybe I would enjoy managing the project.

    What do you think are some of the tasks you would be doing if you were a project manager? Would you still code? Would you miss coding ? Is it important the project manager be able to code?

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*11.1 What is Project Management? Project management encompasses all the activities needed to plan and execute a project: Deciding what needs to be done Estimating costs Ensuring there are suitable people to undertake the projectDefining responsibilities Scheduling Making arrangements for the work continued ...

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process* What is Project Management?Directing Being a technical leader Reviewing and approving decisions made by others Building morale and supporting staff Monitoring and controlling Co-ordinating the work with managers of other projects Reporting Continually striving to improve the process

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Can you think of any Canadian software projects that have gone horribly wrong?Gun Registry In Canadahttp://www.cbc.ca/news/story/2004/02/13/gunregistry_rdi040213.html

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*11.2 Software Process Models Software process models are general approaches for organizing a project into activities. Help the project manager and his or her team to decide:What work should be done;In what sequence to perform the work. The models should be seen as aids to thinking, not rigid prescriptions of the way to do things. Each project ends up with its own unique plan.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*The opportunistic approach

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*The opportunistic approach is what occurs when an organization does not follow good engineering practices.It does not acknowledge the importance of working out the requirements and the design before implementing a system. The design of software deteriorates faster if it is not well designed. Since there are no plans, there is nothing to aim towards. There is no explicit recognition of the need for systematic testing and other forms of quality assurance. The above problems make the cost of developing and maintaining software very high.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*The waterfall model

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*The waterfall modelThe classic way of looking at S.E. that accounts for the importance of requirements, design and quality assurance.The model suggests that software engineers should work in a series of stages. Before completing each stage, they should perform quality assurance (verification and validation). The waterfall model also recognizes, to a limited extent, that you sometimes have to step back to earlier stages.

    QUESTION: What is wrong with getting all the requirements completed upfront (like I have done for you with our project)?

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Limitations of the waterfall modelThe model implies that you should attempt to complete a given stage before moving on to the next stageDoes not account for the fact that requirements constantly change. It also means that customers can not use anything until the entire system is complete. The model makes no allowances for prototyping.It implies that you can get the requirements right by simply writing them down and reviewing them. The model implies that once the product is finished, everything else is maintenance.

    Chapter 11: Managing the Software Process

  • Agile Software DevelopmentAgile Development:based on iterative and incremental development, where requirements and solutions evolve through collaboration between self-organizing, cross-functional teams. It promotes adaptive planning, evolutionary development and delivery, a time-boxed iterative approach, and encourages rapid and flexible response to change. Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*

    Chapter 11: Managing the Software Process

  • *AGILE Method and XP (Extreme Programming)Question: Has anyone heard of the Agile methodology?http://en.wikipedia.org/wiki/Agile_software_development Video

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*ReengineeringPeriodically project managers should set aside some time to re-engineer part or all of the system The extent of this work can vary considerably: Cleaning up the code to make it more readable. Completely replacing a layer.Re-factoring part of the design. In general, the objective of a re-engineering activity is to increase maintainability.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*11.3 Cost estimationTo estimate how much software-engineering time will be required to do some work.Elapsed timeThe difference in time from the start date to the end date of a task or project. Development effortThe amount of labour used in person-months or person-days.To convert an estimate of development effort to an amount of money: You multiply it by the weighted average cost (burdened cost) of employing a software engineer for a month (or a day).

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*QuestionAssume that I gave your group the task of figuring out how much time you needed to code your project because you were going sell it online.

    What are some techniques/ideas/concerns/thoughts you have for estimating the timing of a large project?

    i.e. How do you decide/figure out how long it takes you to do an assignment?

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Principles of effective cost estimationPrinciple 1: Divide and conquer.To make a better estimate, you should divide the project up into individual subsystems.Then divide each subsystem further into the activities that will be required to develop it. Next, you make a series of detailed estimates for each individual activity.And sum the results to arrive at the grand total estimate for the project.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Principles of effective cost estimationPrinciple 2: Include all activities when making estimates. The time required for all development activities must be taken into account.Including:PrototypingDesignInspectingTestingDebuggingWriting user documentationDeployment.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Principles of effective cost estimationPrinciple 3: Base your estimates on past experience combined with knowledge of the current project. If you are developing a project that has many similarities with a past project: You can expect it to take a similar amount of work. Base your estimates on the personal judgement of your expertsorUse algorithmic models developed in the software industry as a whole by analyzing a wide range of projects. They take into account various aspects of a projects size and complexity, and provide formulas to compute anticipated cost.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Algorithmic modelsAllow you to systematically estimate development effort. Based on an estimate of some other factor that you can measure, or that is easier to estimate: The number of use casesThe number of distinct requirementsThe number of classes in the domain modelThe number of widgets in the prototype user interfaceAn estimate of the number of lines of code

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Algorithmic modelsA typical algorithmic model uses a formula like the following: COCOMO:

    Functions Points:

    E = a + bNc

    S = W1F1 + W2F2 +W3F3 +

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Principles of effective cost estimationPrinciple 4: Be sure to account for differences when extrapolating from other projects. Different software developersDifferent development processes and maturity levelsDifferent types of customers and usersDifferent schedule demandsDifferent technologyDifferent technical complexity of the requirementsDifferent domainsDifferent levels of requirement stability

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Principles of effective cost estimationPrinciple 5: Anticipate the worst case and plan for contingencies. Develop the most critical use cases firstIf the project runs into difficulty, then the critical features are more likely to have been completedMake three estimates:Optimistic (O)Imagining a everything going perfectlyLikely (L)Allowing for typical things going wrongPessimisticAccounting for everything that could go wrong

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Principles of effective cost estimationPrinciple 6: Combine multiple independent estimates.Use several different techniques and compare the results. If there are discrepancies, analyze your calculations to discover what factors causing the differences.Use the Delphi technique. Several individuals initially make cost estimates in private. They then share their estimates to discover the discrepancies. Each individual repeatedly adjusts his or her estimates until a consensus is reached.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Principles of effective cost estimationPrinciple 7: Revise and refine estimates as work progresses As you add detail. As the requirements change.As the risk management process uncovers problems.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*11.4 Building Software Engineering Teams Software engineering is a human process. Choosing appropriate people for a team, and assigning roles and responsibilities to the team members, is therefore an important project management skill Software engineering teams can be organized in many different ways

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Software engineering teamsEgoless team:In such a team everybody is equal, and the team works together to achieve a common goal. Decisions are made by consensus. Most suited to difficult projects with many technical challenges.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Software engineering teamsHierarchical manager-subordinate structure:Each individual reports to a manager and is responsible for performing the tasks delegated by that manager.Suitable for large projects with a strict schedule where everybody is well-trained and has a well-defined role. However, since everybody is only responsible for their own work, problems may go unnoticed.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Software engineering teamsChief programmer team:Midway between egoless and hierarchical. The chief programmer leads and guides the project.He or she consults with, and relies on, individual specialists.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Choosing an effective size for a teamFor a given estimated development effort, in person months, there is an optimal team size. Doubling the size of a team will not halve the development time. Subsystems and teams should be sized such that the total amount of required knowledge and exchange of information is reduced. For a given project or project iteration, the number of people on a team will not be constant. You can not generally add people if you get behind schedule, in the hope of catching up.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Skills needed on a teamArchitectProject managerConfiguration management and build specialistUser interface specialistTechnology specialistHardware and third-party software specialistUser documentation specialistTester

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*11.5 Project Scheduling and Tracking Scheduling is the process of deciding:In what sequence a set of activities will be performed.When they should start and be completed. Tracking is the process of determining how well you are sticking to the cost estimate and schedule.

    Chapter 11: Managing the Software Process

  • UWOComputer Science Department*Some Basic Project Management TerminologyDeliverable: some concrete thing which is to be delivered, to the client or internally to the development team; e.g.Specifications reportsExecutable programSource codeTask/Activity: something we have to do during the project; e.g.Defining user requirementsCoding a moduleDoing system testingEach task or activity will take some length of timeReferred to as duration of taskSometimes measured in days, weeks, etc.Sometimes measured in person-days, person-weeks, etc.Person-day = number of people X number of daysExample: 12 person days for writing all code could mean 1 person 12 days or 4 people 3 daysNote: not always true that a task that takes 1 programmer 12 days would take 12 programmers 1 day

    Computer Science Department

  • UWOComputer Science Department*Dependencies and MilestonesFor a given task or activity, may be impossible to start it without some other task(s) or activity(ies) having been completed; e.g.Cannot start coding without completing designCannot start system testing without completing code integration and test planIf task B cannot start without A being completed, we sayB depends on AThere is a dependency between A and BMilestone: some achievement which must be made during the project; e.g.Delivering some deliverableCompleting some taskNote, delivering a deliverable may be a milestone, but not all milestones are associated with deliverables

    Computer Science Department

  • UWOComputer Science Department*Setting and Making DeadlinesDeadline time by which milestone has to be metSome deadlines are set by the clientOthers are set by us on project to make sure project stays on trackTo set a deadline for completing task T, we must consider how long it will take to:Complete the tasks that task T depends onComplete task T itselfIf we miss a deadline, we say (euphemistically) the deadline has slippedThis is virtually inevitableImportant tasks for project managersMonitor whether past deadlines have slippedMonitor whether future deadlines are going to slipAllocate or reallocate resources to help make deadlinesPERT chart and Gantt charts help project managers do these things (among others)

    Computer Science Department

  • UWOComputer Science Department*PERT ChartsPERT = Project Evaluation and Review TechniquePERT chart = graphical representation of the scheduling of events in a projectSample PERT Chart:

    A PERT chart is a graphEdges are tasks/activities that need to be doneNodes are the events or milestonesTask edge T from event node E1 to event node E2 signifies:Until event E1 happens, task T cannot be startedUntil task T finishes, event E2 cannot happenEvents often simply represent completion of tasks associated with arrows entering it

    Computer Science Department

  • UWOComputer Science Department*PERT Chart Task EdgesParts of a task/activity edge

    Task letter:Often keyed to a legend to tell which task it representsTask duration = how long (e.g. days, hours) task will take

    Computer Science Department

  • UWOComputer Science Department*PERT Chart Event Nodes5919Event Number:Sequence number assignedOnly task edges indicate dependenciesEarliest Completion Time (ECT):Earliest time this event can be achieved, given durations and dependenciesLatest Completion Time (LCT):Latest time that this event could be safely achieved

    Computer Science Department

  • UWOComputer Science Department*Building a PERT ChartMake a list of all project tasks (and events if possible).Find interrelated task dependencies (what task has to be completed before other tasks)Draw initial PERT without durations, ECTs or LCTsEstimate duration of each taskFill in durationsCalculate ECTs and LCTsWe will do this for an example system: Generic software system with 3 modulesSteps:

    Computer Science Department

  • UWOComputer Science Department*Example: Generic Software ProjectTASK ID Task Description A Specification B High Level Design C Detailed Design D Code/Test Main module E Code/Test DB module F Code/Test UI module G Write test plan H Integrate/System Test I Write User Manual J Typeset User Manual To start PERT chart: identify dependencies between tasks

    Computer Science Department

  • UWOComputer Science Department*Dummy TasksSometimes it is necessary to use dummy tasks:Shows the dependency between 2 events where no activity is performedExample: Events 3, 4 signify the compilation of separate modules.Create an event 5 to signify all modules compiled together. Denote dummy tasks using dash lines

    Computer Science Department

  • UWOComputer Science Department*Example: Tasks with DependenciesTo start the PERT, identify the dependencies amongst tasks

    TASK ID Task Description Preceed ID Succ. ID

    A Specification 1 2 B High Level Design 2 3 C Detailed Design 3 4 D Code/Test Main 4 5 E Code/Test DB 4 6 F Code/Test UI 4 7 G Write test plan 4 8 Dummy Task 5 8 Dummy Task 6 8 Dummy Task 7 8 H Integrate/System Test 8 9 I Write User Manual 8 10 J Typeset User Manual 10 9

    Computer Science Department

  • UWOComputer Science Department*Software Example: Skeleton PERT ChartNote: dummy tasks connecting events 5, 6 and 7 to 8

    Computer Science Department

  • UWOComputer Science Department*Estimating DurationsSuggestions for estimating durations of tasks:Dont just make up a numberLook at previous similar tasks from other projects and use those as guidelinesTry to identify factors such as difficulty, skill levelEach weighting factor will help you make a better estimate

    Factors to consider:Difficulty of taskSize of teamExperience of teamNumber, attitude and availability of end usersManagement commitmentOther projects in progress

    Computer Science Department

  • UWOComputer Science Department*PERT Chart With DurationsSay we have estimated durations of all tasks (in days)New PERT chart, with durations filled in:Note, dummy tasks (dashed lines) always have a duration of zero

    Computer Science Department

  • UWOComputer Science Department*Calculating ECTsECT = earliest time event can be completedTo calculate:For an event not depending on others: ECT = 0Usually this is the first eventFor an event E depending on one or more others:Calculate ECTs of event(s) that E depends onAdd duration(s) of task(s) leading to EIf E depends on more than one event, take MAXProceed left to right ( ) through the chartExercise: calculate the ECT for our example.

    Computer Science Department

  • UWOComputer Science Department*Calculating LCTLCT = latest time event can be completed, while still finishing last ask at indicated timeTo calculate:For an event which no other events depend on: LCT = ECTGenerally there will only be one such eventFor an event E which one or more others depend on:Calculate LCTs of event(s) that depend on ESubtract duration(s) of task(s) leading from EIf more than one event depends on E, take MINIMUMProceed right to left ( ) through PERT chartExercise: calculate LCT for our example

    Computer Science Department

  • UWOComputer Science Department*Critical PathRed line is the critical pathWhat does it represent?

    Computer Science Department

  • UWOComputer Science Department*Uses of PERT ChartsWe can use PERT charts for:Determining the estimated time to complete a projectDeriving actual project datesAllocating resourcesIdentifying potential and current problems (is one task behind schedule?, can we shuffle people?)Critical Path: Path through chart such that if any deadline slips, the final deadline slips (where all events have ECT = LCT (usually there is only one)In software example:Task I is not on the critical path: even if we dont finish it until time 18, were still okayTask D is on the critical path: if we dont finish it until for example, time 16, then:We cant start task H (duration 3) until time 16So we cant complete task H until time 21We can use PERT charts for Identifying the critical pathReallocating resources, e.g. from non-critical to critical tasks.

    Computer Science Department

  • UWOComputer Science Department*PERT Chart Exercise

    Task Prec Tasks Description Time(hrs)

    A none decide on date for party 1B A book bouncy castle 1C A send invitations 4D C receive replies 7E D buy toys and balloons 1F D buy food 3G E blow up balloons 2H F make food 1I H, G decorate 1J B get bouncy castle 1K J, I have party 1L K clean up 4M K send back bouncy castle 1N L send thank you letters 3O M donate unwanted gifts 3

    Computer Science Department

  • UWOComputer Science Department*PERT Chart ExerciseDraw the PERT chart for the preceding slide and identify the critical path

    Computer Science Department

  • UWOComputer Science Department*Gantt ChartsGraphical Representation of a scheduleHelps to plan, coordinate and track specific tasks in a projectNamed after Henry Gantt who invented them in 1917Depicts some of the same information as on a PERT chartAlso depicts new information

    Computer Science Department

  • UWOComputer Science Department*Example Gantt ChartTASKSA Study current email systemB Define end-user requirementsC Design Class diagramD Acquire computer technologyE Plan & code email modulesF Acceptance test new systemG Deliver new systemQuestions: From the above, can you guess:Which, if any, tasks should have been completed by today and arent even started? ______Which, if any, tasks have been completed? ______Which, if any, tasks have been completed ahead of schedule:? ______Which, if any, tasks are on or ahead of schedule? _________Which, if any, tasks are behind schedule? ________

    Computer Science Department

  • UWOComputer Science Department*Building and Using a Gantt ChartSteps for building a Gantt ChartIdentify the tasks to be scheduledDetermine the durations of each taskList each task down the vertical axis of chartIn general, list tasks to be performed first at the top and then move downward as the tasks will happenUse horizontal axis for the datesDetermine start and finish dates for activitiesConsider which tasks must be completed or partially completed before the next taskTo use the Gantt chart to report progress:If the task has been completed, completely shade in the bar corresponding to the taskIf the task has been partially completed, shade in the percentage of the bar that represents the percentage of the task that has been completedUnshaded bars represents tasks that have not been started.

    Computer Science Department

  • UWOComputer Science Department*Gantt Chart: Exercise

    Task Prec Tasks Description Time(hrs)

    A none decide on date for party 1B A book bouncy castle 1C A send invitations 4D C receive replies 7E D buy toys and balloons 1F D buy food 3G E blow up balloons 2H F make food 1I H, G decorate 1J B get bouncy castle 1K J, I have party 1L K clean up 4M K send back bouncy castle 1N L send thank you letters 3O M donate unwanted gifts 3

    Computer Science Department

  • UWOComputer Science Department*Gantt Chart: ExerciseDraw the Gantt chart using the following criteria:label hours 0 to 30 across the horizontal axisMark a review stage at hour 14 to monitor the progressAssume and illustrate that tasks A, B, C and D have been completed at hour 14State which tasks are ahead and which tasks are behind schedule

    NOTE: if you are using MS Project and want a different unit of time, just type 2 hours (instead of 2 days). ALSO, if you want to have a milestone, like Handing in Group Assignment 1, then give it a ZERO duration.

    Computer Science Department

  • UWOComputer Science Department*Your Gantt chart:

    Computer Science Department

  • UWOComputer Science Department*PERT vs. GanttPERT chartAll us to show dependencies explicitlyAllow us to calculate critical pathCan tell us how one task falling behind affects other tasksGantt chartsAllow us to record progress of projectAllow us to see what tasks are falling behind Allow us to represent overlapping tasksProject Management Tools, e.g. MS ProjectAllow us to specify tasks, dependencies, etcAllow us to specify progress on tasks, etcCan generate either PERT or Gantt charts (whichever we want) from data entered

    Computer Science Department

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Bouncy Castle PERT Example using MS Project

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Bouncy Castle Gantt Example using MS ProjectIn MS Project set the task length to be 0 to get a milestone

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*11.7 Difficulties and Risks in Project ManagementAccurately estimating costs is a constant challengeFollow the cost estimation guidelines. It is very difficult to measure progress and meet deadlines Improve your cost estimation skills so as to account for the kinds of problems that may occur. Develop a closer relationship with other members of the team. Be realistic in initial requirements gathering, and follow an iterative approach. Use earned value charts to monitor progress.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Difficulties and Risks in Project ManagementIt is difficult to deal with lack of human resources or technology needed to successfully run a project When determining the requirements and the project plan, take into consideration the resources available. If you cannot find skilled people or suitable technology then you must limit the scope of your project.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Difficulties and Risks in Project ManagementCommunicating effectively in a large project is hard Take courses in communication, both written and oral. Learn how to run effective meetings. Review what information everybody should have, and make sure they have it. Make sure that project information is readily available.Use groupware technology to help people exchange the information they need to know

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*Difficulties and Risks in Project ManagementIt is hard to obtain agreement and commitment from others Take courses in negotiating skills and leadership. Ensure that everybody understands The position of everybody else. The costs and benefits of each alternative.The rationale behind any compromises. Ensure that everybodys proposed responsibility is clearly expressed. Listen to everybodys opinion, but take assertive action, when needed, to ensure progress occurs.

    Chapter 11: Managing the Software Process

  • Lethbridge/Laganire 2005Chapter 11: Managing the Software Process*ReviewDraw a PERT Chart for the following activities:

    ActivityDescriptionPredecessorEstimated TimeADrive homeNone0.5BWash ClothesA4.0CPackB0.5DGo to bankA1.0EPay billD0.5FPack carC,E0.5GDrive to busF0.5

    Chapter 11: Managing the Software Process

    ******E effortN number of requirements or use cases or lines of codeS system sizeW weightF Feature number of inputes, tables in a database, usecases, etc**Dummy tasks always have 0 duration.

    From this, we can calculate ECTs and LCTs