Mandatory 1 / AlphaCiv … a few comments…. Overall: Generally – good work – good effort Seems you are generally doing TDD Minor hick-ups –”My own way is.

Slides:



Advertisements
Similar presentations
Test-Driven Development and Refactoring CPSC 315 – Programming Studio.
Advertisements

A seminar on e-business – Was it worthwhile? Zoran Budimac, Zoran Putnik.
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
The Comparison of the Software Cost Estimating Methods
Test-Driven Development and Refactoring Project 3 Lecture 1 CPSC 315 – Programming Studio Fall 2009.
Bridge The decoupling of abstraction and implementation.
EXtreme.NET Dr. Neil Roodyn. eXtreme.NET Who is Dr. Neil? MISSION: To increase the value of your Software Business Working with software for way too long.
DAIMIHenrik Bærbak Christensen1 Mandatory Project Part II Software Reliability and Testing.
Computer Engineering 203 R Smith Agile Development 1/ Agile Methods What are Agile Methods? – Extreme Programming is the best known example – SCRUM.
Chapter 23: ARP, ICMP, DHCP IS333 Spring 2015.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Design Patterns: someone has already.
DESIGNING EFFECTIVE DQS/TESTS Dr. Jey Veerasamy 1.
One XP Experience: Introducing Agile (XP) Software Development into a Culture that is Willing but not Ready Joe Bergin * Fred Grossman * David Leip **
1 Advanced Computer Programming Project Management: Methodologies Copyright © Texas Education Agency, 2013.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Clear Lines Consulting · clear-lines.comSilicon Valley Code Camp 2008 · Nov 8, 2008 · 1 Test-Driven Development An introduction for C# developers.
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
1 김 수 동 Dept. of Computer Science Soongsil University Tel Fax
Refactoring1 Improving the structure of existing code.
The Factory Patterns SE-2811 Dr. Mark L. Hornick 1.
How to Improve the Safety of Signalling Systems with a Shortened Construction Period in Engineering Construction Projects Gao Guoliang Safety Assurance.
1 How to Design Frameworks -- Copyright 2005 by Ralph E. Johnson How to Develop Frameworks Ralph E. Johnson Dept. of Computer Science 1304 W. Springfield.
Documentation. Your documentation must fit the needs of your audience. It’s always better to say one thing that is useful, as opposed to many things that.
Software Engineering CS3003 Lecture 4 Code bad smells and refactoring.
Test-Driven Development Eduard Miric ă. The problem.
FacadeDesign Pattern Provide a unified interface to a set of interfaces in a subsystem. Defines a high level interface that makes the subsystem easier.
The HotCiv GUI Instantiating the MiniDraw Framework.
Refactoring - 1 CS494: Intro. to Refactoring Readings: –Refactoring for everyone: How and why to use Eclipse's automated refactoring features. By David.
Test Stubs... getting the world under control. TDD of State Pattern To implement GammaTown requirements I CS, AUHenrik Bærbak Christensen2.
Henrik Bærbak Christensen1 Test Driven Development “TDD” Summary.
Design Patterns Introduction “Patterns are discovered, not invented” Richard Helm.
HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments.
AU CSHenrik Bærbak Christensen1 dSoftArk E2015 Software Architecture Programming in the Large.
Refactoring1 Improving the structure of existing code.
Lecture Model View Controller s/w architecture AND general tips on structuring classes.
Outsourcing, subcontracting and COTS Tor Stålhane.
Hints - Mandatory 2 / Strategies. Learning... life-a-curve.html B Christensen2 Jeg fatter ikke.
Mandatory 1 / AlphaCiv … Traps to be aware of …. Warn or not? I once asked Kent Beck the following –I have a lot of students in a course in design patterns.
Applying the Principles Two Examples. Example 1 New Requirement It would be nice with a simple GUI “to see something” instead of just xUnit tests...
Refactoring and Integration Testing or Strategy, introduced reliably by TDD The power of automated tests.
AU CSHenrik Bærbak Christensen1 dSoftArk Software Architecture Programming in the Large.
MiniDraw Introducing a Framework... and a few patterns.
Mandatory 2 / Strategies Note: I publish this presentation at the week plan for week 4.
Henrik Bærbak Christensen1 Systematic Testing (Scratching the surface) The art of economic testing...
Software Architecture Quality Attributes. Good or Bad? Measurable criterions required...
Safety methods within Agile and RUP methods TORGRIM LAURITSEN BUCS project.
Deriving Abstract Factory Loosening the coupling when creating objects...
Mandatory 3 Test Stubs State Abstract Factory. Stubs, Spies, and Fake Objects One Example Making distribution testable... Henrik Bærbak Christensen2.
Mandatory 3 Test Stubs State Abstract Factory. Do not panic! dSoftArk is about Good analyzable design not about HotCiv! Henrik Bærbak Christensen2.
Strategy in 15 minutes... derived from the principles.
T Project Review Wellit I1 Iteration
AU CSHenrik Bærbak Christensen1 dSoftArk E2013 Software Architecture Programming in the Large.
AliRoot survey: Calibration P.Hristov 11/06/2013.
Instantiating the MiniDraw Framework
Introducing a Framework ... and a few patterns
Applying the Principles
Behavioral Design Patterns
HotCiv Project Starting up!.
Mandatory 1 / AlphaCiv … Traps to be aware of ….
Why Object-oriented Programming?
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
HFOOAD Chapter 5 Interlude
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Presentation transcript:

Mandatory 1 / AlphaCiv … a few comments…

Overall: Generally – good work – good effort Seems you are generally doing TDD Minor hick-ups –”My own way is far superior, no need to learn TDD” –”I am too slow a programmer, better let super-joe do all the coding”

Doing TDD Evident Tests Exercise: What is focus here? –Test that everything works? Or –Drive production code into existence?

What is TDD??? Traditional tests = Quality Assurance Technique –Success: test cases that show absence of defects TDD tests = Implementation Technique –Success: test cases that drive implementation –Perhaps a few more to show absense of defects

An example Iteration 1: Fake it using anonymous tile class Iteration 2: Intro datastructure, intro StandardTile, fill all with plains Productioncode driver Reliability

Evident tests again Why do you not think all CityImpl are the same? –Just test the production code on one instance! Exercise:Is it OK to use CityImpl here –Answer: Yes indeed. Why?

Production and Test Code Separate test and production code as best possible! Morale: No test code in the production code Seen in GameImpl:

Misunderstood subclassing Class MountainTile implements Tile ? Why is the ratio liabilities/benefits so askewed that it is almost at the point that it is wrong?

When to use subclassing! Only use subclasses if you get a distinct behavioural advantage –Otherwise it is a lot of typing just to define some constant –Similar for units: cost, defense, attack,.... Parameterization is run- time changeable, cheap, easy to overview...

Regarding Units Unit types are behavioural distinct! So: SettlerUnit extends AbstractUnit Impl. Unit ? Polymorphic design and it will work –With some not-so-nice hacks ala How does a settler unit kill itself as part of its action? But the learning goal in dSoftArk is compositional design –Make a UnitImpl, and delegate actions to a Strategy! –See if you can get through... Tricky with Archers though

Keeping the facade Since I wrote the book I have become more strict in my understanding of mutation... Exercise: a)How is a city created? b)What happens when it does? b) How is production set? And how many ways can we set it? And how to ensure consistency?

Design Issues Read-only interfaces for City, Tile, Unit – Why? –Otherwise two ways of changing state in a game Through Game which will enforce consistency Through City which will NOT enforce consistency –If there are two ways Bjarne will use the wrong one! Morale: Only Game has mutator methods! But how to change state? –Only CityImpl has mutators; GameImpl only use CityImpl? –ModifiableCity interface; GameImpl only use that –GameImpl takes on all responsibility?

Sketches Knowing the Implementation type in Game Liabilities –Fails if we must allow external clients to configure our Game with new City implementations  Dependency injection and stuff... ()

Sketches Using an ”modifiable interface” Now the Game can get any class that implements ModifiableCity injected and handle it... ModifiableCity

My opinion It is fully OK for GameImpl to –Operate through CityImpl, UnitImpl, etc. –Do a cast ala (CityImpl) this.getCityAt(p) –Why: Because we are developing the internal production code The GUI guys only use Game interface The Domain guys (= us) use the internals

My opinion ”More beautiful” to use a ‘ModifiableCity’ interface? Simplicity: maximize work not done –We do not need it at the moment –It introduces more complexity –If need arise, easy to refactor CityImpl -> ModifiableCity

Easter Eggs ?

From last year... What does this code do? War stories –Microsoft and easter eggs... –DSE and dead code springing to life...