10 ways to get your project started right

73
10 Ways to Get Your Project Started Right Benjamin Day

Upload: helena

Post on 12-Feb-2016

37 views

Category:

Documents


0 download

DESCRIPTION

10 Ways to Get Your Project Started Right. Benjamin Day. Benjamin Day. Consultant, Coach, Trainer Scrum.org Classes Professional Scrum Developer (PSD) Professional Scrum Foundations (PSF) TechEd , VSLive , DevTeach , O’Reilly OSCON Visual Studio Magazine, Redmond Developer News - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 10 Ways to Get Your Project Started Right

10 Ways to Get Your Project Started Right

Benjamin Day

Page 2: 10 Ways to Get Your Project Started Right

Benjamin Day• Consultant, Coach, Trainer• Scrum.org Classes

– Professional Scrum Developer (PSD)– Professional Scrum Foundations (PSF)

• TechEd, VSLive, DevTeach, O’Reilly OSCON• Visual Studio Magazine, Redmond Developer News• Microsoft MVP for Visual Studio ALM• Team Foundation Server, TDD, Testing Best Practices,

Silverlight, Windows Azure• www.benday.com/blog• [email protected]

Page 3: 10 Ways to Get Your Project Started Right

© 1993-2011 Scrum.org, All Rights Reserved

Professional Scrum at Scrum.org

Professional Scrum

Product Owner

Professional Scrum Foundations

Professional Scrum Master

Professional Scrum

Developer.NET or Java

Product OwnersExecutives Scrum Masters

ArchitectsBusiness Analysts

DB SpecialistsDesigners

DevelopersTesters

Everyone

Page 4: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 5: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 6: 10 Ways to Get Your Project Started Right

#1Write down your

Definition of Done.

Page 7: 10 Ways to Get Your Project Started Right

Definition of Done (DoD) = Everything it takes to say something

iscompletely done.

Page 8: 10 Ways to Get Your Project Started Right

What is your DoD?• Closest thing to a “silver bullet” in Scrum

• Technical Debt will ruin you.

• Write it down.

• Review and discuss it regularly.

Page 9: 10 Ways to Get Your Project Started Right

Consider firing anyone who says “Done vs. Done Done”

Page 10: 10 Ways to Get Your Project Started Right

Sample DoD• Checked in to source control• Compiled as part of an automated build• Unit tested with >75% code coverage• Automated build output is tested by

someone who didn’t write the code• No P1 or P2 bugs• Automated deployment script• Code review

Page 11: 10 Ways to Get Your Project Started Right

Do not relax your DoD.

Page 12: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 13: 10 Ways to Get Your Project Started Right

!(Shared Development Database)

Page 14: 10 Ways to Get Your Project Started Right

Just say no.• Fuzzy version control

– “What’s in production?”– “Have we tested that?”

• Rots your brain– Bad unit tests– Bad application architecture– No automated builds.– Abysmal maintainability

• Everyone on top of each other

Page 15: 10 Ways to Get Your Project Started Right

http://tinyurl.com/bqextsa

Page 16: 10 Ways to Get Your Project Started Right

There’s no reason for it.

Page 17: 10 Ways to Get Your Project Started Right

Use the Visual Studio 2012Database Project.

Page 18: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 19: 10 Ways to Get Your Project Started Right

What is Test Driven Development?• Develop code with proof that it works

– Code that validates other code– Small chunks of “is it working?”

• Small chunks = Unit Tests• “Never write a single line of code unless

you have a failing automated test.”– Kent Beck, “Test-Driven Development”,

Addison-Wesley

Page 20: 10 Ways to Get Your Project Started Right

Why Use TDD?• High-quality code

– Fewer bugs– Bugs are easier to diagnose

• Encourages you to think about…– …what you’re building– …how you know you’re done– …how you know it works

• Less time in the debugger• Tests that say when something works

– Easier maintenance, refactoring– Self-documenting

Page 21: 10 Ways to Get Your Project Started Right

Maximize Your QA Staff• You shouldn’t need QA to tell you your code

doesn’t work• Unit tests minimize the pointless bugs

– “nothing happened” – “I got an error message” + stack trace– NullReferenceException

• QA should be checking for:– Stuff only a human can test– User Story / Product Backlog Item

• Bug assigned to you should add business value

Page 22: 10 Ways to Get Your Project Started Right

How would you test this?

Page 23: 10 Ways to Get Your Project Started Right

What is Design For Testability?• Build it so you can test it.

• How would you test this?

Do you have to take the plane up for a spin?

http://www.flickr.com/photos/ericejohnson/4427453880/

Page 24: 10 Ways to Get Your Project Started Right

Unit tests save huge amounts of time.

Page 25: 10 Ways to Get Your Project Started Right

Easier to QA.

Page 26: 10 Ways to Get Your Project Started Right

Easier to maintain.

Page 27: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI

to the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 28: 10 Ways to Get Your Project Started Right

User Interface (ASP.NET, XAML, WinForms, etc.)

Presentation (MVC / MVVM)

Domain Model / Service Layer

Repository / Data Access

The Relational Database (Tables, FKs, Views, Stored Proc's)

The layers in your app.

Page 29: 10 Ways to Get Your Project Started Right

User Interface (ASP.NET, XAML, WinForms, etc.)

Presentation (MVC / MVVM)

Domain Model / Service Layer

Repository / Data Access

The Relational Database (Tables, FKs, Views, Stored Proc's)

How people typically “architect” their app.

Page 30: 10 Ways to Get Your Project Started Right

What do you show your customer?

Page 31: 10 Ways to Get Your Project Started Right

If you’ve build n layers and they hate it…

Page 32: 10 Ways to Get Your Project Started Right

…are you really going to throw it away?

Page 33: 10 Ways to Get Your Project Started Right

Avoid BDUF.(Big design up-front.)

Page 34: 10 Ways to Get Your Project Started Right

YAGNI.(You ain’t gunna need it.)

Page 35: 10 Ways to Get Your Project Started Right

Emergent Architecture.• Build what you need.• It’s a spectrum.

SuicidalNon-Planning

Sanity &

Balance

BigDesign

Up-Front

Page 36: 10 Ways to Get Your Project Started Right

Iterate the UI with your customer.• Minimal to no implementation.

• Visual Studio 2012 PowerPoint Storyboarding

• If you have to write code…– Dependency Injection– Interface-driven programming– Mock implementations

Page 37: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 38: 10 Ways to Get Your Project Started Right

No one is as smart as you are.

Page 39: 10 Ways to Get Your Project Started Right

Favor understandability over

elegance.

Page 40: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 41: 10 Ways to Get Your Project Started Right

It’s a metaphysical *certainty* that you’ll have to change stuff.

Page 42: 10 Ways to Get Your Project Started Right

You *won’t* get your “requirements” right.

Page 43: 10 Ways to Get Your Project Started Right

Your customers *will*

change their minds.

Page 44: 10 Ways to Get Your Project Started Right

Accept that you’ll have to change.

Page 45: 10 Ways to Get Your Project Started Right

The Goal: Make refactoring painless.

Page 46: 10 Ways to Get Your Project Started Right

Loose coupling.• Code to interfaces.

• Use the Dependency Injection Pattern– (Pass dependencies in on the constructor.)– Consider an IoC Framework

• Use the Repository Pattern

• Remember Single Responsibility Principle

Page 47: 10 Ways to Get Your Project Started Right

Build for Testability• Unit test, unit test, unit test

• Unit test != Integration Test

• Test one layer at a time in isolation

• No database connections from a unit test

• Integration tests in a separate project– Keep yourself honest

Page 48: 10 Ways to Get Your Project Started Right

For the love of all things precious & beautiful…

Page 49: 10 Ways to Get Your Project Started Right

…DON’T USE A SHARED DEVELOPMENT DATABASE!!!!!!!!

Page 50: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 51: 10 Ways to Get Your Project Started Right

ORM• Object-Relational Mapper

• Entity Framework

• NHibernate

• LINQ-to-SQL

• (…and zillions of other ones)

Page 52: 10 Ways to Get Your Project Started Right

Identify your Aggregate Roots.

Page 53: 10 Ways to Get Your Project Started Right

Aggregates & Aggregate Roots“Domain-Driven Design”by Eric Evans

page 112

Page 54: 10 Ways to Get Your Project Started Right

Some definitions.• Aggregate

– “a cluster of associated objects that we treat as a unit for the purpose of data changes.”

• Aggregate Root– The object through which members of the aggregate

are accessed.– In a PKFK relationship, the root owns the PK

Page 55: 10 Ways to Get Your Project Started Right

Example from DDD• Car has an identity column, CarID

– CarID is the Primary Key

• Car has a collection of Tire objects– myCar.Tires– Tire objects have IDs, too.

• You’ll query Car objects by ID.• You’ll never access Tire objects except via

their Car.

• Car is the Aggregate Root.

Page 56: 10 Ways to Get Your Project Started Right

If Car is the Aggregate Root…• You only have to support query operations

off of Car

• Less to write

• Less to test

• Is that ORM really buying you anything?

Page 57: 10 Ways to Get Your Project Started Right

http://tinyurl.com/ln248h

Page 58: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 59: 10 Ways to Get Your Project Started Right

Eliminate the "works on my box" problem *early*. • Set up automated builds from the very

beginning.

• If you're using TFS, use Gated Check-in builds

• Deploy your database as part of your builds.

• Run your unit tests from the builds

Page 60: 10 Ways to Get Your Project Started Right

http://tinyurl.com/d7f3lh5

Page 61: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 62: 10 Ways to Get Your Project Started Right

Minimize work in progress.

Page 63: 10 Ways to Get Your Project Started Right

Put another way…don’t try to do everything at once.

Page 64: 10 Ways to Get Your Project Started Right

If everyone on your team is working on

separate PBIs, is the team really a team?

Page 65: 10 Ways to Get Your Project Started Right

Finish one thing. Then do the next thing.• Try to craft the work so that multiple

people are working on related things

• Complete that thing. Move on to the next thing.

• Try to drive stuff to DoD early.

Page 66: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 67: 10 Ways to Get Your Project Started Right

Be humble.Be honest.

Be transparent.

Page 68: 10 Ways to Get Your Project Started Right

Do yourself a favor and say“forecast” rather than “commitment”

Page 69: 10 Ways to Get Your Project Started Right

Use Team Foundation Server & Scrum• Create a Product Backlog of 2 – 3 months

of work– Estimate using Planning Poker & Story Points

• Establish a Velocity

• Update remaining hours on Tasks daily

• Use the Burndown Chart

Page 70: 10 Ways to Get Your Project Started Right

Advertise data from TFS.Make data-driven predictions.

Page 71: 10 Ways to Get Your Project Started Right

Once you’ve lost credibility, you’ll lose good will.

You’ll always be behind from then on.

Page 72: 10 Ways to Get Your Project Started Right

Top 10 Ways1. Write down your

Definition of Done.2. Don't use a shared

development database.

3. Write unit tests. 4. Design from the UI to

the database.5. Keep it simple.

6. Assume everything will change.

7. Ask yourself if you really need that ORM.

8. Create an automated build on day #1.

9. Do less.10. Be humble and honest.

Page 73: 10 Ways to Get Your Project Started Right

Thank you.

www.benday.com | [email protected]