Instantiating the MiniDraw Framework

Slides:



Advertisements
Similar presentations
R-Mancala Srinivas Krishnan & Kiranjit Sidhu. Outline Design Details Refactoring Experience Demo.
Advertisements

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.
DAIMI(c) Henrik Bærbak Christensen1 JUnit A tool for test case management.
PolymorphismCS-2303, C-Term Polymorphism Hugh C. Lauer Adjunct Professor (Slides include materials from The C Programming Language, 2 nd edition,
MVC and MVP. References enter.html enter.html
Workflow and SharePoint Presented by Ben Geers. Overview What is workflow? Windows Workflow Foundation How does workflow apply to SharePoint? WSS v3 vs.
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Luminance.  Major group refactoring.  Development Lead: Stephen Damm.  Project Manager: Martina Nagy.  Test team member: Chet Collins.  A lot of.
CS 350 – Software Design The Observer Pattern – Chapter 18 Let’s expand the case study to include new features: Sending a welcome letter to new customers.
Team Think For You. Outline  Introduction  Process  Requirements Engineering  Architecture  Detailed Design  Testing  Demo  Extensibility  Conclusions.
User Interface Programming in C#: Direct Manipulation Chris North CS 3724: HCI.
Controls and Events. The Next Step In the first module, we discussed general problem solving In this module, we’ll apply what we learned, from specification.
Henrik Bærbak Christensen1 Frameworks / Product Lines The frame for reuse.
CS 151: Object-Oriented Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
The HotCiv GUI Instantiating the MiniDraw Framework.
Test Stubs... getting the world under control. TDD of State Pattern To implement GammaTown requirements I CS, AUHenrik Bærbak Christensen2.
HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments.
Deriving State…...and an example of combining behaviour.
All the dSoftArk Tools Getting started!. Tools dSoftArk is a semi-realistic, agile, development project –Industrial strength software (programming, TDD,
Multi Dimensional Variance: How to make ultra flexible software!
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.
Patterns are Roles What patterns are and what not…
Software Architecture Quality Attributes. Good or Bad? Measurable criterions required...
CS, AUHenrik Bærbak Christensen1 Compositional Design Principles The “GoF” principles Or Principles of Flexible Design.
Mandatory 3 Test Stubs State Abstract Factory. Stubs, Spies, and Fake Objects One Example Making distribution testable... Henrik Bærbak Christensen2.
Observations Week 4. Observe Code Change! Review week plan! Also, a load generator is added to the exercises on Iteration 3 for ‘smoking out’ the exceptions.
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.
Hints - Mandatory 5 Blackbox Testing Pattern Hunting.
Introducing a Framework ... and a few patterns
Software Architecture ATAM Process Presentation
Integration Testing.
Developer Testing Tricks
FOP: Buttons and Events
Applying the Principles
Goals Give student some idea what this class is about
Exam A few notes and hints….
HotCiv Project Starting up!.
Mandatory 1 / AlphaCiv … Traps to be aware of ….
CS101 Introduction to Computing Lecture 19 Programming Languages
Test-Driven Development
Compositional Design Principles
Chapter 7 Software Testing.
The Object-Oriented Thought Process Chapter 08
CS102 – Bilkent University
Polymorphism Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2nd edition, by Kernighan.
Advanced ProgramMING Practices
Advanced ProgramMING Practices
11. MVC SE2811 Software Component Design
11. MVC SE2811 Software Component Design
Poul Henriksen Computing Laboratory University of Kent
Two-digit by one-digit multiplication
Two-digit by one-digit multiplication
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Presentation transcript:

Instantiating the MiniDraw Framework The HotCiv GUI Instantiating the MiniDraw Framework

Henrik Bærbak Christensen [Demo] Ant update CS @ AU Henrik Bærbak Christensen

The Framework iteration Learning Objectives: Frameworks: Configure/specialize MiniDraw to support HotCiv GUI See MiniDraw as example of a framework See a lot of patterns in action TDD and Stubs You willdevelop the GUI the TDD way Keep focus & take small steps No automated testing though... You willdevelop the GUI based only on stubs Integration testing Last piece of the puzzle: Integrate into GUI SemiCiv CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen The Exercise Sequence Basically TDD iterations 36.37: Observer on Game 36.38: Create a new Drawing that responds to Game state changes using the observer Game → GUI integration [partially solved in CivDrawing!] 36.39: Create a Tool to move units GUI → Game integration 36.40 – 36.44: Create tools to do all the other stuff End of turn, change production, execute unit action, ... i.e. Add features in fast focused iterations... CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen 2014 Additions Now all boilerplate execution code is part of the provided zip CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Example Test ‘EndOfTurnTool’ CS @ AU Henrik Bærbak Christensen

Make the Tools Context Sensitive Limit the tool’s applicability to the rectangles that actually define what is being clicked GfxConstants.java CS @ AU Henrik Bærbak Christensen

Patterns for Integration

Henrik Bærbak Christensen The design Proper design pattern protocols Facade pattern [GUI inform Domain] Observer pattern [Domain inform GUI] only rely on interfaces I can develop the GUI using Stub implementations of the Domain’s Facade and Observer roles Facade = Interface Game Observer = Interface GameListener reuse MiniDraw’s graphical abilities let someone else do the dirty job... CS @ AU Henrik Bærbak Christensen

GUI Three layers MiniDraw hotciv.view: HotSpots for figures, tools, drawing and Drawingview etc CivDrawing Your production code CS @ AU Henrik Bærbak Christensen

Exercise: Compositional? How does this look, using a compositional approach? CivDrawing CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Present code… CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Central Protocol The protocol between GUI and Domain: GUI  Domain Facade pattern (Game interface) MVC + Adapter: A tool translates mouse clicks to proper method UnitMoveTool: drag translates into ‘moveUnit’ EndOfTurnTool: click translates into ‘endOfTurn’… GUI  Domain Observer pattern (GameObserver interface) Drawing must react upon events from domain worldChangedAt() CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Example: Moving Units Moving units means invoking game’s “moveUnit” The special dSoftArk provided code implements this Civ worldChangedAt boardIterator CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Example: Moving Units Facade Observer worldChangedAt GUI  Domain  GUI CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Code View Brute-force Brute redrawing  CS @ AU Henrik Bærbak Christensen

Testing without production code? The GUI can be completely developed without any real domain production code no Alpha, ..., Delta, nor SemiCiv Why? Because I program to an interface! Game g = new MyParticularStubForThisIteration(); g.moveUnit( ... ); g.endOfTurn(); CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Example: 36.38 Goal: Implement CivDrawing Responsibility: update graphics upon game state changes A testing tool to trigger game state changes CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Demo: ant update CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Test Stubs Game implementation? Complete façade, has not sub-objects Units: only three moveUnit: only moves red archer… Conclusion: simple code But Sufficient for our sprint goal: to develop the CivDrawing that responds to unit moves, etc. CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Test Stubs Requirement: Enough to test all GUI related behaviour Example Must be able to GUI’s behaviour for illegal moves – therefore some moves must be invalid! CS @ AU Henrik Bærbak Christensen

Henrik Bærbak Christensen What about TDD Can I develop the GUI by TDD? Yes: Define a test first, like “MapView”: OneStepTest: draw the world… “TestModelUpdate”: see game state changes reflected ... and then implement the proper MiniDraw role implementations that makes this happen! No: I cannot make it automated as I have to visually inspect the result to verify behaviour but manual tests are better than no tests!!! especially when I refactored the damn thing to use MiniDraw instead of JHotDraw !!! CS @ AU Henrik Bærbak Christensen