Modern Aspects in Software Engineering 4. Object-Oriented SE Prof. Dr Modern Aspects in Software Engineering 4. Object-Oriented SE Prof. Dr.-Ing. habil. Reiner Dumke Otto-von-Guericke-Universität Magdeburg Fakultät für Informatik, Institut für Verteilte Systeme AG Softwaretechnik http://ivs.cs.uni-magdeburg.de/sw-eng/agruppe/
OOSE - Introduction Functions or functional structures, Interfaces between the system components, Functions or functional structures, Data basis and/or data structures, Problem related objects. Changing
OOSE - Introduction Effectiveness of Programming: Simula 67 Smalltalk Eiffel etc.
OOSE - Introduction Abstract data types opns 0,1: Bit type Bit is Boolean opns 0,1: Bit + : Bit, Bit Bit eq: Bit,Bit Boolean eqns 0 + 1 = 1 + 0 = 1 1 + 1 = 0 + 0 = 0 0 eq 0 = 1 eq 1 = true 1 eq 0 = 0 eq 1 = false endtype
OOSE - Introduction Basic notions: Object: abstraction of the problem area with states (attributes) and behavior (services/methods) Message: a call of a service of an object in the form method(par1, …, parn) Role: the possible behavior of an object in a special context Scenario: a sequence of messages which explain the operationality
OOSE - Introduction Basic notions: Class: a summarizing of objects with semantical equivalency Class hierarchy: inheritance structure (mostly: tree) Class library: an implemented set of classes Polymorphism: the possibility of two or more methods with the same name
OOSE - Introduction Class diagram: Book title author Cover keywords displayContents SEBook TextBook pages
OOSE – Development Methodologies
OOSE – Analysis & Specification Dear Developer, I like to count. I want to have a software system for counting including incrementing and decrementing. I want to count a lot of things in different number systems. Just I have a red plastic counter with an increment button, a decrement button and – I see – a reset button. Best regards Your customer
OOSE – Analysis & Specification Number countValue resetValue reset increment decrement presenting Not counter!
OOSE – Analysis & Specification Analysis pattern: Party Portfolio Post Contract Scenario etc.
OOSE - Design Number countValue resetValue MyCounter reset + - R increment decrement presenting MyCounter + - R display
OOSE - Design
OOSE – Design Pattern
OOSE – Implementation (Java)
OOSE – Implementation (Forte4J)
OOSE – Implementation (Forte4J)
OOSE - Implementation
OOSE - Testing Classical test example: All Ci cases and all numbers: Java-Code: for (int i=0; i < n; i++) { if (a.get(i) == b.get(i)) x[i] = x[i] + 100; else x[i] = x[i]/2; } All Ci cases and all numbers: Billion of years test time
OOSE - Testing Test example 2: Proof if a, b, c builds a triangle
OOSE - Testing Added test cases: missing constructor overwritten methods overloaded attributes incorrect inheritance inheritance cycle missing class variables etc.
Test Pattern Description OOSE – Test Pattern Test Pattern Description Intent Context Fault Model Strategy Entry/Exit Criteria Consequences Known uses
Test Design Pattern - Examples OOSE – Test Pattern Test Design Pattern - Examples Test area Identification Content Class methods Category-Partition Test case for I/O Combinational Function Logical based test sequences Recursive Function Test cases for recursive funktions Polymorphic Message Test cases for a client to a pol. server Classes Invariant Boundaries Identification of test vectors Nonmodal Class Class test cases without constraints Quasi-modal Class Class test cases with constraints Transitive Operation Test cases for transitive methods Class integration … Components … System … Application …
OOSE – Unified Modeling Language
OOSE – Rational Unified Process
OOSE – UML - OCL Object Constraint Language (OCL): Typ1::operation(arg : Typ2) : ReturnTyp pre : arg.attribut1 = true post: result = arg.attribut1 xor arg.attribut2 Customer sex = #female implies calling=‘Senior‘
OOSE – UML - CASE
OOSE – UML - CASE
OOSE – UML - CASE
OOSE – UML - Example Housekeeping Book
Housekeeping Book – Behavior modelling OOSE – UML - Example Housekeeping Book – Behavior modelling
Housekeeping Book – Component design OOSE – UML - Example Housekeeping Book – Component design
OOSE – UML - Example Housekeeping Book – Implementation characteristics: Number of Requirements: 20 verbal description, Test cases: 28 , Diagrams: 1 Use Case diagram, 8 State diagrams, 4 Sequence diagrams, 4 Collaboration diagrams, 3 Class diagrams, 1 Component diagram, Algorithm description: ca. 150 Lines of pseudocode, Classes: 21 implemented Java Classes, Program lines: ca. 4600 Java LOC, Dokumentation: Web-based hypertext description Effort: ca. 3 Person month
Questions, Remarks !!!