Extreme ProgrammingSoftware engineering methodologiesAgile programming methodologiesExtreme programmingXP valuesXP practicesPair programming is...Pair programming in this courseTest-Driven Development (TDD)Continuous integrationCoding standardsSimple designXP in this courseWhat I expect of youThe EndJan 14, 2019Extreme Programming2Software engineering methodologiesA methodology is a formalized process or set of practices for creating softwareAn early methodology was the waterfall model, so named because each stage flowed into the next, with no backing up to a previous stageThe stages were: Requirements Design Implementation Verification MaintenanceThe waterfall model has never been regarded as a “good” modelMethodologies are subject to fads, and are frequently imposed on programmers by managementSome methodologies are bad—even ridiculously badThis doesn’t mean all methodologies are badHowever, a single methodology doesn’t work for all cases3Agile programming methodologiesThere are (at least) two serious problems with the waterfall model:It assumes that there will be no unforeseen difficulties in the software developmentIt assumes that the customers know (and can specify) what they want, in extreme detailAgile programming methodologies (of which there are several) assume:Customers can best discover what software meets their needs via frequent iterationsHence, communication between customers and developers is vitalRequirements will need to be revised, probably multiple times, during software development4Extreme programmingIn this course we will draw on a number of ideas from one particular agile methodology, Extreme Programming (XP)The basic idea of extreme programming is to take to an extreme each of several known good practices“The first time I was asked to lead a team, I asked them to do a little bit of the things I thought were sensible, like testing and reviews. The second time there was a lot more on the line. I thought, "Damn the torpedoes, at least this will make a good article," [and] asked the team to crank up all the knobs to 10 on the things I thought were essential and leave out everything else.” — Kent Beck For example, it is well known that software should be tested frequently during developmentExtreme programming advocates testing code literally every few minutes, after every minor changeExtreme programming works best for relatively small projects with a small number of good programmers5XP valuesCommunicationUse simple designs and common metaphors, talk continuously with your programmers and customersSimplicityFollow the KISS principle (“Keep It Simple, Stupid!”)FeedbackFrom the system: Unit testsFrom the customer: Acceptance testsFrom the team: Estimate the time to implement new requirementsCourageCode for today, not tomorrowRefactor as appropriateBe willing to throw code awayRespectTrust your team members not to submit nonworking code6XP practicesFine scale feedbackPair ProgrammingPlanning GameTest Driven DevelopmentWhole TeamContinuous processContinuous IntegrationDesign ImprovementSmall ReleasesShared understandingCoding StandardsCollective Code OwnershipSimple DesignSystem MetaphorProgrammer welfareSustainable PaceSource: http://en.wikipedia.org/wiki/Extreme_programming7Pair programming is...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. --Laurie Williams North Carolina State University Computer ScienceSource: http://www.pairprogramming.com/8Pair programming in this courseOne purpose of the Friday lab sections is to get you started pair programming on each projectAfter lab, you should work together with your partner as closely as possibleI know this may not be easy for some of youAt least trade email addresses, and work together that wayInstant messaging is often betterIf you have programming problems, go first to your partner for helpReading assignment: All I Really Need To Know About Pair Programming I Learned In Kindergarten, by Laurie Williams and Robert Kessler (PDF)The URL is too long to post here, but it’s on the class web page (or you can just Google for it)9Test-Driven Development (TDD)TDD is a technique in which you write the tests before you write the code you want to test This seems backward, but it really does work better: When tests are written first, you have a clearer idea what to do when you write the methodsBecause the tests are written first, the code is necessarily written to be testableWriting tests first encourages you to write simpler, single-purpose methodsBecause the methods will be called from more than one environment (the “real” one, plus your test class), they tend to be more independent of the environmentTo do TDD, it must be easy to create and run testsJUnit is a framework that makes this much easier to dounittest is the Python version of JUnit10Continuous integrationUnit testing is testing a single, more-or-less independent part of a program in isolationIntegration testing is testing the complete program with all its parts, to make certain they all work togetherContinuous integration is performing integration tests frequently (usually daily)Continuous integration is more important on larger projectsFor class projects, last-minute integration is still a bad idea11Coding standardsCoding standards make it simpler for your teammates (or yourself, weeks later) to read your codeJava has some very well defined conventions you should learnSome conventions are strictly mechanical, such as formatting (spacing and indentation)Eclipse can, upon request, correct your formatting for youSome conventions require human intelligenceUse meaningful names, with the correct part of speechUse adequate comments, written for the correct
View Full Document