ObjectOriented Software Development Introduction to software engineering Course
Object-Oriented Software Development Introduction to software engineering
Course outline • Focus on practical software engineering techniques and tools for component-based object-oriented system. The objective of this course is to learn how to design and construct OO systems • Main topics identified by the IEEE software engineering body of knowledge: – Software engineering process: Extreme programming – Software design: object oriented design with UML – Software construction: OO coding practice, design patterns, refactoring, concurrency, aspect-oriented programming – Software testing: integrated test with JUnit – Software engineering tools and methods: formal specification techniques, design by contract, and tools
Applied software engineering • This course is about – – – – Testing Debugging Profiling Coding standards Documentation Tools Java • This course is not about – Process and project management – Requirement analysis – Software metrics
Goal of this course • Object-oriented software engineering – How to design systems of objects – How to explore inheritance and subsumption to make system generic and flexible – How and when to refactor systems to simplify their designs • Software quality – How to test and validate software – Good coding practice – How to document a design
Traditional software engineering • 1967 NATO study group coined the term software engineering • 1968 NATO declare software crisis: quality of software is abysmal and deadline and cost limits not met • The cost of software development – Small fraction devoted to coding – More than half of the cost is for maintenance
Software process 1. Requirement phase – Requirement phase testing 2. Specification phase – Specification phase testing 3. Design phase – Design phase testing 4. Implementation phase – Implementation phase testing 5. Integration phase – Integration phase testing 6. Maintenance phase – Maintenance phase testing 7. Retirement phase
Software life cycle models • waterfall and spiral models
What is software quality? • Correctness is the ability of software products to perform their exact tasks as described by their specifications • Robustness is the ability of software system to react appropriately to abnormal conditions • Extensibility is the ease of adapting software products to changes of specifications • Reusability is the ability of software elements to serve for the construction of many different applications • Compatibility is the ease of combining software elements with others • Efficiency is the ability of a software system to place as few demands as possible to the hardware and software environments • Ease of use is the ability of people with various backgrounds and qualifications can learn to use software products Bertrand Meyer, Object-Oriented Software Construction
How to achieve software quality • By design – Pre and post conditions, class invariants – Disciplined exceptions – Design patterns, refactoring • By test – Unit tests, system tests – Repeatable regression tests – Do it, do it right, do it fast • Aim for simplicity and clarity, not performance • Fine-tune performance only when there is a demonstrated need
Why object-oriented programming • Modeling – Complex systems can be naturally decomposed into software objects • Data abstraction – Clients are protected from variations in implementation • Polymorphism – Clients can uniformly manipulate plug-compatible objects • Component reuse – Client/supplier contract can be made explicit, simplifying reuse • Evolution – Classes and inheritance limit the impact of change
Object-oriented design • OOD factors a system into objects with well-defined responsibilities – Objects are responsible for maintaining information and providing services • Operations are always associated to responsible objects • Always delegate to another object when you cannot do it yourself – A good design exhibits • High cohesion of data and operations within classes • Low coupling between classes and subsystems – Iterative development and extreme programming • Refactor the design as it evolves and test each time you compile
UML • Unified modeling language is a standard set of techniques for describing object-oriented designs – Class models – Use case models – Interaction diagrams – State and activity diagrams –…
UML • Drawing editor class diagram Drawing. Editor Shape 0. . * bounding. Box() create. Manipulator() Line Text. Shape bounding. Box() create. Manipulator() +text Text. View 1 get. Extent()
UML • Interaction diagram editor: Drawing. Editor tx. Shape: Text. Shape bounding. Box() text: Text. View get. Extent()
Refactoring • Refactor your design whenever your code starts to smell – Methods that are too long or too hard to read • Decompose and delegate responsibility – Duplicated code • Factor out common parts – Violation of encapsulation – Too much communication between objects – Big case statements • Introduce subclass responsibilities – Hard to adapt to different context • Separate mechanism from policy
XP • e. Xtreme Programming – Kent Beck – A light weight methodology for small or medium sized teams developing software in the face of vague and fast changing requirements • Tenets of XP: – If code reviews are good, then let’s review all the time (pair programming) – If testing is good, then everybody will test all the time (unit & functional testing) – If design is good, make it part of the daily routine (refactoring) – If simplicity is good, always choose the simplest design – If integration test is important, integrate & test several times a day – If short iterations are good, make the iteration really short – minutes and hours, instead of weeks and months
Why Java? • • • C++ -- complexity Clean integration of features A language academics do not have to be shamed of Large standard libraries Simple object model – – – Almost everything is an object No pointers Garbage collection Single inheritance Multiple subtyping Static and dynamic type checking
References • Gamma, Helm, Johnson, Vlissides, Design Pattern – Elements of Reusable Object-Oriented Software, 1995 • Lea, Concurrent programming in Java (2 nd Ed. ), 1999 • Gosling, Joy, Steele, The Java Language Specification, 1997 • Yellin, The Java Virtual Machine Specification, 2 nd Ed. 1999 • Beck, e. Xtreme Programming explained – embrace change, 1999 • Fowler, Refactoring: Improving the Design of Existing Code, 1999 • Pooley, Steven, Using UML – Software Engineering using Objects and Components, 1999 • Kernighan, Pike, The Practice of Programming, 1999 • Brooks, The Mythical Man-Month, 1982
- Slides: 18