| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> |
| <!-- VERSION rmc:7.1.0 --> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| <!-- START NON-TRANSLATABLE --> |
| <title>\xp\tasks\write_code.xmi</title> |
| </head> |
| <!-- WARNING: do not modify the generated comments in this file below this line. They are used as markers for the import process. --> |
| <body> |
| Element Name: write_code.xmi<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: presentationName<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:presentationName,{8F6CB99A-D2EA-44BB-8CE5-F97220D44088} CRC: 3725566187 -->Write Code<!-- END:presentationName,{8F6CB99A-D2EA-44BB-8CE5-F97220D44088} --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: purpose<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:purpose,-kNZQ2Mr_nyfmCboprjMNTg CRC: 3261426090 --><a id="XE_write_code__activity_definition" name="XE_write_code__activity_definition"></a> |
| <ul> |
| <li> |
| To specify the design of the system in a way which is precise enough to allow computers to generate efficient |
| processes automatically and clear enough for people to understand during ongoing work and maintenance. |
| </li> |
| </ul><!-- END:purpose,-kNZQ2Mr_nyfmCboprjMNTg --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: name<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:name,_oUbPkGE-EdqnIZeW8YpHcA CRC: 835369410 --> Get a Pair Programming Partner <!-- END:name,_oUbPkGE-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: sectionDescription<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:sectionDescription,_oUbPkGE-EdqnIZeW8YpHcA CRC: 527002794 --><a id="Step1" name="Step1"></a> |
| <p> |
| Pair Programming is an Extreme Programming best practice. The basic rule regarding pair programming in XP is that all |
| production code is developed in pairs. One programmer has the responsibility to complete a task. That programmer asks |
| other programmers to pair with him to complete the task. The pairings are short term, usually less than half a day. |
| Find a partner who has experience or skill you need to complete your task. Your task may include modifying a database |
| table. Ask the person on the team most knowledgeable to help you effectively use the database API. Later, you might |
| need to display the data in a GUI window, but you have not seen that part of the GUI. Get someone who knows about it to |
| help. |
| </p><!-- END:sectionDescription,_oUbPkGE-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: name<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:name,_oUbPkWE-EdqnIZeW8YpHcA CRC: 4082082900 --> Write Failing Test Case <!-- END:name,_oUbPkWE-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: sectionDescription<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:sectionDescription,_oUbPkWE-EdqnIZeW8YpHcA CRC: 155191086 --><a id="Step2" name="Step2"></a> |
| <p> |
| When looking at an Engineering Task, you should consider how to add the capability to the system. Does the system |
| require new classes? Are there classes that would be useful? Regardless of how these decisions come out, the addition |
| of functionality requires the creation of a test case. You write the test case to demonstrate that a portion of the |
| functionality you need isn't in the system. This test case should fail. |
| </p><!-- END:sectionDescription,_oUbPkWE-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: name<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:name,_oUbPkmE-EdqnIZeW8YpHcA CRC: 1522612366 --> Write Code to Make Tests Pass <!-- END:name,_oUbPkmE-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: sectionDescription<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:sectionDescription,_oUbPkmE-EdqnIZeW8YpHcA CRC: 2697689831 --><a id="Step3" name="Step3"></a> |
| <p> |
| When you have a failing test case, you then write only the code that is necessary to satisfy the test case. Test cases |
| should have a very narrow focus. A failing test case may trigger the creation of a new class or method named in the |
| test case, or it may simply require you to add more code to existing classes and methods. |
| </p><!-- END:sectionDescription,_oUbPkmE-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: name<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:name,_oUbPk2E-EdqnIZeW8YpHcA CRC: 224726104 --> Refactor Immediately <!-- END:name,_oUbPk2E-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: sectionDescription<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:sectionDescription,_oUbPk2E-EdqnIZeW8YpHcA CRC: 1118730165 --><a id="Step4" name="Step4"></a> |
| <p> |
| After the test case passes, go back and make the code as clean as possible. Have you added code to a method and caused |
| the method to have more than one primary job? If so, extract a method. Has a class grown too large? Consider extracting |
| a class. Have you noticed duplication? Refactor to remove it. |
| </p><!-- END:sectionDescription,_oUbPk2E-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: name<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:name,_oUbPlGE-EdqnIZeW8YpHcA CRC: 2875719903 --> Repeat Until Engineering Task is Done <!-- END:name,_oUbPlGE-EdqnIZeW8YpHcA --> |
| <br/><br/><br/> |
| <!-- START NON-TRANSLATABLE --> |
| Attribute: sectionDescription<br/><br/> |
| <!-- END NON-TRANSLATABLE --> |
| <!-- START:sectionDescription,_oUbPlGE-EdqnIZeW8YpHcA CRC: 3912628763 --><a id="Step5" name="Step5"></a> |
| <p> |
| The preceding three steps should be done in sequence over and over until you and your pair partner are done with the |
| engineering task. It is important to refactor as you go because refactoring, even on a micro-scale, makes additional |
| work easier. |
| </p><!-- END:sectionDescription,_oUbPlGE-EdqnIZeW8YpHcA --> |
| </body> |
| </html> |