Practices of agile developers


Published on

Agile learning, coding, debugging & collaboration.

Published in: Education, Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • No more theory, no more processes, no more models. We’ll discuss the daily practices of an agile developer which help you actively transform yourself to a higher level of SoftDev capability. We need to step out from books!
  • 1: human-driven2: outcome-driven3: feedback-driven4: adaptive
  • Things: code, process, model, tools. Adjustment must be based on well-understanding of stuffs.common responses to an obvious error:• Dismiss the person as incompetent.• Dismiss the idea by pointing out the obvious flaw.• Ask your teammate to address your concern.Courage: sometimes you don’t see the situation as written in books, you must be honest with ys that requires courage
  • At the start of a meeting, pick a mediator who willact as the decision maker for that session.
  • take Java, forinstance. You have the Java language with its series of updated features.Then you have Swing, Servlets, JSP, Struts, Tapestry, JSF,JDBC, JDO, Hibernate, JMS, EJB, Lucene, Spring...; the list goes on.If you are into Microsoft technology, you have VB, Visual C++, MFC,COM, ATL, .NET, C#, VB.NET, ASP.NET, ADO.NET, WinForms, EnterpriseServices, Biztalk.... And don’t forget UML, Ruby, XML, DOM, SAX,JAXP, JDOM, XSL, Schema, SOAP, web services, SOA; yet again the listgoes on (and we’re starting to run out of short acronyms).
  • Words vs. ImagesImage:
  • Metaphor : transferWhat we call windows on the computer screen aren’t really windows at all. The mouse isn’t actually a rodent. A folder on your hard disk isn’t a real folder, and the trashcan isn’t a real can.
  • For pricing, for example.What are use case point, function point, man month, person day, user story point?
  • Use prototyping for test code, code some, fill someAutomate to save timeSimulation: write code for Arithmetics. Add/Substract/Divide/Multiply
  • Novices need recipes. Advanced beginners don’twantthe big picture. Competent practitioners can troubleshoot. Proficient practitionerscan self-correct. Experts workfrom intuition.For your team:Use rules for novices, intuition for experts.For you: Know what you don’t know.For student: Expert != TeacherNo Expertise Without ExperienceGladwell: take any chance you got to practice. Think ab. the case of MS.
  • Comment a function:Purpose: Why does this method exist?Requirements (pre-conditions): What inputs do we need, and what state must the object be in, for this method to work?Promises (post-conditions): What state is the object in, and what values are returned, on successful completion of this method?Exceptions: What can go wrong, and what exceptions may be thrown?
  • XP values:Keep it simpleDRYCohesion is a measure of how functionally related the members of acomponent (package, module, or assembly) are
  • GoF: Gang of Four() – authors of Design Patterns: Elements of Reusable Object-Oriented Software“Don’t reinvent the wheel”Example:
  • Example of Singleton design pattern, used in code
  • What do you have in NetBeans, Eclipse, VS?
  • Bug Report:* Date of the problem• Short description of the problem or issue• Detailed description of the solution• References to articles, and URLs, that have more details or relatedinformation• Any code segments, settings, and snapshots of dialogs that maybe part of the solution or help you further understand the detailsAttack Problems in Isolation: design low-coupled code
  • Training is not all about technical .Ask Phuong : how can she train her team?
  • DRY practice in seeing others report progress motivates each of us to do the same.
  • What is dirty|smelling code?
  • One-night-a-month monster code review session: bring all needed stuffs: food, drink, music, game ..
  • Using “crowd intelligence”
  • Next session will examine some advanced tool for agile devlopers
  • Reflection: use a paper, draw a mind-mapRepeat the spirit
  • Closing Remarks: Take any chance, and practice.
  • Practices of agile developers

    1. 1. Session 2 <br />Practices of agile developers<br />AgileDev Tour<br />Duong Trong Tan<br /><br />Hanoi, December 2010<br />
    2. 2. Objectives<br />TurboBoost your development performance<br />2<br />Beginning agility<br />Feeding agility<br />Deliver what customers want<br />Agile feedback<br />Agile coding<br />Agile debugging<br />Agile collaboration<br />Improvement of individual expertise and productivity<br />
    3. 3. Recap : The Manifesto<br />TurboBoost your development performance<br />3<br />Individuals and interactions<br />over processes and tools<br />Working software<br />over comprehensive documentation<br />Customer collaboration<br />over contract negotiation<br />Responding to change<br />over following a plan<br />
    4. 4. “He who chooses the beginning of a Road<br />chooses the place it leads to.”<br />Harry Emerson Fosdick<br />TurboBoost your development performance<br />4<br />Beginning Agility<br />
    5. 5. Prepare some basic “principles” before loading...<br />TurboBoost your development performance<br />5<br />Work for outcome<br />“Quick fixes become quicksand”<br />Understand things first, before you begin to make changes effectively.<br />Criticize ideas, not people<br />“Keep It Professional, Not Personal”<br />“Negativity kills innovation”<br />Courage<br />Be honest, and have the courage to communicate the truth.<br />
    6. 6. Tips<br />TurboBoost your development performance<br />6<br />Set a deadline.<br />Argue the opposite.<br />Use a mediator.<br />Support the decision.<br />“There is no absolute best, only better.”<br />“Being unemotional does not mean you blindly accept any and all ideas presented.”<br />
    7. 7. Practices of agility<br />“Agile development uses feedback to make constant adjustments in a highly collaborative environment.”[1]<br />7<br />TurboBoost your development performance<br />
    8. 8. “Even if you are on the right track, you will<br />get run over if you just sit there.”<br />Will Rogers<br />TurboBoost your development performance<br />8<br />Feeding Agility<br />
    9. 9. TurboBoost your development performance<br />9<br />Who knows Java?<br />How about these buzzes: <br />Swing, Servlets, JSP, Struts, Tapestry, JSF, JDBC, JDO, Hibernate, JMS, EJB, Lucene, Spring, UML, Ruby, XML, DOM, SAX, JAXP, JDOM, XSL, SOAP, web services, SOA, OOAD, SVN, JUnit, JMeter etc. <br />
    10. 10. Information is money, keep up with changes<br />TurboBoost your development performance<br />10<br />“There is nothing permanent except change”<br />Technologyevolves rapidly, where are you on the “wave”?<br />Tips:<br />Learn iteratively and incrementally.<br />Get the latest buzz.<br />Attend local user groups.<br />Attend workshops or conferences.<br />Read voraciously.<br />Know whenwhat to un-learn<br />Question Until You Understand<br />
    11. 11. This is your brain<br />TurboBoost your development performance<br />11<br />Image courtesy to Andy Hunt<br />
    12. 12. This is your brain (cont’d)<br />TurboBoost your development performance<br />12<br />Non-verbal<br />Spatial<br />Random<br />Intuitive<br />HolisticSynthesizing<br /> Subjective<br />Looks at wholes<br />Verbal<br />Symbolic<br />Abstract<br />Logical<br />Sequential<br />Rational<br />Analytical<br />Objective<br />Temporal<br />Looks at parts<br />Image courtesy to Vaxzine<br />
    13. 13. TurboBoost your development performance<br />13<br />R-mode Sees Forest; L-mode Sees TreesWe need to see both trees and forest => Let both sides of your brain work hard.<br />
    14. 14. R-mod is unpredictable, so prepare for it<br />TurboBoost your development performance<br />14<br />“Capture 24/7”, every where<br />Uses <br />Pen and notepad<br />Index cards<br />PDA/Smartphone<br />Voice Memo<br />Laptop/Notebook/Netbook/Tablet PC<br />
    15. 15. Metaphor<br />TurboBoost your development performance<br />15<br /> “Metaphors are a way of internalizing and abstractingconcepts, allowing one's thinking to be on a higher plane and low-level mistakes to be avoided.”<br />Fernando J. Corbató<br />Use metaphor as the meeting place between L-mode and R-mode.<br />
    16. 16. Time Boxing Your Learning<br />TurboBoost your development performance<br />16<br />Time boxing— hard deadline for an activity that cannot be extended.<br />A time box forces you to make the hard choices<br />A time box keeps you moving.<br />Sharks have to keep swimming, or they die. Learning is the same.<br />
    17. 17. “No plan survives contact with the enemy.”<br />Helmuth von Moltke<br />TurboBoost your development performance<br />17<br />Deliver What Customers Want<br />
    18. 18. Let Customers Make Decisions<br />TurboBoost your development performance<br />18<br />Developers, managers, or business analysts shouldn’t make business-critical decisions.<br />Decide what you shouldn’t decide. Don’t make any assumption.<br />Don’t bug busy businesspeople with trivial low-level details.<br />“I don’t know” is a perfectly acceptable answer from a business owner.<br />Use of User Stories<br />
    19. 19. Keep it releasable in increment<br />TurboBoost your development performance<br />19<br />Use version control for sharing code and builds<br />This helps you integrate early and often<br />Tools: SVN, CVS, Git<br />Commit “potentially shippable code” to contribute the “potentially shippable product” at the end of sprint.<br />Automate build and deployment early<br />Preparing scripts, manuals, settings etc.<br />Tools: Ant, Maven<br />
    20. 20. Issue Tracking<br />TurboBoost your development performance<br />20<br />As the project progresses, you’ll get a lot of feedback including<br /> corrections, <br />suggestions, <br />change requests, <br />feature enhancement, <br />bug fixes, etc. <br />Log all issues into a good tracking system<br />Hints: Redmine, Google Code,, etc.<br />
    21. 21. TurboBoost your development performance<br />21<br />Open Question<br />Do we need estimation?<br />
    22. 22. TurboBoost your development performance<br />22<br />Agile Feedback<br />
    23. 23. Where feedbacks come from?<br />TurboBoost your development performance<br />23<br />From the System<br />Using testing, coding<br />From the Users<br />During requirement discussion, demo, sprint review<br />From the Team<br />During code, test, design and “chit chat”<br />
    24. 24. Unit Testing<br />TurboBoost your development performance<br />24<br />Unit testing<br />provides instant feedback<br />makes your code robust<br />can be a helpful design tool<br />is a confidence booster<br />Unit tests <br />can act as probes when solving problems are reliable documentation<br />are a learning aid<br />Tools: Junit, NUnit, HttpUnit, etc.<br />Write tests before writing code (TDD)<br />
    25. 25. Best Practices from Scrum<br />TurboBoost your development performance<br />25<br />Feedback are gathers before, during and after the sprint begins:<br />Sprintplanning => feedback from the customers, about requirement<br />DailyScrum => feedback from the team<br />Sprintreview => feedback from the customer, about the product<br />
    26. 26. Listen to the users<br />TurboBoost your development performance<br />26<br />Let them do acceptance testing<br />“It’s a bug” : Every complaint holds a truth.<br />=> There is no such thing called a stupid user.<br />
    27. 27. Quality code for productivity<br />TurboBoost your development performance<br />27<br />Agile Coding<br />
    28. 28. Dreyfus Model<br />Levels of Expertise<br />TurboBoost your development performance<br />You are neither “expert” nor “novice” at all things; rather, you are at one of these stages in some particular skill domain<br />Expert<br />Proficient<br />Competent<br />Advanced Beginner<br />Novice<br />28<br />From Journeyman to Master<br />
    29. 29. Pair Programming<br />TurboBoost your development performance<br />29<br />A pair of developers shares a problem, a computer, a keyboard and a goal: solve the problem<br />PP was defined in XP<br />Utilize the R-mode activities<br />Improve communication and effectiveness<br />Improve software quality<br />Widely ADOPTED, but still CONTROVERSAL!<br />2 roles: Driverand Navigator:<br />The Driver doesn’t see the big picture<br />The Driver should “step a way from the keyboard”<br />The Navigator tends to use pattern-matching problem solving technique<br />
    30. 30. Program Intently and Expressively<br />TurboBoost your development performance<br />30<br />Code should provide high-level of: <br />readability and <br />understandability.<br />public void MakeCoffee()<br />{<br />lock(this)<br />{<br />// ... operation<br />}<br />}<br />private object makeCoffeeLock = new object();<br />public void MakeCoffee()<br />{<br />lock(makeCoffeeLock)<br />{<br />// ... operation<br />}<br />}<br />
    31. 31. Communication in Code<br />TurboBoost your development performance<br />31<br />Use standard comments for communication, avoid misunderstanding and create “developer manual” <br />Document code using wellchosen, meaningful names.<br />Use comments to describe its purpose and constraints.<br />BUT Don’t use commenting as a substitute for good code.<br />Use tools for help: RDoc, javadoc, and ndoc, IDEs<br />
    32. 32. Trade-off and Simplicity<br />TurboBoost your development performance<br />32<br />“There is no best solution”<br />Code in Increments, not a “big bang”<br />Use of TODO + skeleton before code<br />Keep It Simple, but not simplistic<br />Write High-Cohesive, Low-Coupled Code<br />Efficient Use of Design Patterns<br />
    33. 33. Design Patterns<br />TurboBoost your development performance<br />33<br />Design Patterns is a modern classic in the literature of object-oriented development, offering timeless and elegantsolutions to common problems in software design. <br />Utilize design principles and best practices for better design<br />Create “vocabulary” for team communication<br />Keep GoF’s and JavaEE’s DP in your “thinking toolbox”<br />
    34. 34. What do you see in this piece of code?<br />/**<br />* This is a singleton class.<br />* Used for logging action to the std out.<br />* Example: Logger.getInstance().log(“foo”);<br />*/<br />public class Logger{<br /> private static Logger instance;<br /> private Logger(){}<br /> public static getInstance(){<br /> if(instance!=null){<br /> return instance;<br /> } <br /> else{<br /> instance = new Logger();<br /> }<br /> }<br /> public void log( String message){<br />System.out.println(message);<br /> }<br />}<br />34<br />TurboBoost your development performance<br />
    35. 35. Refactoring<br />TurboBoost your development performance<br />35<br />You practice “code a bit, fix a little” => result in dirty code & bad design.<br />Refactoring helps in restructure or design your code to make it better. But what does “better” means?<br />Keep in mind:<br />Maintainability<br />Extensibility<br />High Cohesion<br />Low Coupling<br />
    36. 36. Refactoring Techniques<br />TurboBoost your development performance<br />36<br />for abstraction<br />Encapsulate Field<br />Generalize Type<br />Replace type-checking code with State/Strategy<br />Replace conditional with polymorphism<br />for breaking code apart<br />Extract Method, turn part of a larger method into a new method<br />Extract Class<br />for improving code standard<br />Move Method or Move Field<br />Rename Method or Rename Field<br />Pull Up, move to a superclass <br />Push Down, move to a subclass<br />
    37. 37. How do you face with mistakes?<br />TurboBoost your development performance<br />37<br />Agile Debugging<br />
    38. 38. There is no bug-free software!<br />TurboBoost your development performance<br />38<br />Keep a solutions log<br />Don’t get burned twice<br />Use custom DB, or issue tracker<br />Warnings are really errors<br />Attack problems in isolation<br />Report all exceptions<br /><ul><li>Report as issues too!</li></ul>Provide useful error messages<br />
    39. 39. TurboBoost your development performance<br />39<br />Agile Collaboration<br />
    40. 40. Meetings<br />TurboBoost your development performance<br />40<br />Planning<br />Objective oriented<br />Review<br />Product|Release review : formal<br />Technical review (code, design): informal<br />Attack and Defense<br />Design, algorithm, code review<br />Tracking<br />Daily meeting<br />Stand up meeting<br />Retrospection<br />Training|Seminar|Composium|Pilot<br />
    41. 41. Keep the meeting focused<br />TurboBoost your development performance<br />41<br />Ask 3 questions:<br />What did I achieve yesterday?<br />What am I planning to do today?<br />What’ s in my way?<br />Or What impeded me from doing good job?<br />Use time box<br />
    42. 42. Stand-up Meeting Benefits<br />TurboBoost your development performance<br />42<br />kick off the day ahead in a focused way<br />bring the issue out into the open and actively seek help<br />determine areas that may need additional hands<br />make team members aware of what’s going on <br />identify redundancy or areas<br />facilitating the sharing of code and ideas<br />encourage forward momentum<br />
    43. 43. Collaborative Coding <br />TurboBoost your development performance<br />43<br />Architects Must Write Code<br />Don’t let anyone design in isolation<br />Practice collective ownership correctly<br />Share Code Only When Ready<br />Developers should be a Mentor<br />Knowledge grows when given<br />Don’t let others smell your code<br />
    44. 44. Code Review<br />TurboBoost your development performance<br />44<br />Formal code inspections are very efficient in finding problems<br />It works in “bug-prevention” mode<br />Styles:<br />The all-nighter<br />The pick-up game<br />Pair programming<br />Receipt:<br />Can you read and understand the code?<br />Are there any obvious errors?<br />Will the code have any undesirable effect on other parts of the<br />application?<br />Is there any duplication of code (within this section of code itself or with other parts of the system)?<br />Are there any reasonable improvements or refactorings that can improve it?<br />
    45. 45. Self-organization and Self-management<br />TurboBoost your development performance<br />45<br />In Scrum, developers in Scrum Team manage themselves. <br />This helps in:<br />Encouraging transfer and share of ideas, status, problems<br />Seeking problems as soon as possible<br />Avoiding conflicts and problems<br />Working collectively.<br />Image courtesy to<br />
    46. 46. Communication tools<br />TurboBoost your development performance<br />46<br />Whiteboard<br />Sticky note<br />Email<br />Version control <br />Wiki<br />Blog<br />Task management tools<br />Issue trackers<br />
    47. 47. How can you kaizen?<br />TurboBoost your development performance<br />47<br />Improve Expertise and Productivity Continuously<br />
    48. 48. TurboBoost your development performance<br />48<br />to conclude … <br />
    49. 49. 10,000 HOURS<br />Malcolm Gladwell writes in Outliers that people at the very top don’t work harder than everyone else. They work much, much harder. In fact, Gladwell quotes neuroscientists who believe that 10,000 hours of practice is required to become world class at a particular skill--whether it’s surgery, shooting baskets, or public speaking. <br />
    50. 50. References and Further Readings<br />TurboBoost your development performance<br />50<br />Code Complete 2ndEdn., by Steve McConnell<br />Practices of an Agile Developer - Working in the Real World by VenkatSubramaniam and Andy Hunt.<br />Pragmatic Thinking and Learning – Refactor your wetware by Andy Hunt.<br />