Software Craftsmanship

18
© 2004 Capgemini - All rights reserved Professional Software Craftsmanship 2011-10-13 Andreas Enbohm Twitter: enbohm

description

A presentation about Software Craftsmanship. Inspired by 'Uncle Bob' and his books.

Transcript of Software Craftsmanship

Page 1: Software Craftsmanship

© 2004 Capgemini - All rights reserved

Professional Software Craftsmanship

2011-10-13

Andreas Enbohm

Twitter: enbohm

Page 2: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

The Clean Coder by @unclebobmartin

Sida 2

Page 3: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023Sida 3

Craftsmanship

”A software craftman is a experienced professional who quickly, but without rushing, provides resonable estimates and meets

commitments. A person which brings to mind skill, competence and quality. A craftman knows when to say no, but tries hard to

say yes. [Software] Craftmanship is the mindset held by craftsmen.”

Page 4: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Professionalism

Professional vs. Nonprofessional

It’s all about taking responsibility!

First, do no harm!- you must NOT create bugs! - but thats virtually impossible

All means to create bug free code- QA should find nothing- if they do, learn from it to prevent it from happend again

Sida 4

Page 5: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Professionalism

How do you know your code works?

Easy;- test- test again- test it up- test it down- test ALL of it- automated test suites- test upside down- test inside out- test left to right- TEST DRIVE IT!

Sida 5

Page 6: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Professionalism

Sida 6

Boy Scout Ruleor

Merciless Refactoring

Page 7: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Professionalism

Work ethics- 40/20 h week- read blogs, tweets, conferences, try languages…

Know your field!- Nassi-Schneiderman charts- Mealy and Moore state machines- Quicksort without looking it up- Parnas tables- Tramp data- Jackson Structured Programming

Sida 7

Page 8: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Professionalism

Practice!- Code Katas

Mentoring!

Know your domain!- no need to be expert- unprofessional to ’just code’

Sida 8

Page 9: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Saying No

”Do; or do not. There is no try”

Sida 9

Page 10: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Saying No

Never say ”I’ll try” - others will interpret as ”Yes”- avoid (unprofessional) pleasant conversation - but what would the world be if we didn’t try things?

Try == to apply extra effort- if there is extra effort, why hasn’t the team applied it before?- have you/team been holding effort in reserve?- by trying, the previous plans you made are insufficient- what behavior will you change by ’trying’?

Cut the scope! Negotiate – but never try!

Sida 10

Page 11: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Handling Pressure

Sida 11

Page 12: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Handling Pressure

Overtime if, and only if, 1) you can personally afford it 2) it is short term 3) you boss has a fallback plan

3) is a deal breaker- if your boss don’t have a backup plan, you should not agree on overtime

Sida 12

Page 13: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Handling Pressure

Stayin clean- dirty code ALWAYS means slow!- a professional NEVER tolerate messes

Trust your disciplines!- follow them at ALL times. Best way to avoid crisis- practive them even harder (more tests, smaller methods..)

You won’t go faster without test

You won’t go faster without refactoring

You won’t go faster without running full regressions test

But it’s tempting for a novice…

Sida 13

Page 14: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Handling Pressure

Commitments- do not accept unrealistic commitments (never ’try’)- commit ONLY when you are certain

Don’t panic- eat, sleep well- pair programming / ask for help

Sida 14

Page 15: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Time Estimates

Affinity Estimation

Wideband Delphi

Flying Fingers

Planning Poker

PERT- a way to convert estimates to probability distributions suitable for managers

Sida 15

Page 16: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Time Estimates

Program Evaluation and Review Technique- US Navy’s Polaris Submarine project (1957)

Three number for each task- Optimistic (wildly)- Normal- Pessimistic (wildly)

µ = (O + 4N + P) / 6, where µ is expected duration (’väntevärde’)

σ = (P – O) / 6, where σ is the standard deviation

Sida 16

Page 17: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

PERT

Task Optimistic Normal Pessimistic µ σ

Task 1 1 3 12 4.2 1.8

Task 2 1 1.5 14 3.5 2.2

Sida 17

Page 18: Software Craftsmanship

© 2009 Capgemini - All rights reserved12 april 2023

Clean Coder

Questions?

http://slideshare.net/enbohm

http://codekata.pragprog.com/

Sida 18