practices of agile developers

34
SESSION 2 PRACTICES OF AGILE DEVELOPERS AgileDev Tour Duong Trong Tan [email protected] Hanoi, December 2010

Upload: duong-tan

Post on 21-Jan-2015

1.433 views

Category:

Education


4 download

DESCRIPTION

Agile learning, coding, debugging & collaboration.

TRANSCRIPT

Page 1: Practices of agile developers

SESSION 2 PRACTICES OF AGILE DEVELOPERS

AgileDev Tour

Duong Trong [email protected]

Hanoi, December 2010

Page 2: Practices of agile developers

TurboBoost your development performance

2

Objectives

Beginning agilityFeeding agilityDeliver what customers wantAgile feedbackAgile codingAgile debuggingAgile collaborationImprovement of individual expertise and

productivity

Page 3: Practices of agile developers

TurboBoost your development performance

3

Keep it releasable in increment

Use version control for sharing code and builds This helps you integrate early and often Tools: SVN, CVS, Git

Commit “potentially shippable code” to contribute the “potentially shippable product” at the end of sprint.

Automate build and deployment early Preparing scripts, manuals, settings etc. Tools: Ant, Maven

Page 4: Practices of agile developers

TurboBoost your development performance

4

Issue Tracking

As the project progresses, you’ll get a lot of feedback including corrections, suggestions, change requests, feature enhancement, bug fixes, etc.

Log all issues into a good tracking system Hints: Redmine, Google Code, Assembla.com, etc.

Page 5: Practices of agile developers

TurboBoost your development performance 5

Open Question

Do we need estimation?

Page 6: Practices of agile developers

TurboBoost your development performance

6

SOURCES FOR ADAPTION

Agile Feedback

Page 7: Practices of agile developers

TurboBoost your development performance

7

Where feedbacks come from?

From the System Using testing, coding

From the Users During requirement discussion, demo,

sprint review

From the Team During code, test, design and “chit chat”

Page 8: Practices of agile developers

TurboBoost your development performance

8

Unit Testing

Unit testing provides instant feedback makes your code robust can be a helpful design tool is a confidence booster

Unit tests can act as probes when solving problems are

reliable documentation are a learning aid

Tools: Junit, NUnit, HttpUnit, etc.Write tests before writing code (TDD)

Page 9: Practices of agile developers

TurboBoost your development performance

9

Best Practices from Scrum

Feedbacks are gathered before, during and after the sprint:Sprint planning => feedback from the

customers, about requirementDaily Scrum => feedback from the teamSprint review => feedback from the

customer, about the product

Page 10: Practices of agile developers

10

Listen to the users

TurboBoost your development performance

Let them do acceptance testing

“It’s a bug” : Every complaint holds a truth.

=> There is no such thing called a stupid user.

Page 11: Practices of agile developers

TurboBoost your development performance

11

QUALITY CODE FOR PRODUCTIVITY

Agile Coding

Page 12: Practices of agile developers

TurboBoost your development performance

12

Dreyfus Model Levels of Expertise

You are neither “expert” nor “novice” at all things; rather, you are at one of these stages in some particular skill domain

ExpertProficientCompetentAdvanced

BeginnerNovice

From Journeyman to Master

Page 13: Practices of agile developers

TurboBoost your development performance

13

Pair Programming

A pair of developers shares a problem, a computer, a keyboard and a goal: solve the problem

PP was defined in XPUtilize the R-mode

activitiesImprove communication

and effectivenessImprove software qualityWidely ADOPTED, but

still CONTROVERSAL!

2 roles: Driver and

Navigator: The Driver doesn’t see

the big picture The Driver should “step

a way from the keyboard”

The Navigator tends to use pattern-matching problem solving technique

Page 14: Practices of agile developers

TurboBoost your development performance

14

Program Intently and Expressively

Code should provide high-level of: readability and understandability.

public void MakeCoffee(){

lock(this){// ... operation}

}

private object makeCoffeeLock = new object();

public void MakeCoffee(){

lock(makeCoffeeLock){// ... operation}

}

Page 15: Practices of agile developers

TurboBoost your development performance

15

Communication in Code

Use standard comments for communication, avoid misunderstanding and create “developer manual”

Document code using well chosen, meaningful names.

Use comments to describe its purpose and constraints.

BUT Don’t use commenting as a substitute for good code.

Use tools for help: RDoc, javadoc, and ndoc, IDEs

Page 16: Practices of agile developers

TurboBoost your development performance

16

Trade-off and Simplicity

“There is no best solution”Code in Increments, not a “big bang”

Use of TODO + skeleton before codeKeep It Simple, but not simplisticWrite High-Cohesive, Low-Coupled Code

Efficient Use of Design Patterns

Page 17: Practices of agile developers

TurboBoost your development performance

17

Design Patterns

Design Patterns is a modern classic in the literature of object-oriented development, offering timeless and elegant solutions to common problems in software design.

Utilize design principles and best practices for better design

Create “vocabulary” for team communicationKeep GoF’s and JavaEE’s DP in your

“thinking toolbox”

Page 18: Practices of agile developers

18

TurboBoost your development performance

What do you see in this piece of code?

/*** This is a singleton class.* Used for logging action to the std out.* Example: Logger.getInstance().log(“foo”);*/public class Logger{

private static Logger instance;private Logger(){}public static getInstance(){

if(instance!=null){return instance;

} else{

instance = new Logger();}

}public void log( String message){

System.out.println(message);}

}

Page 19: Practices of agile developers

TurboBoost your development performance

19

Refactoring

You practice “code a bit, fix a little” => result in dirty code & bad design.

Refactoring helps in restructure or design your code to make it better. But what does “better” mean?

Keep in mind: Maintainability Extensibility High Cohesion Low Coupling

Page 20: Practices of agile developers

TurboBoost your development performance

20

Refactoring Techniques

for abstraction Encapsulate Field Generalize Type Replace type-checking code with State/Strategy Replace conditional with polymorphism

for breaking code apart Extract Method, turn part of a larger method into a new method Extract Class

for improving code standard Move Method or Move Field Rename Method or Rename Field Pull Up, move to a superclass Push Down, move to a subclass

Page 21: Practices of agile developers

TurboBoost your development performance

21

HOW DO YOU FACE WITH MISTAKES?

Agile Debugging

Page 22: Practices of agile developers

TurboBoost your development performance

22

There is no bug-free software!

Keep a solutions log Don’t get burned twice Use custom DB, or issue tracker

Warnings are really errorsAttack problems in isolationReport all exceptions

Report as issues too!

Provide useful error messages

Page 23: Practices of agile developers

TurboBoost your development performance

23

Agile Collaboration

Page 24: Practices of agile developers

TurboBoost your development performance

24

Meetings

Planning Objective oriented

Review Product|Release review : formal Technical review (code, design): informal

Attack and Defense Design, algorithm, code review

Tracking Daily meeting Stand up meeting

RetrospectionTraining|Seminar|Composium|Pilot

Page 25: Practices of agile developers

TurboBoost your development performance

25

Keep the meeting focused

Ask 3 questions:What did I achieve yesterday?What am I planning to do today?What’ s in my way?

Or What impeded me from doing good job?

Use time box

Page 26: Practices of agile developers

TurboBoost your development performance

26

Stand-up Meeting Benefits

kick off the day ahead in a focused waybring the issue out into the open and actively

seek helpdetermine areas that may need additional

handsmake team members aware of what’s going

onidentify redundancy or areasfacilitating the sharing of code and ideasencourage forward momentum

Page 27: Practices of agile developers

TurboBoost your development performance

27

Collaborative Coding

Architects Must Write CodeDon’t let anyone design in isolationPractice collective ownership correctlyShare Code Only When ReadyDevelopers should be a Mentor

Knowledge grows when givenDon’t let others smell your code

Page 28: Practices of agile developers

TurboBoost your development performance

28

Code Review

Formal code inspections are very efficient in finding problems

It works in “bug-prevention” mode

Styles: The all-nighter The pick-up game Pair programming

Receipt: Can you read and

understand the code? Are there any obvious

errors? Will the code have any

undesirable effect on other parts of the application?

Is there any duplication of code (within this section of code itself or with other parts of the system)?

Are there any reasonable improvements or refactorings that can improve it?

Page 29: Practices of agile developers

TurboBoost your development performance

29

Self-organization and Self-management

In Scrum, developers in Scrum Team manage themselves.

This helps in: Encouraging transfer and share of ideas, status,

problems Seeking problems as soon as possible Avoiding conflicts and problems Working collectively.

Image courtesy to http://www.richmondmontessori.ca

Page 30: Practices of agile developers

TurboBoost your development performance

30

Communication tools

WhiteboardSticky noteEmailVersion control WikiBlogTask management toolsIssue trackers

Page 31: Practices of agile developers

TurboBoost your development performance

31

HOW CAN YOU KAIZEN?

Improve Expertise and Productivity Continuously

Page 32: Practices of agile developers

TurboBoost your development performance 32

to conclude …

Page 33: Practices of agile developers

10,000 HOURS

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.

Page 34: Practices of agile developers

TurboBoost your development performance

34

References and Further Readings

Code Complete 2nd Edn., by Steve McConnell

Practices of an Agile Developer - Working in the Real World by Venkat Subramaniam and Andy Hunt.

Pragmatic Thinking and Learning – Refactor your wetware by Andy Hunt.