Jump to page content Jump to navigation

College Board

AP Central

AP Exam Reader
Siemens Awards for Advanced Placement

APAC 2010
Print Page
Home > AP Courses and Exams > Course Home Pages > eXtreme Programming

eXtreme Programming

by Cody Henrichsen
Granger High School
West Valley City, Utah

XP Methodology for the AP CS Curriculum
What Is XP?
A Beginning XP Assignment
Resources

XP Methodology for the AP CS Curriculum
Wait a second. We are already running XP on our computers.

Actually, this XP is something completely different from Microsoft's latest operating system. XP, or eXtreme Programming, is a software development methodology that should definitely be included as part of your AP Computer Science curriculum. There are three main reasons to integrate XP in your classroom. First is the increased importance of design as an element of computer science. Second is the potential for increasing the effective programming skills of your students. And third is the applicability to a real-world programming situation where most code is not done by individuals, but by teams or groups.

As design is now a question on the AP Exam, it is very important for students to practice design within a set of time constraints that can match the exam. XP fits this perfectly because it requires that students present a product in working form at the end of each timed session. Further, programmers must also choose what will best meet the needs of the assignment. By practicing this task with other students on a regular basis, a good design foundation is easily formed. After I completed a course in software design, I immediately focused on the importance of having good design habits in the AP CS classroom. Just think how much easier it is to grade code that makes sense to more than one person!

Good design leads to the increased effectiveness of students as programmers. Now, when looking at raw code, it is easily determined who wrote it. This tool will help students learn to allocate and use time effectively. The benefits also are seen beyond the code when students write about what went well, recognize the strengths and weaknesses they have, and use this self-analysis to move forward.

The "real-world" benefit is realized when programmers who are familiar with working as a team are assigned to solve an issue. It is not like the cook's adage, "Too many cooks spoil the pot." Rather, multiple programmers who work together can often accomplish more than when on their own. Dispelling the cowboy myth (coding is best done by an individual working alone with the attitude that the resulting code is perfect and never needs to be checked by others for errors) is another benefit of the XP methodology. Students realize that other jobs are important in writing a program to solve a problem that goes beyond coding. In fact, some of these jobs have more importance in the life cycle of software design than does the coding itself.

What Is XP?
To implement the benefits of XP, let's look at a brief overview of XP and its practices.

XP, or eXtreme Programming, is a method of software development that encourages close interaction between those involved in both the design aspect and requirement aspects of the programs being developed. When properly implemented, XP can drastically improve the potential for satisfaction with the results. Some XP ideas are listed below:
  • Team Ownership: The project is not just one person's work. There must be involvement in all aspects by every member of the team. Thus, all share in the gory details and the glory.

  • Working Copy: Whenever a stage of the design is presented, it is always a working copy of the specifications to date. The customer can then see what is needed or desired in relation to what presently exists.

  • Code Review: All programmers must learn to examine code. A fresh pair of eyes will often save hours of frustration. This is also part of the rule, "Make sure your code does only what it should do."

  • Strict Time Frame: Students must plan accordingly so that great code can be developed. Crunch time should be minimized to help the programmers respond better and to present a better end product.
A Beginning XP Assignment
To apply XP to a classroom setting, try the following.

Split the class into groups of five. For the first time using XP, I recommend assigning the roles and then rotating students through the roles on the next round so they can experience the challenges faced by the different roles in the software development phase. Each group is in the following format:
  • One Manager: This person's responsibilities include passing information from the customers to the programmers/designers. The manager is also responsible for ensuring that the project runs according to the strict time schedule and keeps both groups on task during each phase.

  • Two Programmers: They are responsible only to meet the goals of the customer. They need to alternate between creating (coding) and reviewing in each cycle. They must supply a working version at the end of each cycle.

  • Two Customers: The customer is responsible for the fine-tuning of the general specifications supplied by you (the teacher). They must communicate all of their needs in written format. They must also specifically identify their needs.

Once the groups are decided, you assign the customers a product to request. When starting this project, I suggest some noncomputer-related goals like a chair, game, car, teacher, etc. You can then integrate the pattern to the curriculum more specifically.

The XP assignment goes through a few phases. Review the phases with the class prior to the preparation phase. Then place the names of the phases and the times allotted in big letters on the board/screen. The following times are for a block schedule with two rounds in class that day. With the current times, it should work for one session on a traditional schedule. I highly recommend a debriefing session after all the groups have presented so you can get immediate feedback on the project.
  1. Prep Phase: 20 minutes
    Explain how this project is going to run, assign roles, answer and ask questions.

  2. Interaction Phase: 5 minutes
    This is where programmers and customers share their desires and costs. Customers list requirements on 3x5 cards, one requirement per card. The cards are submitted via the manager to the programmers to get time costs attached to each individual card. The customers then determine which features they want based on the time cost (2 minutes). The manager should ensure that all members are participating and that both groups are clarifying any questions.

  3. Programming Phase: 5 minutes
    • Design
    • Put together working version
    • Check against customer requests
    The design of the product is split between the group, with one coding (or drawing in this case) and the other reviewing the documentation to make sure the product fits the specifications. The manager should check that one person is not doing the same job in the next cycle.

  4. Interaction Phase: 3 minutes
    The manager presents the current working model. The customers determine if it meets specs and make changes as needed, again submitting them via a 3x5 card. The programmers then assign times to the cards for the customer to choose from.

  5. Programming Phase: 3 minutes
    The programmers alternate between the jobs held in the previous session. All revisions are made; the programmer who is not coding this round watches the time in comparison to the promised results as they review the product before presenting.

  6. Interaction Phase: 3 minutes
    Again, the manager presents the current working model. The customers check for requirements and choose final additions or revisions. This is an especially important time for customer/programmer clarification.

  7. Programming Phase: 3 minutes
    The programmers alternate between the jobs held in the previous session. All revisions are made; the programmer who is not coding this round watches the time in comparison to the promised results as they review the product before presenting.

  8. Presentation Phase: 2 minutes plus writing
    The manager presents the final working version to the class. Each group explains what went well/poorly in a short, written evaluation of the team and the group as a whole.
As you progress through the year, this assignment should change to incorporate more of the structures and ideas that are used in class, such as interfaces, searching, Big-O, etc.

Resources
I have used the following sources for researching XP and software design:

"Learning the Planning Game: An Extreme Exercise" by Joe Bergin. I originally found this over a year ago and used it to get ideas to do some group activities in class. After adapting the suggested exercise for my programming class, I came back to the page while working on the software design course and found new elements to use.

  Learning the Planning Game: An Extreme Exercise

"JUnit"
JUnit is a tool designed to support the test-first programming aspect of XP. It is fairly easy to use with either a command line or the GUI interface. It is also a great way to show interfaces in action.

  JUnit

"UMLet"
UMLet is a wonderful tool to generate UML diagrams and is a way to put the design ideas in a concrete framework.

  UMLet

Refactoring: Improving the Design of Existing Code by Martin Fowler
This book provides the basics and details of design. It is written to help you rewrite code so it works better and is easier to understand. I would definitely recommend this to all AP teachers and a few sections of it to all students.

  Refactoring: Improving the Design of Existing Code

The following Web sites deal with the ideas and the practice of XP. Definitely explore these sites for more detailed information. The first two sites deal directly with XP and its use. The third site is a wonderful resource for a variety of computer-related topics.

  XProgramming.com

  Extreme Programming: A Gentle Introduction

  Like Extreme Programming


Cody Henrichsen has been teaching computer science at Granger High School in West Valley City, Utah, for the past three years. He served as an Exam Reader for the first time in June 2003. He also teaches American history and coaches the debate team. This is his first published article.


  ABOUT MY AP CENTRAL
    Course and Email Newsletter Preferences
  AP COURSES AND EXAMS
    Course Home Pages
    Course Descriptions
    The Course Audit
    Sample Syllabi
    Teachers' Resources
    Exam Calendar and Fees
    Exam Questions
    FAQs
  PRE-AP
    Teachers' Corner
    Workshops
  AP COMMUNITY
    About Electronic Discussion Groups
    Become an AP Exam Reader

Back to top