Välkommen till Umeå Java User Group, en grupp för alla som är intresserade av java och angränsande ämnen. Vi träffas andra tisdagen 18.00 varje månad.

  1. JUG-mötena handlar om nätverkande framför sälj och rekrytering

  2. JUG präglas av individer framför företag

  3. JUG handlar om kunskapsutbyte framför envägsinlärning

Låter det här intresant anmäl dig till vår meetup eller maila oss.

tisdag 9 oktober 2012

Virtual Pairing

Would you like to be able to pair with your buddy who's miles away? Here's how!

Basic scenario

Hen and Shen would like to do some ping pong TDD, but both have sleeping kids at home and noone to babysit so they have to stay at their own homes.

What you need

IDE, screen share and file share. For example:
IDE Eclipse
Screen share Netviewer, google hangout (hangout has lower res and no fullscreen)
File share Dropbox
Language Java
Test framework JUnit 4
A coding task Minefield. Feel free to use https://github.com/umejug/ExperienceAgile.git as a starting point.

Setting up file share

Hen will share her SharedCode directory to Shen. Shen accepts and then creates a new project in Eclipse
  1. Create Java Project, name it minesweeper
  2. Unclick ”Use default location”, instead choose <path to dropbox>/SharedCode/minesweeper

  3. Make sure both Hen and Shen has the same name of execution environment JRE, if not rename one of them so they are the same!
  4. Click Finish
Dropbox now immediately syncs all files to Shens computer, and Shen now also chooses New Project and points it to the Dropbox minesweeper directory. Eclipse will use the existing files and Hen and Shen is now sharing the same project!

Eclipse settings

To be able to quickly ”talk a code reference”, enable line numbers; Go to Preferences > General > Editors > Text Editors and check Show line numbers.

To make code updates work even better, go to Preferences > General > Workspace > Refresh On Access. The files will automatically get updated in eclipse on a dropbox sync.

Start coding!

After connecting the screen share, Hen first shares screen, and continues to create the test class MinefieldTest.java, while Shen is watching.

Since Hen hadn't added JUnit 4 to the build path, nows the time to do that. She uses a Mac, so hits Cmd-1 on @Test and chooses ”Add Junit 4 library to the build path”.

Acceptance-type high-level test

First off Hen creates a high-level test that defines when they're done:

This test will fail, and Hen continues to add @Ignore, because this is too large a step to take at this time.
Shen now shares screen, and starts typing the first low-level test (possible after hitting F5 if automatic update hasn't been setup). It is now Hens turn to view the shared screen. Hen and Shen now takes turn writing implementation a new test, then new implementation and new test, and so forth until they think they're done.
If they are, the high-level test should succeed!

When the minefield is done...

Completing the minefield should take 20-60 minutes. Since Hen and Shen completed it in 20 they still got time for another task. Switching to the webtest-start branch of https://github.com/umejug/ExperienceAgile.git they got a failing acceptance-style test for bringing the minefield to the web old-school-server-side-wise. Hen types "git checkout webtest-start",  re-imports the maven project into eclipse and they are good to go... 

Inga kommentarer:

Skicka en kommentar