1 Software Maintenance and Evolution CSSE 575: Session 6, Part 1 The “SEAM” Model Steve Chenoweth Office Phone: (812) 877-8974 Cell: (937) 657-3885 Email:

Slides:



Advertisements
Similar presentations
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Advertisements

Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
SOLID Object Oriented Design Craig Berntson
1 Software Architecture CSSE 477: Week 5, Day 1 Statistical Modeling to Achieve Maintainability Steve Chenoweth Office Phone: (812) Cell: (937)
Inheritance and object compatibility Object type compatibility An instance of a subclass can be used instead of an instance of the superclass, but not.
1 Software Maintenance and Evolution CSSE 575: Session 4, Part 1 Software Maintenance – Big Issues served up, Side order of Reifer Steve Chenoweth Office.
1 Software Maintenance and Evolution CSSE 575: Session 6, Part 4 Breaking Dependencies Steve Chenoweth Office Phone: (812) Cell: (937)
1 Software Maintenance and Evolution CSSE 575: Session 1, Part 1 Course Introduction Steve Chenoweth Office Phone: (812) Cell: (937)
1 Software Maintenance and Evolution CSSE 575: Session 8, Part 3 Predicting Bugs Steve Chenoweth Office Phone: (812) Cell: (937)
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Chapter 25 GRASP: More Objects with Responsibilities 1CS6359 Fall 2011 John Cole.
Liskov Substitution Principle
3/15/05H-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Evaluating Class Diagrams Topics include: Cohesion, Coupling Law of Demeter (handout)
Brainstorming Steve Chenoweth & Chandan Rupakheti RHIT Chapters 12 & 13, Requirements Text, Brainstorming Techniques document Brainstorming involves generating.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
CSc 335: Three More OO Design Principles
Software Architecture for DSD The “Uses” Relation.
1 Software Maintenance and Evolution CSSE 575: Session 8, Part 2 Analyzing Software Repositories Steve Chenoweth Office Phone: (812) Cell: (937)
CLASS DESIGN PRINCIPLES Lecture 2. The quality of the architecture What is a good design? It is the design that at least does not have signs of “bad”.
1 Software Maintenance and Evolution CSSE 575: Session 6, Part 2 Problems with Changing Software - 1 Steve Chenoweth Office Phone: (812) Cell:
Choose between Access and Excel Right questions, right program If you’re having trouble choosing between Access and Excel, take a moment to answer an important.
1 OO Design Novosoft, 2001 by V. Mukhortov. 2 OO Design Goals  Flexibility Changes must be localized  Maintainability Modules requiring changes can.
1 Software Construction and Evolution - CSSE 375 Exception Handling – Logging & Special Situations Steve Chenoweth Office: Moench Room F220 Phone: (812)
Company Confidential – Do Not Duplicate 2 Copyright 2008 McLane Advanced Technologies, LLC S.O.L.I.D. Software Development Achieving Object Oriented Principles,
Software Engineering. Administrivia This is me: Cyndi Rader You can reach me: Or find me here: BB 280D Class notes here:
OODP Prudent OO Design. OODP-2 The Pillars of the Paradigm Abstraction Encapsulation Hierarchy –Association, Aggregation –Inheritance Polymorphism.
Tech Talk Go4 Factory Patterns Presented By: Matt Wilson.
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
Albert Einstein Two things are infinite: the universe & human stupidity; and I'm not sure about the universe.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION MIDTERM REVIEW Autumn 2011.
© 2004 Capgemini - All rights reserved SOLID - OO DESIGN PRINCIPLES Andreas Enbohm, Capgemini.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
1 Software Construction and Evolution - CSSE 375 Exception Handling - Principles Steve Chenoweth, RHIT Above – Exception handling on the ENIAC. From
CSE 301 Exam Revision Lecture
Introduction to SOLID Principles. Background Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution.
CSSE 374: More GRASP’ing for Object Responsibilities
S.O.L.I.D. Software Development 12 January 2010 (Martin Verboon, Patrick Kalkman, Stan Verdiesen)
CSC 313 – Advanced Programming Topics. Open-Closed Principle Classes should be open for extension, but closed to modification  So, what does this mean?
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
1 Software Maintenance and Evolution CSSE 575: Session 6, Part 3 Problems with Changing Software - 2 Steve Chenoweth Office Phone: (812) Cell:
Using Mock Objects with Test Driven Development Justin Kohlhepp
1 Single Responsibility Principle Open Closed Principle Liskov Substitution Principle Law of Demeter CSC 335: Object-Oriented Programming and Design.
Object Oriented Software Development
1 Legacy Code From Feathers, Ch 2 Steve Chenoweth, RHIT Right – Your basic Legacy, from Subaru, starting at $ 20,295, 24 city, 32 highway.
OO Design Principles Copyright © Vyacheslav Mukhortov, Nikita Nyanchuk-Tatarskiy, Copyright © INTEKS LLC,
1 Software Construction and Evolution - CSSE 375 Exception Handling – Chaining & Threading Steve Chenoweth Office: Moench Room F220 Phone: (812)
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
1 Software Maintenance and Evolution CSSE 575: Session 2, Part 1 Refactoring Principles Steve Chenoweth Office Phone: (812) Cell: (937)
Five design principles
1 Software Maintenance and Evolution CSSE 575: Session 3, Part 3 Dealing with Generalization Steve Chenoweth Office Phone: (812) Cell: (937)
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
Principles of Object Oriented Design
Component Design Elaborating the Design Model. Component Design Translation of the architectural design into a detailed (class-based or module- based)
SOLID Design Principles
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Session 33 More on SOLID Steve Chenoweth Office: Moench Room F220 Phone: (812) Chandan Rupakheti Office: Moench.
F-1 © 2007 T. Horton CS 4240 Principles of SW Design More design principles LSP, OCP, DIP, … And another pattern Decorator.
3/1/01H-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Evaluating Class Diagrams Topics include: Cohesion, Coupling Law of Demeter (handout)
Microsoft Advertising 16:9 Template Light Use the slides below to start the design of your presentation. Additional slides layouts (title slides, tile.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
Mantas Radzevičius ifm-2/2
Course information Old exam Resit Report Result and walkthrough
Steve Chenoweth Office Phone: (812) Cell: (937)
Copyright © by Curt Hill
lecture 08, OO Design Principle
11/29/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
A (partial) blueprint for dealing with change
Principles of Object-Oriented Design
Some principles for object oriented design
Liskov Substitution Principle (LSP)
Presentation transcript:

1 Software Maintenance and Evolution CSSE 575: Session 6, Part 1 The “SEAM” Model Steve Chenoweth Office Phone: (812) Cell: (937) hulman.eduz Below – The new book we’ll be using for the next lectures. Above – Feathers.

2 The Seam Model A basic skill in software maintenance – figuring out effective ways to test it. – Unit and integration testing There are several ways in which a method, say, tends to resist testing. The Seam Model gives a systematic way around those problems. Above – Seams in action – From Steven Ellis’s site on how to throw a fastball. n_ellis_the_complete/2007/06/ho w_to_throw_a_.html. n_ellis_the_complete/2007/06/ho w_to_throw_a_.html

3 A huge sheet of text When you start looking at code you aren’t already familiar with, this is what it is! The goal is to find interesting places to study in depth – Analyze for possible problems – Try making changes But if the code can’t be unit tested easily, how can you actually run it and see what it does? Above – source code that played a role in a Minnesota court case over the legitimacy of breath test results. What does it do? es/source-code/court-of-appeals-rips-the-lid-off- dwi-intoxilyzer-source-code-issue/ es/source-code/court-of-appeals-rips-the-lid-off- dwi-intoxilyzer-source-code-issue/

4 A “Seam” Example Feathers shows a method in C++, which could be run in a unit test, except for the line – PostReceiveError(SOCKETCALLBACK, SSL_FAILURE); which calls a tricky-to-include-in-testing external function. What are the options here – without changing any of the lines in this method itself?

5 The rest of the method would be much easier to set up NUnit style unit tests for, except this one line!

6

7 “Seam” Options, in summary Postprocessing: We can change, for testing, what external code gets linked here. Preprocessing: This happens to be C++ code, and so you could do some “#” macro that changes what happens in the call. Object substitution: We can make objects for testing, like a subclass that overrides what gets called here.

8 “Seam” Goal 1 – Unit Testing Find a way to alter the behavior of some code, without changing the code itself. For testing - Usually applied to code that causes trouble if run as intended, like for unit testing. Examples: – Communications calls – Database calls – GUI calls This gives you “test” versions of your software, which are easier to run without messing with these external entities.

9 “Seam” Goal 2 – Enhancements Find a way to enhance the behavior of some code, without changing the code itself. For adding features - Usually applied to code that you want to “do more” without altering this class or method. This gives you easy ways to make enhancements, without adding bugs into the existing code.

10 These are key strategies! If you can find ways to do these things systematically with your code, it means: – More timely testing – Easier ways to guess difficulty in changing and enhancing the code – Understanding what’s easy and hard, in terms of choices for how to change it

11 The SEAM model extends… OCP - The “Open-closed principle” of OO: – Software entities (classes, modules, functions, etc.) should be Open for extension, but Closed for modification. – Question Feathers asks - Can we apply this principle to extending these entities for testing? – Put another way – If we have to alter the code substantially to do anything like a unit test, we’re on a slow boat to China! – Goal – “Change the code without changing the code!

12 DIP The “Dependency Inversion Principle” of OO: – Depend upon abstractions. Do not depend upon concretions. – We should couple at the abstract level, not at the concrete level. E.g., try not to refer to concrete classes directly In this case, is there a way that the test versions and the production versions of the code can be based on an abstract version of both? – We’ll discuss DIP some more in the next slide set. And the SEAM model uses… Above – Yes, “concretion” is a word! Here’s one now.

13 And has a lot to do with… LSP – The “Liskov substitution principle”: – Let q(x) be a property provable about objects x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T. – I.e., subtypes don’t alter any of the desirable properties of their parents!