Page 236 - DCAP305_PRINCIPLES_OF_SOFTWARE_ENGINEERING
P. 236

Principles of Software Engineering



                   Notes         that they enjoyed programming more when they worked with a partner. Ninety-six percent of
                                 them indicated they felt more confident in their product when they worked with a partner.
                                 Increased Teamwork: Pair programmers get to know their classmates much better because they
                                 work so closely together.

                                 Enhanced learning: Pairs continuously learn by watching how their partners approach a task,
                                 how they use their language capabilities, and how they use the development tools.

                                 11.3.3 How Does Pair Programming Work?
                                 It may seem odd that two people can sit down at one computer and finish in about half the
                                 time, with higher quality code, and enhanced morale, teamwork, and learning. But studies have
                                 shown that pairing makes work differently.

                                 Pair Pressure
                                    •  Programmers say they work harder and smarter on programs because they do not want
                                      to let their partner down.
                                    •  Programmers say they work very intensively because they are highly motivated to complete
                                      the task at hand during the session.
                                 Pair Negotiation

                                 The second of the pair programming behaviours we discuss is one we call pair-negotiation. The
                                 term pair negotiation is describe how two pair programmers arrive at the best solution together,
                                 when pairing is working at its best:
                                    •  Each person brings to the partnership his or her own set of skills, abilities, and outlooks.
                                    •  Both share the same goal for completing the task.
                                    •  Each person has a suggested alternative for attacking a joint problem.

                                    •  The partners must negotiate how to jointly approach the problem. In this negotiation,
                                      they evaluate more alternatives than either one would have considered alone, whereas,
                                      a person working alone tends to pursue the first approach that comes to mind. Together,
                                      the partners consider and include each other’s suggestions and determine the best plan
                                      of attack.
                                 Brainstorming
                                 Pair brainstorming describes the give-and-take procedure in which two people work together
                                 to resolve a problem. They share their knowledge and energy, chipping steadily away at the
                                 problem, evolving a solution to the problem. An effective technique of brainstorm is to build
                                 upon the ideas of others. A subtle difference in pair brainstorming though, is that the driver
                                 might actually be working out a design or implementing part of the problem, realizing that he
                                 or she may ultimately come to a dead end in their problem resolution. The navigator, while
                                 watching  the  driver’s  partial  design  or  implementation,  also  begins  thinking  about  the  next
                                 step. When the driver hits the dead end, the navigator is often prepared to take over and lead
                                 the way. Often, the cycle continues until the problem is determined.

                                 Pair Debugging
                                 Every  person  has  experienced  problems  that  can  be  determined  simply  through  the  act  of
                                 explaining the problems to another person. Others have cited the need just to have a cardboard
                                 cut-out of their favorite guru or a rubber duck. When they have a problem, they must explain
                                 the problem to the inanimate helper, often finding the elusive flaw in the logic. Doubtlessly, it
                                 is better to have an animate person to debug with than an inanimate helper. A person will ask
                                 questions and will likely cause you to frequently explain your reasoning.


        230                               LOVELY PROFESSIONAL UNIVERSITY
   231   232   233   234   235   236   237   238   239   240   241