You are browsing the archive for articles.

The Birth of Duchess Indonesia

30 November 2011 in articles by Agnes Crepet

jduchess-id
On the first of November, some Indonesian girls launched Duchess Indonesia! I was lucky because I was here! For me it was a wonderful experience. I met some girls with awesome motivation and enthousiasm!
All started when I got in touch with Frans Thamura (from Indonesian JUG and Meruvian). As I was doing a world trip I contacted Frans to propose him a talk about Design Patterns. Frans invited me and my co geek-trotter, Cyril, to do this talk in Jakarta, and as he knew that I was involved in Duchess Network, he told me that in his school Meruvian, a lot of women are involved.

meruvian Meruvian Foundation is a non-profit organization located in Jakarta, focused on Java and OpenSource. This Scool was founded by Frans Thamura, teaching computer science and Java to young people between 16 and 21 years old. “Meruvian is dedicated to develop people skill to filling the skillset of people to get a global standard and bring influence to their ecosystem. We facilitate the efforts of private sector entities to support the development of national education through their CSR (Corporate Social Responsibility) programs by managing their CSR funds. We also provide Human Resource Development to close the gap between industries and educations, which stronger in this millenium.”

So, I started to exchange with some ladies, Mila Yuliani, Netoya (Nety) Ozora and Senja Ananda, all from Meruvian. They explained to me that they were very motivated to launch a Duchess Indonesian group. And they managed everything with a strong efficiency, they opened two websites : a facebook account and Duchess Indonesia website. And they organized by themselves a very great event for the launching Duchess Indonesia in Gunadarma University.

jduchess launching jduchess launching 2
For the lauchning, Cyril and me were welcomed by the president of the University, a charming woman! And we met all the staff of the University (specially Adang Suhendra, I Made Wiryana and Hanum Putri) and Meruvian people of course! We started the morning together with Cyril (in front of 180 people) doing a talk about our experience about being a Java developer in Europe. Then, Frans, Mila and Senja did some interested talks about Meruvian and their brillant experience and Meruvian expertise. Another person, Faisal Yusman, spoke about his Java experience.
conf_jakartapre_conf
At the end, it was the Duchess Indonesia launching with a nice video-clip! Mila explained the aim of Duchess Indonesia : connecting Indonesian women in Java Technology. Their mission is to promote women in this sector and to provide a platform through which women can connect with each other and get involved in the greater Java community. They want to organize workshops and social events, participate in existing Java User Group and connect with each other online and offline at Java Conferences around the world. Mila said that they welcome all women who are interested in Java technology, including developers, architects, testers, business analysts, managers and others. “We believe that women have an essential role to play in the future of IT as it evolves in the global economy. Join us and help make Duchess into something great !!”. After the launching, in the afternoon, Cyril and I did our workshop about Design Patterns and we did the same talk the next day in front of other students in computing. We were surprised about one thing : there is a lot of women students in Indonesia (more than 50%). In Europe with the sad example of Devoxx where only 5% of attendees are women (read this interesting feedback by Claude Falguière, a Duchess France leader, about Devoxx and women), we should follow the example of Indonesia!

I hope all the best for Duchess Indonesia. And congratulations for Mila, Nety and Senja!

The Birth of Duchess Africa

18 September 2011 in articles by Agnes Crepet

logo_duchess_africa_classique by jDuchess Last august, Stella and Edwidge, two new African Duchesses, created a new group of Duchess : Duchess Africa. Their goal is to enable African women’s access to careers in computer science in general, and why not in Java development. In Africa, few girls go to school, let alone access to scientific studies, so there are very few female computer engineers. Stella Avit Barbour and Edwidge Louise Dogny are beginners in Java. It all started this summer when Agnes Crépet, a Duchess France, has decided to be a Java trainer for few weeks as volunteer in Lomé (Togo). Stella and Edwidge were among the students. Agnes spoke about the network of Duchess. Edwidge and Stella have been thinking that it would be very interesting to create a group of Duchess in Africa and particularly in West Africa. The training were held in Togo, but Stella and Edwidge are Ivorian and live in Abidjan.

logo_duchess_africa by jDuchess So on last August 13th, at the session of Togo JUG at the Lomé Catholic University, Stella and Edwidge (see photos) launched the group Duchess Africa. Agnes was speaker of this session of Togo JUG, with Cyril Lacôte. They proposed two talks: one on Design Patterns and another on agility. Between the two talks, Stella and Edwidge have presented their motivations about this group. Unfortunately only few girls attended that day. But Stella and Edwidge are in contact with some motivated girls, even if they are not Java experts! You should know that there are not so many software developers in West Africa. As Horacio,  TogoJUG leader, explained this very well to Agnes and Cyril, during the recording of the last Cast-IT podcast (in French!): computer engineers are more likely to work on maintenance of the system or operation than software development. Decision-makers in IT management services still prefer to buy third-party software than to develop their own solutions! This explains why there are so few developers in West Africa (in Java or any other languages​​), even if mobility is tremendously growing (perhaps things can change)! This does not undermine the motivation of Africans! They are willing to travel many kilometers to attend conferences. They were more than fifty ones in this session of Togo JUG, on a Saturday morning! And hundreds of them journeyed for several days to attend JCertif, the biggest Java Community Conference in Central Africa in Brazzaville, Congo!

 
Edwidge Edwidge and Stella
 

Edwidge Agnes and Stella

The slides of Duchess Africa launch:

My Experience on the OSCON Programming Committee

29 August 2011 in articles by Regina ten Bruggencate

I was asked to be a member of the programming committee of OSCON Java. Even though I had never done it before that was not a problem. Being a member means that you read all the proposals people sent in for the conference. To facilitate this the conference had a site where all the proposals could be graded. The only rule was that OSCON is a developers conference so no commercial sales pitches. As is usual some people will sent in multiple proposals so I tended to select all the papers of one speaker and grade them. The comment most of the time in this case was great speaker but please 2 talks max per speaker so others get a change as well. There were so many great talks it was hard to choose. One of my criteria was do I know the speaker and would I go to this talk myself. I have to say some talks were easy to grade as it was clear it was either to clearly a sales pitch, do not put head of marketing in your job title. Or the abstract was to vague or general.
After the deadline for grading all the talks with the top 2 scores, out of 5, got put up for a second review. Also talks that had a big difference between the different grades got a second grading. From all these talks the program chairs together with the people of O’Reilly put together a great conference.

You can also join in and make your local conference even better by asking them if you can help. Most conferences can use all the help they can get and this way you can have a say in the content of the conference. They need people of all experience levels as the people coming to the conference also have different knowledge levels. And of course sent in your own proposals for sessions. And start small with a BOF or lightning talk. Most conferences now a days have special short sessions of 10 to 15 minutes for short talks. Or offer to organize a session for Duchess to practice your talk.

Good events according to the Devnology crowd

10 July 2011 in articles by Linda van der Pal

Following the discussion about good books was an inventory of good software development events and conferences to visit.

  • GotoCon (Aarhus, Denmark – October 9-14)
  • Øredev (Malmö, Sweden – November 7-11)
  • Devoxx (Antwerp, Belgium – November 14-18)
  • XPdays (Mechelen, Belgium – December 1-2)
  • Spa conference (London, UK – June)
  • TSSJS (Prague, Czech Republic – fall | Las Vegas, USA – spring)
  • Agile Open (Several locations across Europe)
  • Lean & Kanban (Antwerp, Belgium – October 3-4)
  • FOSDEM (Brussels, Belgium – February)
  • ALE (Berlin, Germany – September 7-9)
  • Pier CMS Sprint (coding session for a Smalltalk CMS, sadly I couldn’t find anymore details)
  • LAC (Nieuwegein, the Netherlands – Nobember 23-24)

And some additions that were scribbled on the flipover after the session was over:

  • ESUG (Edinburgh, Schotland – August 22-26)
  • Fronteers (Amsterdam, the Netherlands – October 6-7)
  • JSConf (Berlin, Germany – October 1-2)

Books you should read according to the Devnology crowd

in articles by Linda van der Pal

At the Devnology Open Space yesterday we had a discussion about which books you should have read. As we only had about half an hour, this list is by no means exhausting. They’re just the first books that popped into our heads when asked the question what the best book was.  So who knows, we might create a second list next year.

Three tips that came up, which weren’t specific books, but too good not to mention were Shelfari.com (a social network for readers) and the Manning Early Access Program (where you can online buy books before they are officially published), and Reddit.com (a source for what’s new and popular online).

  • Fearless Change – Linda Rising & Mary Lynn Manns
  • Lean Architecture – James Coplien
  • What technology wants – Kevin Kelly
  • Don’t make me think – Steve Krug
  • De kracht van Scrum – Rini van Solingen & Eelco Rustenburg
  • Beautiful Evidence – Edward Tufte
  • The 7 Habits of Highly Effective People – Stephen R. Covey
  • Refactoring – Martin Fowler
  • The design of design – Frederick Brooks
  • The mythical man-month – Frederick Brooks
  • The Passionate Programmer – Chad Fowler
  • Java concurrency in practice – Brian Goetz
  • Coders at work – Peter Seibel
  • Code complete – Steve McConnell
  • Clean code – Robert C. Martin
  • The clean coder – Robert C. Martin
  • Zen and the art of motorcycle maintenance – Robert M. Pirsig
  • The 4-hour work week – Timothy Ferriss

The Duchess at Devoxx

20 November 2010 in articles by Yolande Poirier

This blog entry is on Oracle Technology Network @ http://blogs.oracle.com/java/2010/11/the_duchess_at_devoxx.html

The Duchess, a “Women in Java” organization, had a great one-hour Bird of a Feather (BoF) yesterday. In addition to having a great logo, the organization provides a platform for women to connect, learn about technology and build regional chapters. The session started with an overview of the Duchess organization and the Duchess France. The French chapter, a dynamic group, recounted over its impressive list of activities: creation of women events around JUG monthly meetings, the co-organization of conferences, organization of Java certification classes and the creation of new groups in France. All this in just the last 9 months since their creation!

Participants were mostly women, with one-third men. Both men and women expressed their options freely. Some of the topics were: the prejudices of women in IT at the workplace, in some countries women have trouble to join the workforce after a long maternity leave, women lack assertiveness to promote themselves and the change of dynamics in diverse teams.

Duchess at JavaOne Day one

20 September 2010 in articles by Regina ten Bruggencate

The first day at javaone has just finished. It started with the community sunday. We talked with other JUG leaders about topics like how to get more members active in the JUGs. How to finance the JUG and how to record your sessions. The session was made up into discusions in smaller groups and a large part at the end where all the results were discussed. We got allote of positive reactions and some people that want to start chapters in their own country.

In the evening there was the much hyped keynote session with Larry. Before Larry took the stage some other people from Oracle talked some and handed out some trophies. And there was some talks from HP. Larry was proceded by a short movie about the Americas cup (sailing competition) which was won by the USA in a boat sponsored by Oracle. In his talk for over more than an hour he mentioned Java twice and the JVM once.
Turned out that all the JavaOne attendees were rejected at the primairy location of the keynote and sent to the Hilton to watch the keynote on the bigscreens there. I think we got the better deal as we got to have free food and drink and we got to talk during the ‘boring’ keynote.

After this we had a short meeting with Yolande to discuse our session for tomorrow and our interview.

We will get back to you with day 2

Short History of Duchess Netherlands

15 September 2010 in articles by Clara Ko

November 2007

Linda, Elise, and Clara meet at the Masters of Java
and decide to create Duchess

Linda van der PalElise MeetsmaClara Ko
Masters of Java

December 2007

Monique joins us on the Duchess NL board

Monique Vael

Duchess becomes a JUG

Java User Group

January 2008

Duchess Agile Event

Speaker: Michael Franken from Agile Holland and
Sponsored by: iProfs

Februrary 2008

Duchess Website Launched

Duchess

Clara and Linda speak at FOSDEM 2008

Fosdem

June 2008

Clara and Linda speak at JBoss Benelux User Group

JBoss at Lunatech Research

September 2008

Duchess Spring Event

Topic: Spring Framework
Speaker: Arjen Poutsma from SpringSource
Sponsored by: Ijsberg

October 2008

Duchess Groovy & Grails Event

Topic: Groovy and Grails
Speaker: Maarten Hoppen from and Sponsored by: VX Company

December 2008

Duchess becomes a foundation

Duchess surpasses 100 members

100 Members

Duchess BOF at Devoxx 2008

Devoxx 2008

March 2009

Duchess joins the JCP

JCP

May 2009

Duchess Portal Event

Topic: JBoss Portal
Speaker: Marco Beelen from and Sponsored by: iProfs

Regina and Lucia joins us on the Duchess NL board

Regina ten BruggencateLucia Tovar Ruiz

March 2010

Duchess Community Website Launched

Duchess Screenshot

Duchess welcomes Duchess France

Duchess France

April 2010

Ania joins us on the Duchess NL board

Ania Gos

June 2010

Duchess Coding Dojo – TDD and FitNesse

Topic: FitNesse
Speaker: Marc Evers from Agile Holland and QWAN

September 2010

Duchess Coding Dojo 2 – More TDD Practice

Sponsored by: JTeam

September 20
(upcoming)

Duchess BOF at JavaOne

JavaOne

November 18
(upcoming)

Duchess BOF at Devoxx

Devoxx 2010

Recap coding dojo

12 September 2010 in articles, duchess events by Regina ten Bruggencate

On Friday evening, September 10, we held our second coding dojo. This time it was at JTeam.

A coding dojo is a meeting of developers who collaboratively solve a given programming challenge. It is an especially good method to learn TDD. To give you an impression, this is how it goes: A pair of developers begin the challenge by writing a first test. We use only one computer and all the coding can be seen on a big screen. Everyone is invited to comment and give advice. When the first test succeeds, a next test is written. The programming pair goes back to the audience and a new pair takes their place to solve the next test. Specific programming or Java knowledge is not a pre-requisite. We are all there to learn and to help others learn what we know. It’s very interactive.

And trust us, it’s a lot fun!

After pizza and some small talk we started the session. The kata was about calculating the total score of a bowling game using test driven development. In the break we had raffle to get some funds together for Duchess. The items raffled of were collected at all the different conferences so plenty of t-shirts and other goodies. As is usual for our sessions we had an international group of attendents. For this session Nicole Younic even came over from Germany because she wanted to meet more female developers. We ended the session with a clearer understanding of how test driven development works.

Now the Dojo and one possible sollution follows.

Problem Description

Create a program, which, given a valid sequence of rolls for one line of American Ten-Pin Bowling, produces the total score for the game. Here are some things that the program will not do:

  • We will not check for valid rolls.
  • We will not check for correct number of rolls and frames.
  • We will not provide scores for intermediate frames.

Depending on the application, this might or might not be a valid way to define a complete story, but we do it here for purposes of keeping the kata light. I think you’ll see that improvements like those above would go in readily if they were needed.

We can briefly summarize the scoring for this form of bowling:

  • Each game, or “line” of bowling, includes ten turns, or “frames” for the bowler.
  • In each frame, the bowler gets up to two tries to knock down all the pins.
  • If in two tries, he fails to knock them all down, his score for that frame is the total number of pins knocked down in his two tries.
  • If in two tries he knocks them all down, this is called a “spare” and his score for the frame is ten plus the number of pins knocked down on his next throw (in his next turn).
  • If on his first try in the frame he knocks down all the pins, this is called a “strike”. His turn is over, and his score for the frame is ten plus the simple total of the pins knocked down in his next two rolls.
  • If he gets a spare or strike in the last (tenth) frame, the bowler gets to throw one or two more bonus balls, respectively. These bonus throws are taken as part of the same turn. If the bonus throws knock down all the pins, the process does not repeat: the bonus throws are only used to calculate the score of the final frame.
  • The game score is the total of all frame scores.

How we tackled it

We started with a junit test where we only role zero’s. As you need to set up all the classes even a simple unit test will take some time for the first team. But as this is a ‘simple’ problem we got started fast. And after some problems as to how the scores are calculated and what the correct score should be for a given set of frames everyone got in the swing of things. One of the first refactorings was that some people wanted to introduce a frame class but not everyone thought we needed it. In the end it turned out we did need it.

Possible solution

<code>

<pre>
package org.duchess.dojo.bowling;

import junit.framework.Assert;

import org.junit.Test;

/**
* Test created for the bowling dojo.
* @author Regina ten Bruggencate
*/
public class KataTest {

@Test
public void allZero() {
String[] scoresheet = new String[20];
for (int i=0; i&lt;scoresheet.length; i++) {
scoresheet[i] = &quot;0&quot;;
}

Game game = new Game(scoresheet);
int score = game.getScore();

Assert.assertEquals(&quot;The score is not as we expected.&quot;, 0, score);
}

@Test
public void allStrikes() {
String[] scoresheet = new String[12];
for (int i=0; i&lt;scoresheet.length; i++) {
scoresheet[i] = &quot;X&quot;;
}

Game game = new Game(scoresheet);
int score = game.getScore();

Assert.assertEquals(&quot;The score is not as we expected.&quot;, 300, score);
}

@Test
public void allSpares() {
String[] scoresheet = {&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;,&quot;/&quot;,&quot;5&quot;};

Game game = new Game(scoresheet);
int score = game.getScore();
Assert.assertEquals(&quot;The score is not as we expected.&quot;, 150, score);
}

@Test
public void AllSparesNoBonusFirstThrowsNoThrows() {
String[] scoresheet = {&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;,&quot;/&quot;,&quot;-&quot;};

Game game = new Game(scoresheet);
int score = game.getScore();
Assert.assertEquals(&quot;The score is not as we expected.&quot;, 100, score);
}

@Test
public void allNoStrikesOrSpares() {
String[] scoresheet = {&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;,&quot;2&quot;,&quot;7&quot;};

Game game = new Game(scoresheet);
int score = game.getScore();
Assert.assertEquals(&quot;The score is not as we expected.&quot;, 90, score);
}

@Test
public void allNinesAndDash() {
String[] scoresheet = {&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;,&quot;9&quot;,&quot;-&quot;};

Game game = new Game(scoresheet);
int score = game.getScore();
Assert.assertEquals(&quot;The score is not as we expected.&quot;, 90, score);
}
}

package org.duchess.dojo.bowling;

/**
* This is a game of 10 pin bowling.
* A game has 10 frames with 2 roles each.
* A strike is scored when all the pins are down in the first role.
* A spare is scored when all the pins are down in the second role.
* On a strike the next two roles are add to the score of that frame.
* On a spare the next role is add to the score of that frame.
* When a strike is thrown in the final frame 2 more roles are allowed to
* be add to the total score of that frame. When a spare is thrown in the
* final frame 1 more role is allowed to be add to the total score of that
* frame.
* A strike is denoted with an X on the scoresheet.
* A spare is denoted with a / on the scoresheet.
* A non through is denoted with a - on the scoresheet.
* @author Regina ten Bruggencate
*/
public class Game {
private String[] scoreSheet;
private int totalScore;

private static final String STRIKE = &quot;X&quot;;
private static final String SPARE = &quot;/&quot;;
private static final String DASH = &quot;-&quot;;
private static final int MAX_NUMBER_OF_FRAMES = 10;

public Game(String[] scoreSheet) {
this.scoreSheet = scoreSheet;
Frame[] frames = createFrames();
score(frames);
}

private void score(Frame[] frames) {
for (int f = 0; f &lt; MAX_NUMBER_OF_FRAMES; f++) {
Frame frame = frames[f];
if (frame.isLastFrameStrike()) {
totalScore += 10; // first strike
if (STRIKE.equalsIgnoreCase(frame.getRole2())) {
totalScore += 10; // next role is also a strike
if (STRIKE.equalsIgnoreCase(frame.getRole3())) {
totalScore += 10; // last role is also a strike
} else {
totalScore += new Integer(frame.getRole3());
}
} else {
if (SPARE.equalsIgnoreCase(frame.getRole3())) {
totalScore += 10; // the last 2 roles create a strike
} else {
// The bonus scores are not strikes and not a spare
totalScore += new Integer(frame.getRole2());
totalScore += new Integer(frame.getRole3());
}
}
} else if (frame.isLastFrameSpare()) {
totalScore += 10;
if (STRIKE.equalsIgnoreCase(frame.getRole3())) {
// the bonus score is a strike
totalScore += 10;
} else {
totalScore += new Integer(frame.getRole3());
}
} else if (frame.isStrike()) {
totalScore += 10;
// add the next two roles to the total score
totalScore += findSumNextTwoRoles(frames, f);

} else if (frame.isSpare()) {
totalScore += 10;
totalScore += findNextRole(frames, f);
} else {
totalScore += new Integer(frame.getRole1());
totalScore += new Integer(frame.getRole2());
}
}
}

private Frame[] createFrames() {
Frame[] frames = new Frame[MAX_NUMBER_OF_FRAMES];
for (int f = 0; f &lt; frames.length; f++) {
frames[f] = new Frame();
}

int frameCounter = 0;
for (int i = 0; i &lt; scoreSheet.length; i++) {
if (STRIKE.equalsIgnoreCase(scoreSheet[i])) {
// check if it is the last frame
if (isLastFrame(frameCounter)) {
frames[frameCounter].setRole1(STRIKE);
if (DASH.equalsIgnoreCase(scoreSheet[(i + 1)])) {
frames[frameCounter].setRole2(&quot;0&quot;);
} else {
frames[frameCounter].setRole2(scoreSheet[(i + 1)]);
}
if (DASH.equalsIgnoreCase(scoreSheet[(i + 2)])) {
frames[frameCounter].setRole3(&quot;0&quot;);
} else {
frames[frameCounter].setRole3(scoreSheet[(i + 2)]);
}
break;
} else {
frames[frameCounter].setRole1(STRIKE);
frameCounter++;
}
} else if (SPARE.equalsIgnoreCase(scoreSheet[i])) {
frames[frameCounter].setRole2(SPARE);
if (isLastFrame(frameCounter)) {
if (DASH.equalsIgnoreCase(scoreSheet[(i + 1)])) {
frames[frameCounter].setRole3(&quot;0&quot;);
} else {
frames[frameCounter].setRole3(scoreSheet[(i + 1)]);
}
break;
} else {
frameCounter++;
}
} else {
if (isFirstRole(frames[frameCounter])) {
if (DASH.equalsIgnoreCase(scoreSheet[i])) {
frames[frameCounter].setRole1(&quot;0&quot;);
} else {
frames[frameCounter].setRole1(scoreSheet[i]);
}
} else {
if (DASH.equalsIgnoreCase(scoreSheet[i])) {
frames[frameCounter].setRole2(&quot;0&quot;);
} else {
frames[frameCounter].setRole2(scoreSheet[i]);
}
frameCounter++;
}
}
}
return frames;
}

private boolean isLastFrame(int frameCount) {
return !(frameCount &lt; (MAX_NUMBER_OF_FRAMES - 1));
}

private boolean isFirstRole(Frame frame) {
return null == frame.getRole1();
}

public int getScore() {
return totalScore;
}

private int findSumNextTwoRoles(Frame[] frames, int location) {
int total = 0;
if ((location + 1) == MAX_NUMBER_OF_FRAMES) {
// it is the ninth frame we need to get the next to roles from the
// final frame
if (STRIKE.equalsIgnoreCase(frames[MAX_NUMBER_OF_FRAMES].getRole1())) {
total += 10;
if (STRIKE.equalsIgnoreCase(frames[MAX_NUMBER_OF_FRAMES].getRole2())) {
total += 10;
} else {
total += new Integer(frames[MAX_NUMBER_OF_FRAMES].getRole2());
}
} else if (SPARE.equalsIgnoreCase(frames[MAX_NUMBER_OF_FRAMES].getRole2())) {
total += 10;
} else {
total += new Integer(frames[MAX_NUMBER_OF_FRAMES].getRole1());
total += new Integer(frames[MAX_NUMBER_OF_FRAMES].getRole2());
}
} else {
Frame next = frames[(location + 1)];
if (STRIKE.equalsIgnoreCase(next.getRole1())) {
total += 10; // first next role is a strike
if (isLastFrame(location + 1)) {
if (STRIKE.equalsIgnoreCase(next.getRole2())) {
total += 10;
} else {
total += new Integer(next.getRole2());
}
} else {
if (STRIKE.equalsIgnoreCase(frames[(location + 2)].getRole1())) {
total += 10;
} else {
total += new Integer(frames[(location + 2)].getRole1());
}
}
} else if (SPARE.equalsIgnoreCase(next.getRole2())) {
total += 10;
} else {
total += new Integer(next.getRole1());
total += new Integer(next.getRole2());
}
}
return total;
}

private int findNextRole(Frame[] frames, int location) {
int value = 0;
Frame next = frames[(location + 1)];
if (STRIKE.equalsIgnoreCase(next.getRole1())) {
value = 10;
} else {
value = new Integer(next.getRole1());
}
return value;
}
}

package org.duchess.dojo.bowling;

/**
* This is a frame of a game of ten pin bowling.
* It contains all the roles from that frame.
* Contains helper methods to determine the value of the
* roles and if it is the final frame.
* @author Regina ten Bruggencate
*/
public class Frame {
private String role1;
private String role2;
// Only used in the last frame
// one a strike or a spare
private String role3;

private static final String STRIKE = &quot;X&quot;;
private static final String SPARE = &quot;/&quot;;

public Frame() {
// empty default constructor
}

public boolean isStrike() {
return STRIKE.equalsIgnoreCase(role1);
}

public boolean isSpare() {
return SPARE.equalsIgnoreCase(role2);
}

public boolean isLastFrameStrike() {
return isStrike() &amp;&amp; null!=role3;
}

public boolean isLastFrameSpare() {
return isSpare() &amp;&amp; null != role3;
}

public String getRole1() {
return role1;
}

public void setRole1(String role1) {
this.role1 = role1;
}

public String getRole2() {
return role2;
}

public void setRole2(String role2) {
this.role2 = role2;
}

public String getRole3() {
return role3;
}

public void setRole3(String role3) {
this.role3 = role3;
}
}
</pre>

</code>

Report: Duchess Coding Dojo – TDD with FitNesse

5 August 2010 in articles, duchess events by Clara Ko

On June 18, Duchess organized her first coding dojo with assistance from Marc Evers from AgileHolland. The subject was Test-Driven Development with FitNesse, which we applied to the Roman Number Kata.

It was a truly interactive session where everyone had a chance to get in the driver and co-pilot seats.

We got a good start with FitNesse with cheat sheet from Erik Pragt, where we learned the default table fixture. Then, took too big a step and had trouble getting the next test to pass. We learned from Marc that this is part of the normal process of learning TDD. Baby Steps are not as easy as it sounds and we learned that we need to choose our tests carefully so as not to take too big of a step.

We intend to get good at TDD with lots of Deliberate Practice. Please join us on our next Coding Dojo to be hosted by JTeam. Announcement coming soon!