Presentation is loading. Please wait.

Presentation is loading. Please wait.

©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Software system modeling l System models – Abstract descriptions of systems whose requirements.

Similar presentations


Presentation on theme: "©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Software system modeling l System models – Abstract descriptions of systems whose requirements."— Presentation transcript:

1 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Software system modeling l System models – Abstract descriptions of systems whose requirements are being analysed l Formal methods – Techniques and notations for the unambiguous specification of software l Objectives To explain why the context of a system should be modelled as part of the requirements engineering process To describe behavioural modelling, data modelling and object modelling To introduce some of the notations used in the Unified Modeling Language (UML) To introduce formal methods and formal modeling approaches

2 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 2 The Unified Modeling Language l Devised by the developers of object-oriented analysis and design methods l Has become an effective standard for software modelling l Has nine different notations Use Case Diagrams Use Case Diagrams Use Case Diagrams Scenario Diagrams Scenario Diagrams Collaboration Diagrams State Diagrams State Diagrams Component Diagrams Component Diagrams Component Diagrams Deployment Diagrams State Diagrams State Diagrams Object Diagrams Scenario Diagrams Scenario Diagrams Statechart Diagrams Use Case Diagrams Use Case Diagrams Sequence Diagrams State Diagrams State Diagrams Class Diagrams Activity Diagrams Models

3 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 3 Software modeling and models l Software modeling helps the engineer to understand the functionality of the system l Models are used for communication among stakeholders l Different models present the system from different perspectives External perspective showing the system’s context or environment Process models showing the system development process as well as activities supported by the system Behavioural perspective showing the behaviour of the system Structural perspective showing the system or data architecture

4 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 4 Context model

5 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 5 Process (activity) model

6 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 6 Behavioral models – Data Processing CASE toolset data flow diagram (DFD)

7 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 7 Semantic data (a.k.a. ER) models

8 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 8 Data dictionary models

9 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 9 Object models l Object models describe the system in terms of object classes l An object class is an abstraction over a set of objects with common attributes and the services (operations) provided by each object l Various object models may be produced Inheritance models Aggregation models Interaction models

10 Library class hierarchy

11 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 11 Object aggregation

12 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 12 Object interaction

13 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 13 Objectives of formal methods l To be unambiguous, consistent, complete, and provable l Requirements specification clarify customer’s requirements reveal ambiguity, inconsistency, incompleteness l System/Software design structural specifications of component relations behavioral specification of components demonstrating that next level of abstraction satisfies higher level l Verification “are we building the system right?” proving that a realization satisfies its specification l Validation “are we building the right system?” testing and debugging l Documentation communication among stakeholders

14 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 14 Why use formal methods? l Formal methods have the potential to improve both quality and productivity in software development to enhance early error detection to develop safe, reliable, secure software-intensive systems to facilitate verifiability of implementation to enable simulation, animation, proof, execution, transformation l Formal methods are on the verge of becoming best practice and/or required practice for developing safety- critical and mission-critical software systems l To avoid legal liability repercussions l To ensure that systems meet regulations and standards

15 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 15 Why not? l Emerging technology with unclear payoff l Lack of experience and evidence of success l Lack of automated support l Existing tools are user unfriendly l Ignorance of advances l High learning curve l Perfection and mathematical sophistication required l Techniques not widely applicable l Techniques not scalable

16 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 16 Myths of formal methods l Formal methods can guarantee that software is perfect how do you make sure the spec you build is perfect? l Formal methods are all about program proving they are about modeling, communicating, demonstrating l Formal methods are only useful for safety-critical systems may be useful in any system (e.g., highly reusable modules) l Formal methods require highly trained mathematicians many methods involve no more than set theory and logic l Formal methods increase the cost of development the opposite is often the case l Formal methods are unacceptable to users users will find them very helpful if properly presented l Formal methods are not used on real, large-scale software they are used daily in many branches of industry

17 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 17 Formal specification language types l Axiomatic specifications defines operations by logical assertions l State transition specifications defines operations in terms of states and transitions l Abstract model specifications defines operations in terms of a well-defined math model l Algebraic specifications defines operations by collections of equivalence relations l Temporal logic specifications defines operations in terms of order of execution and timing l Concurrent specifications defines operations in terms of simultaneously occuring events

18 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 18 Example problem – Clock l Initially, the time is midnight, the bell is off, and the alarm is disabled l Whenever the current time is the same as the alarm time and the alarm is enabled, the bell starts ringing this is the only condition under which the bell begins to ring l The alarm time can be set at any time l Only when the alarm is enabled can it be disabled l If the alarm is disabled while the bell is ringing, the bell stops ringing l Resetting the clock and enabling or disabling the alarm are considered to be done instantaneously

19 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 19 Axiomatic specification – VDM l INIT() ext wr time:N, bell:{quiet, ringing}, alarm:{disabled, enabled} pre true post (time’ = midnight) /\ (bell’ = quiet) /\ (alarm’ = disabled) l TICK() ext wr time:N, bell:{quiet, ringing} rd alarm_time:N, alarm:{disabled, enabled} pre true post (time’ = succ(time)) /\ (if (alarm_time’ = time’) /\ (alarm’ = enabled) then (bell’ = ringing) else (bell’ = bell))

20 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 20 Abstract model specifications – Z

21 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 21 Algebraic specifications – Obj l Functionality init:  CLOCK tick, enable, disable: CLOCK  CLOCK setalarm: CLOCK x TIME  CLOCK time, alarm_time: CLOCK  TIME bell: CLOCK  {ringing, quiet} alarm: CLOCK  {on, off} l Relations time(init)  midnight time(tick(C))  time(C) + 1 time(setalarm(C,T))  time(C) alarm_time(init)  midnight alarm_time(tick(C))  alarm_time(C) alarm_time(setalarm(C,T))  T

22 ©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 22 State Machine specifications l In-class exercise…


Download ppt "©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Software system modeling l System models – Abstract descriptions of systems whose requirements."

Similar presentations


Ads by Google