Distributed Pair Programming with DocShare


Laurie Williams and Lauren Hayward [Contact Authors]
CSC 326 - Software Engineering
Department of Computer Science
North Carolina State University

Back to Software Engineering Tutorials


0.0 Contents
1.0 Introduction to DocShare
2.0 Getting Started with this Tutorial
3.0 Connecting to a Chat Client
4.0 Pair Programming
5.0 Other Interesting Features
6.0 Exercise
7.0 Resources

1.0 Introduction to DocShare

DocShare is an Eclipse plugin that allows two developers to pair program from distributed locations. The users can view the same code and collaborate as they work together to write code. DocShare currently allows for collaboration in the Java Editor and the Text Editor, but it can be modified for other editors (see here).

Laurie Williams from North Carolina State University describes pair programming as, "Two programmers working side-by-side, collaborating on the same design, algorithm, code or test. One programmer, the driver, has control of the keyboard/mouse and actively implements the program. The other programmer, the observer, continuously observes the work of the driver to identify tactical (syntactic, spelling, etc.) defects and also thinks strategically about the direction of the work. On demand, the two programmers can brainstorm any challenging problem. Because the two programmers periodically switch roles, they work together as equals to develop software."

DocShare is based on the Eclipse Collaboration Framework (ECF). DocShare for Eclipse 3.3 can be downloaded from the update site (http://download.eclipse.org/rt/ecf/2.0/updateSite) or from a zip file (org.eclipse.ecf.sdk-2.0.1.v20081006-2232.zip). DocShare for Eclipse 3.4 can be downloaded form the update site (http://download.eclipse.org/rt/ecf/2.0/3.4/updateSite/site.xml) or from a zip file (org.eclipse.ecf.sdk-2.0.1.v20080916-1301.zip). For more information on installing eclipse plugins, consult the tutorial on the subject.

Notes on installation: Rational Team Concert is built on Eclipse 3.3. Mac and Linux users may need to use the zip file installation.

An extension for DocShare that allows for sharing in the JSP Editor is available here. To install it, simply extract the zip file to your eclipse folder. If you are using Jazz, extract to jazz/client/eclipse. For students using lab machines in 3228, you should extract the file to C:/jazz/jazz/client/eclipse. You will need to restart your workspace after extracting the file.

Top | Contents


2.0 Getting Started with this Tutorial

For this tutorial, we will need two users: Lauren and Jason. You can work with another person on this tutorial and designate who will be Lauren and who will be Jason, or you can simply open two instances of Eclipse or Rational Team Concert on the same machine and use separate chat client accounts for each user.

For users completing this tutorial from distributed locations: It is possible to instant message once you have connected through DocShare, but you may find it helpful to begin the tutorial using some sort of external form of communication like instant messaging, video chat through TokBox, or a telephone call.

All users may find it beneficial to try distributed pair programming with communication through a free TokBox voice or video call. TokBox is a web application that allows users to login to their AOL, MSN, Yahoo, and/or Google instant messaging accounts and make voice or video calls.

Top | Contents
3.0 Connecting to a Chat Client

In this section, you will setup a connection a chat client for distributed pair programming. The DocShare plugin should be installed before beginning this section (see Section 1.0 for more information on installing the plugin).

  1. Both Lauren and Jason should follow all of the steps in this section.
  2. To begin, open the Communications Perspective. Go to Window > Open Perspective > Other... as shown in Figure 1.

    Figure 1
    Figure 1: Opening the Perspectives Dialog.

    Then select Communications and press OK as shown in Figure 2.

    Figure 2
    Figure 2: Selecting the Communications perspective.

  3. You should now see two new buttons in your toolbar as shown in Figure 3. These buttons allow you to connect to a provider and connect your workspace to a collaboration group.

    Figure 3
    Figure 3: DocShare buttons in the toolbar.

  4. In order to begin pair programming, you must connect to a chat client. In this example, we will use Google chat. For more information on connecting through IRC, view this tutorial.

    Press the Connect to Provider button and select XMPPS as shown in Figure 4.

    Figure 4
    Figure 4: Selecting XMPPS.

    Enter your Google User ID and Password and then press Finish as shown in Figure 5.

    Figure 5
    Figure 5: Entering chat client information.

    The Contacts view will now show your connection and any contacts associated with your account. In Figure 6, Lauren has 1 contact, jasin.ecf. If Lauren and Jason are not already on each other's contact list, do so now using your regular chat client.

    Figure 6
    Figure 6: Lauren.ecf's contacts view.

Top | Contents

4.0 Pair Programming

Once you have established a connection as described in Section 2.0, you are ready to start pair programming.

  1. Lauren should create a new Java Project. Go to File > New > Other... as shown in Figure 7.


    Figure 7
    Figure 7: Opening the New wizard.

    Then select Java > Project and click Next as shown in Figure 8.

    Figure 8
    Figure 8: Selecting new Java project.


    Enter a name for your project and then click Finish as shown in Figure 9.

    Figure 9
    Figure 9: Creating a new Java Project.

  2. Now Lauren needs to create a class on which Lauren and Jason will collaborate. Go to File > New > Other... as shown in Figure 10.

    Figure 10
    Figure 10: Opening the New wizard.

    Then select Java > Class and click Next as shown in Figure 11.

    Figure 11
    Figure 11: Selecting new Java class.

    Enter a name for your class and then click Finish as shown in Figure 12.

    Figure 12
    Figure 12: Creating a new Java Class.


    Note: You do not need to create a new class every time you pair program. You can simply open an existing file.
  3. The class should automatically open in the Java editor. If it does not, double click the class name in the Navigator view.
  4. Inside the Java editor view, right-click and select Share Editor With > [your chat client name] > [Jason's chat client name] as shown in Figure 13.

    Figure 13
    Figure 13: Sharing editor.

    Note: If you do not have any contacts currently online who are connected to DocShare, the Share Editor With option will not appear in your menu.
  5. Jason will now receive a dialog box asking him if he would like to accept the invitation to share the editor. He should click Yes as shown in Figure 14.

    Figure 14
    Figure 14: Share Editor Dialog Box


    When he does this, a new view will open with Lauren's class.

    Note: The view on Jason's computer is only a temporary file. It is important for Lauren to save the file. If you are using a version control system, Lauren should commit the file.
  6. Both users can now pair program together. Try creating a main method together that prints Hello World.
  7. When you are done pair programming, it is important for one of the users to stop sharing the file as each user can only share one editor at a time. (If you forget, the connection may remain open so you will not receive requests for sharing the editor. To remedy this, disconnect by right-clicking on your chat id in the Contact view and select Disconnect. Then reconnect)

    To stop sharing, right-click inside the editor and select Stop Sharing Editor with ... as shown in Figure 15.

    Figure 15
    Figure 16: Stop sharing editor

Top | Contents


5.0 Other Interesting Features

DocShare has many other features you may want to explore.

  1. To see some of these features, open the Contacts view. If it is not already open, go to Window > Show View > Other... and then select Communications > Contacts. Some of these features include Sending an Instant Message, Sending a URL, and Sending a File.
  2. You can also connect to a collaboration group by clicking the button, which allows you to chat with others on the same server.

Top | Contents


6.0 Exercise
With your partner, use DocShare to pair program and create a new class that prints Hello World. Show your TA your new class and demonstrate pair programming with one partner driving and the other observing.
Top | Contents


7.0 Resources
Top | Contents

Back to Software Engineering Tutorials
DocShare©2003-2008. North Carolina State University, Laurie Williams and Lauren Hayward
Questions? Comments? Contact our mailing list

Last Updated: Thursday, November 20, 2008 10:32 PM