Object-Oriented Software Analysis and Design MISM/MSIT, CMU Dr. Rahmi MARASLI.

of 47 /47
Object-Oriented Software Analysis and Design MISM/MSIT, CMU Dr. Rahmi MARASLI

Embed Size (px)

Transcript of Object-Oriented Software Analysis and Design MISM/MSIT, CMU Dr. Rahmi MARASLI.

  • Object-Oriented SoftwareAnalysis and DesignMISM/MSIT, CMUDr. Rahmi MARASLI

  • PrerequisitesKnowledge of at least one object-oriented programming languageC++JavaSmalltalk or your favorite O-O language!

  • GoalsLearn O-O A&D methodologyUnderstand why a methodology is useful for real software projectsLearn UMLUnderstand the roles and limitations of CASE toolsLearn O-O design patternsBuild something that illustrates the concepts

  • BooksFundamentals of Object-Oriented Design in UML, by Meilir Page-Jones (required)Extreme Programming Explained, by Kent Beck (required)Other books of interest (not required):Applying UML and Patterns, by Craig LarmanDesign Patterns, by E. Gamma, R. Helm, R. Johnson, and J. Vlissides The Unified Modeling Language Reference Manual, by J. Rumbaugh, I. Jacobson and G. BoochSoftware Requirements, by Karl WiegersCourse syllabus pointed to on Blackboard: www.cmu.edu/blackboard/Use the Bb Discussion Forum for questionsEmail: [email protected] office: HbH 3021My office hours: Mondays 4:45-5:15, or by appointmentEverything is attached to the syllabus. Dont look for assignments, etc. on Blackboard. Look at the syllabus!

  • Course OutlineO-O A&DRequirements analysis Wiegers RALarmans RAUse CasesConceptual ModelIntroductionAssociationsAttributesGeneralization

  • Course Outline (cont)System BehaviorSystem Sequence Diagrams ContractsState DiagramsInteraction DiagramsCollaboration DiagramsDesign PatternsGRASP PatternsGoF Patterns

  • Course Outline (cont)Determining VisibilityDesign Class DiagramsIssues in System Design O-O MetricsGuest Lecturer (tentative)Extreme Programming Presentations

  • Object-Oriented Analysis and Design

  • What is Analysis and Design?Analysis emphasizes an investigation of the problem rather than how a solution is definedDesign emphasizes a logical solution, how the system fulfills the requirements

  • Analysis and Design (cont)Division between A & D is fuzzyA & D activities exist on a continuumSome practitioners can classify an activity as analysis while others put it into design categoryMore analysis orientedMore design oriented-what-requirements-investigation of domain-understanding of problem-how-logical solution-understanding and description of solution

  • What is O-O A&D?The essence of O-O A&D is to consider a problem domain and logical solution from the perspective of objects (things, concepts, or entities)O-O Analysis emphasizes finding and describing the objects or concepts- in the problem domainO-O Design emphasizes defining logical software objects (things, concepts, or entities) that have attributes and methods

  • Object vs. Function Oriented AnalysisLibrary Info SystemO-O A&DDecompose by objects and conceptsStructured A&DDecompose by functions and processesCatalogLibrarianBookLibrarySystemRecord LoansAdd ResourceReport Fines

  • O-O A&D AnalysisDesignRequirements AnalysisUse CasesConceptualModelSystem BehaviorCollaborationDiagramsConstructionClass DesignDiagramsCode&TestLarman 1998

  • Unified Modeling LanguageA language for specifying, visualizing and constructing the artifacts of software system [Booch, Jacobson, Rumbaugh]It is a notational system aimed at modeling systems using O-O concepts not a methodology not a process

  • Requirements Analysis

  • Requirements AnalysisHello, Phil? Were having a problem with the employee system you programmed for us. An employee just changed her name to Sparkle Starlight, and we cant get the systemto accept the name change. Can you help?Phil in SystemsMaria in HRShe married some guy named Starlight?

  • Requirements AnalysisNo, she didnt get married, just changedher name. Thats the problem. It lookslike we can change a name only ifsomeones marital status changes.Phil in SystemsMaria in HRWell, yeah, I never thought someone mightjust change her name. I dont remember youtelling me about this possibility when wetalked about the system. Thats why you canget to the Change Name dialog box only fromthe Change Marital Status dialog box.

  • Requirements AnalysisI assumed you knew that people couldlegally change their name anytime they like. We have to straighten this out by Friday, orSparkle wont be able to cash her paycheck.Can you fix the bug by then?Phil in SystemsMaria in HRIts not a bug! I never knew you neededthis capability. Im busy now. I can probablyfix it by the end of the month. Next time,tell me these things earlier, and please writethem down.

  • Requirements AnalysisWhat am I going to tell Sparkle? Shesreally going to be ticked if she cant cashher checkPhil in SystemsMaria in HRHey Maria, its not my fault. If youd toldme in the first place that you had to be able tochange someones name at any time, thiswouldnt have happened. You cant blame mefor not reading your mind.

  • Requirements AnalysisYeah, well, this is the kind of thing thatmakes me hate computer systems. Call meas soon as its fixed, will you?Phil in SystemsMaria in HR

  • Some Obvious Problems HereInformal information gatheringImplied functionalityErroneous or un-communicated assumptionsInadequately defined requirementsA casual change process

  • Who Are The Stakeholders in a Software Project?Customers who fund or buy a productUsers who use the productRequirements analystsDevelopers and testersProject managersLegal staffManufacturing peopleSales, marketing, field support, help desk, etc.

  • What Is a Requirement, Exactly?IEEE Standard Glossary of Software Engineering Terminology:A condition or capability needed by a user to solve a problem or achieve an objectiveA condition or capability that must be met or possessed by a system or system component to satisfy a contract, standard, specification, or other formally imposed documentBut isnt a user really a stakeholder?

  • RequirementsA description of needs and desires for a productPrimary goal To identify and document what is really needed, in a form that clearly communicates to both client and to development members (and to all other stakeholders)

  • Wiegers DiagramVision and Scope DocumentUse Case DocumentBusiness RequirementsUser RequirementsBusiness RulesQuality AttributesSystems RequirementsFunctional RequirementsExternal InterfacesConstraintsSoftware RequirementsSpecificationFunctionalNonfunctional

  • Business RequirementsHigh-level objectives of the organizationThese are at the top-most level of the requirements chainThese come fromthe funding sponsor, orthe customer, ormarketing

  • Business Requirements (cont)We must have these before any other (e.g., user and functional) requirementsThese must show how the project will achieve business objectivesThese are the basis for determining product features and proposed releasesThese should be very publicRecord these in a Vision and Scope document

  • User RequirementsUser tasks that the user must be able to performThese can be described by use cases, or scenario descriptions, or event-response tables orEx: Make a reservation with the airlineRecord these in a Use Case document

  • System RequirementsThese are for systems, i.e., things that contain subsystemsSubsystems may be hardware or software or bothPeople are part of a system, tooExample: Airline reservation systemSoftware subsystems: dbase manager, graphical UI, communication system, etc.Hardware subsystems: Mainframes, access terminals, communication infrastructure, etc. People: Travel agents, etc.

  • Functional RequirementsSoftware functionality that developers must build to enable users to achieve their tasksTraditional shall statements:The system shall record the sale transaction in the global databaseThe system shall provide the user with the opportunity to edit her comment textUpon identifying a misspelled word, the program shall present a list of possible alternative words/spellings

  • Business RulesNot really software requirements, but facts and constraints that must be respectedCorporate policies, government regulations, industry standards, accounting practices, etc.Sales tax is not collected on shipping chargesNon-refundable tickets incur a fee when the purchaser changes an itinerary.

  • Quality AttributesAvailabilityMeasure of planned uptime during which system is available for use and fully functionalReliabilityProbability of system running without a failure for a specified period of timeRobustnessHow system functions when confronted with unexpected operating conditions

  • Quality Attributes (cont)InteroperabilityHow easily it is to exchange data or services with other systemsFlexibilityHow easy it is to add new capabilities to productIntegrityBlocking unauthorized access to system functions, preventing information loss, etc.

  • Quality Attributes (cont)UsabilityEase of use, user friendlinessEfficiencyHow well system utilizes system processor, disk, memory bandwidth, etc. resourcesMaintainabilityHow easy it is to fix a bug or modify softwarePortabilityHow easy it is to migrate a piece of software to a new environment

  • Quality Attributes (cont)ReusabilityHow easy it is to use part of software in other applicationsTestabilityHow easy it is to verify system functionalityetc.

  • External InterfacesMost computer programs do not stand alone; they must co-exist:Are there external data inputs?Are there external outputs?How should local errors be explained?How does external data affect my user interfaces? etc.

  • ConstraintsThese are choices available to developer for design and construction of productOur servers are brand XXX, and run YYY softwareWe are an open source shop All our HTML must be interpretable by IE v. xxx, we dont care about NetscapeAll of our numerical output must be correct to within +- 10e-22

  • Features vs. RequirementsA feature is a set of logically related functional requirements It provides capability to a user and enables satisfaction of a business objectiveExamples:Its easy to add clip art to your presentation!All of last years messages from XXX can be displayed instantly!Our Web-Link technology discovers the identity of selected clients in your database!

  • What Requirements Are NotDesign or implementation detailsProject planning informationTesting strategies or detailsOther project requirements likeDevelopment environmentBudget limitationsTraining

  • A Standard Graph120100806040200Relative Cost to Correct a DefectDevelopment PhaseRequirementsDesignCodeTestOperationGrady 1999

  • Common ProblemsInsufficient user involvementCreeping user requirementsAmbiguous requirementsGold platingMinimal specificationOverlooked user classesInaccurate planning

  • Example: Chess PlayingBuild a system to play chess with the userProvide a visual display of the chess board and the chess piecesProvide a simple means for the user to move her chess piecesBoth the system and the user will be restricted to legal moves.The system will recognize when a player has won

  • Functional RequirementsEstablish essential behaviors for any correct implementation (legal moves, etc.)True for every implementation, on every machine, in every language, in any operating environmentBut there is more...

  • Nonfunctional RequirementsOperational properties of the delivered systemResponse time, ease of use, ilitiesDifficult to describe logicallyDifficult to check in advance of an implementationEvery bit as important as functional requirements

  • Vision & Scope DocumentBusiness RequirementsVision of the SolutionScope and LimitationsBusiness ContextWiegers 2003

  • Vision & Scope (cont)Vision describes, in business terms, what the product is about, and where it might goScope describes whats in and whats outVision has nothing to do with features; it should be stable, and change slowly,but it may imply several releases

  • Another Dopey Diagram