hotciv project starting up!. henrik bærbak christensen2 hotciv = agile development iterations of...

20
HotCiv Project Starting up!

Upload: barry-snow

Post on 08-Jan-2018

223 views

Category:

Documents


0 download

DESCRIPTION

Henrik Bærbak Christensen3 Getting Started Read Chapter Download hotciv-tdd-start.zip and unzip it! Read the java file: Game.java Source code –your variant is already initially package’ified hotciv.framework etc. packages split into a production code and test code source tree –your variant is already fully Ant’ified ‘ant test’ and ‘ant test.batch’ runs out-of-the-box Output is in files in folder TEST-RESULT

TRANSCRIPT

Page 1: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

HotCiv Project

Starting up!

Page 2: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Henrik Bærbak Christensen 2

HotCiv = Agile development

  Iterations of– product development– learning increments

Page 3: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Henrik Bærbak Christensen 3

Getting Started

  Read Chapter 36.1 + 36.2  Download hotciv-tdd-start.zip and unzip it!  Read the java file: Game.java

  Source code– your variant is already initially package’ified

• hotciv.framework etc. packages• split into a production code and test code source tree

– your variant is already fully Ant’ified• ‘ant test’ and ‘ant test.batch’ runs out-of-the-box• Output is in files in folder TEST-RESULT

Page 4: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Henrik Bærbak Christensen 4

  [Demo]

Page 5: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Henrik Bærbak Christensen 5

Iteration 1

Implement AlphaCiv using TDD!

Page 6: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

... And report on process (=skills)

  Using screen casts

Henrik Bærbak Christensen 6

Page 7: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Agile Delivery

  I have rewritten exercises for each week into smaller deliverables

  Use it to get feedback faster

  Use the feedback to improve and learn !

Henrik Bærbak Christensen 7

Page 8: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

... The checklist

  Refer to the ”rubrics” to see what I deem important...

Henrik Bærbak Christensen 8

Page 9: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

The Agile backlog...

This is an architecture course! – Clean code that works (75% clean > 100% unclean!)

– You may fill in more behaviour in following iterations...

Henrik Bærbak Christensen 9

Page 10: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

... And hand it in...

  ... Using course admin and/or video services– Vimeo / you tube / use private links

  Some files– Reports in pdf format– Links to video files or upload it– Code in zip with ALL code

• TA should ”unzip; ant coverage;” and it should work...

• If not – the delivery is failed...

Henrik Bærbak Christensen 10

Page 11: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

... In details...

Henrik Bærbak Christensen 11

Page 12: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

… at the code level

  This boils down to implementing relevant methods for the Game interface:

Henrik Bærbak Christensen 12

Page 13: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Structure (static view)

Henrik Bærbak Christensen 13

Page 14: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Dynamics

  Generally, consider that the GUI only mutate the game’s state by using the Game’s mutator methods– endOfTurn, moveUnit, etc.

  And only inspect it using either Game accessor methods or the “read-only” interfaces– getTileAt(p), getCityAt(p), getPlayerInTurn(), …– Unit, Tile, City’s methods…

Henrik Bærbak Christensen 14

Page 15: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Henrik Bærbak Christensen 15

Some Design Decisions

  Keep interfaces intact!– Otherwise the GUI will have trouble interfacing your HotCiv

  Read-only interfaces (Unit, City, …)– You should

• Avoid to add mutator methods to the interfaces! • Add mutator methods to StandardX

– Will require quite a bit of casting

  String base types– Enumerations would give better reliability (compiler check) but

would delimit future variants ability to add more e.g. more unit types.

  Preconditions– Many game methods require e.g. valid positions. This means

you should not make tests for invalid positions!

Page 16: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Some Design Decisions

  No World abstraction?

– My TDD did not need it so far! Simplicity-the art of maximizing the work not done!

– Introduce it if you find your code maintainability improves.

Henrik Bærbak Christensen 16

Page 17: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Doing TDD

  TDD is about being ’lazy’– Do not code in anticipation of need, only when need

arise! Simplicity – maximize work not done!  Morale:

– Make it as simple as possible!!! Code as little as possible!!!

– Translate the specs into minimal set of test cases. Make the test cases drive the minimal amount of code.

– Do not design the swiss army knife– Make the code clean!!!

Henrik Bærbak Christensen 17

Page 18: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Henrik Bærbak Christensen 18

Doing TDD

  Experience from earlier years– Test list is a test list

• ‘setup world’ = feature; not a test• ‘red has city at (1,1)’ = test; not a feature• morale: write test lists, not feature lists

– Thinking implementation is bad…• think “how does my test case look”; not “how do I implement

this”

– Thinking too much ahead• do not foresee problems that never arise• pick “one step tests”• be prepared for ‘do over’

Page 19: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Doing TDD

  You have to constantly refactor– to make your code clean and abstract– students tend to forget => junk pile of special cases

  Fix your broken windows• Or the building will become unattractive...

  The total cost of owning a mess

Henrik Bærbak Christensen 19

Page 20: HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments

Help to ‘score’ your tests...

  Code coverage– How much of your production code is exercised by

your tests?  ‘ant coverage’ (only if tests pass!)

– Jacoco/report/index.html

Henrik Bærbak Christensen 20