240 likes | 246 Views
This article provides an overview of software engineering, including concepts, models, and the Unified Modeling Language (UML). It explores the challenges of software development, the importance of modeling, and the use of UML in designing software systems.
E N D
Software Engineering September 5, 2001 Introduction to Software Engineering Joseph Conron Computer Science Department New York University jconron@cs.nyu.edu
What is Software Engineering • Software systems are complex • Impossible to understand by a single person • Many projects are never finished: "vaporware" • The problem is arbitrary complexity • 1968 Definition: • Software Engineering means the construction of quality software with a limited budget and a given deadline • Our definition: • Software Engineering means the construction of quality software with a limited budget and a given deadline in the context of constant change • Emphasis is on both, on software and on engineering
Software Engineering Concepts: Definitions • Project – set of activities to develop a software system • Activity – a phase in which related tasks are carried out • Task – effort that uses resources AND produces WorkProduct • Resources – time, equipment, people (participants) • WorkProduct – a model, system, or artifact
Project Activity WorkProduct Task Resources System Participant Model Time Document Equipment Software Engineering Concepts * is produced by consumes * * *
Software Engineering Activities • Requirements Elicitation • Analysis • System Design • Object Design • Implementation
Introduction to Modeling and UML • What is modeling? • What is UML? • Use case diagrams • Class diagrams • Sequence diagrams • Activity diagrams • Summary
Systems, Models, and Views • A model is an abstraction describing system or a subset of a system • A view depicts selected aspects of a model • A notation is a set of graphical or textual rules for representing views • Views and models of a single system may overlap each other
Systems, Models, and Views Flightsimulator Blueprints Airplane Electrical Wiring Scale Model
* * System Model View depicted by described by airplane:System scaleModel:Model flightSimulator:Model blueprints:View fuelSystem:View electricalWiring:View Models, Views, and Systems (UML)
Why model software? Software is already an abstraction: why model software? • Software is getting larger, not smaller • NT 5.0 ~ 40 million lines of code • A single programmer cannot manage this amount of code in its entirety. • Code is often not directly understandable by developers who did not participate in the development • We need simpler representations for complex systems • Modeling is a mean for dealing with complexity
Concepts and Phenomena • Phenomenon: An object in the world of a domain as you perceive it, for example: • The lecture you are attending • My black watch • Concept: Describes the properties of phenomena that are common, for example: • Lectures on software engineering • Black watches • A concept is a 3-tuple: • Its Name distinguishes it from other concepts. • Its Purpose are the properties that determine if a phenomenon is a member of a concept. • Its Members are the phenomena which are part of the concept.
Name Members A device that measures time. Clock Concepts and Phenomena Purpose • Abstraction: Classification of phenomena into concepts • Modeling: Development of abstractions to answer specific questions about a set of phenomena while ignoring irrelevant details.
Concepts In Software: Type and Instance • Type: • An abstraction in the context of programming languages • Name: int, Purpose: integral number, Members: 0, -1, 1, 2, -2, . . . • Instance: • Member of a specific type • The type of a variable represents all possible instances the variable can take. • The relationship between “type” and “instance” is similar to that of “concept” and “phenomenon.” • Abstract data type: • Special type whose implementation is hidden from the rest of the system.
EnterCalcMode() InputNumber(n) Class • Class: • An abstraction in the context of object-oriented languages • Like an abstract data type, a class encapsulates both state (variables) and behavior (methods) • Unlike abstract data types, classes can be defined in terms of other classes using inheritance Watch time date SetDate(d) CalculatorWatch calculatorState
Application Domain Solution Domain Application Domain Model System Model MapDisplay TrafficControl SummaryDisplay FlightPlanDatabase TrafficController Aircraft Airport TrafficControl FlightPlan Object-Oriented Modeling UML Package
Application and Solution Domain • Application Domain (Requirements Analysis): • The environment in which the system is operating • Solution Domain (System Design, Object Design): • The available technologies to build the system
What is UML? • UML (Unified Modeling Language) • An emerging standard for modeling object-oriented software. • Resulted from the convergence of notations from three leading object-oriented methods: • OMT (James Rumbaugh) • OOSE (Ivar Jacobson) • Booch (Grady Booch) • Reference: “The Unified Modeling Language User Guide”, Addison Wesley, 1999. • Supported by several CASE tools • Rational ROSE • Together/J • ...
UML and This Course • You can model 80% of most problems by using about 20% UML • In this course, we teach you those 20%
UML First Pass • Use case diagrams • Describe the functional behavior of the system as seen by the user. • Class diagrams • Describe the static structure of the system: Objects, Attributes, and Associations. • Sequence diagrams • Describe the dynamic behavior between actors and the system and between objects of the system. • Statechart diagrams • Describe the dynamic behavior of an individual object as a finite state machine. • Activity diagrams • Model the dynamic behavior of a system, in particular the workflow, i.e. a flowchart.
UML First Pass: Use Case Diagrams Package SimpleWatch Actor ReadTime SetTime WatchUser WatchRepairPerson Use case ChangeBattery Use case diagrams represent the functionality of the system from user’s point of view
UML First Pass: Class Diagrams Class Multiplicity Association SimpleWatch 1 1 1 1 1 2 1 2 PushButton state push()release() LCDDisplay Battery load() Time now() blinkIdx blinkSeconds() blinkMinutes() blinkHours() stopBlinking() referesh() Attributes Operations Class diagrams represent the structure of the system
:SimpleWatch :LCDDisplay :Time :WatchUser pressButton1() blinkHours() pressButton1() blinkMinutes() pressButton2() incrementMinutes() refresh() pressButtons1And2() commitNewTime() stopBlinking() UML First Pass: Sequence Diagram Object Message Activation Sequence diagrams represent the behavior as interactions
Increment Hours button2Pressed button1&2Pressed Blink Hours button1Pressed Increment Minutes button2Pressed button1&2Pressed Blink Minutes button1Pressed Increment Seconds button2Pressed Blink Stop Seconds Blinking UML First Pass: Statechart Diagrams State Initial state Event Transition Final state button1&2Pressed
Other UML Notations UML provide other notations that we will be introduced in subsequent lectures, as needed. • Implementation diagrams • Component diagrams • Deployment diagrams • Introduced in lecture on System Design • Object Constraint Language (OCL) • Introduced in lecture on Object Design