coderetreat in lille 06 05 2017

42
Code retreat www.mozaicworks.com

Upload: adi-bolboaca

Post on 29-Jan-2018

126 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Coderetreat in Lille 06 05 2017

Code retreat

www.mozaicworks.com

Page 2: Coderetreat in Lille 06 05 2017

Why

A talk by Adi Bolboacă

[email protected]

You

Start Using

Should

Why do we do Software?

Page 3: Coderetreat in Lille 06 05 2017

www.mozaicworks.com

Me

Adi BolboacaOrganizational & Technical

Trainer & Coach

Page 4: Coderetreat in Lille 06 05 2017

Why You

Start Using

Should

Page 5: Coderetreat in Lille 06 05 2017

Why You

Start Using

Should

Page 6: Coderetreat in Lille 06 05 2017

Why You

Start Using

Should

Page 7: Coderetreat in Lille 06 05 2017

Why You

Start Using

Should

Page 8: Coderetreat in Lille 06 05 2017

Why You

Start Using

Should

Page 9: Coderetreat in Lille 06 05 2017

Why You

Start Using

Should

Page 10: Coderetreat in Lille 06 05 2017

Why You

Start Using

Should

Page 11: Coderetreat in Lille 06 05 2017

Why You

Start Using

Should

Page 12: Coderetreat in Lille 06 05 2017

Code retreat

www.mozaicworks.com

Page 13: Coderetreat in Lille 06 05 2017

2009, First time outside US

Page 14: Coderetreat in Lille 06 05 2017

Why?

Learn through pairingExtend your comfort zone

PracticeExperiment

Learn new practices

www.mozaicworks.com

Page 15: Coderetreat in Lille 06 05 2017

How?

1 day of codingChoose a simple problem

6 pairing partnersOn average 135 minutes of coding

6 different constraintsA lot of fun!

www.mozaicworks.com

Page 16: Coderetreat in Lille 06 05 2017

Day structure

15' introduction3 sessions of 45' coding + 15' retro&break

1h lunch3 sessions of 45' coding + 15' retro&break

15' closing circle

www.mozaicworks.com

Page 17: Coderetreat in Lille 06 05 2017

Principles

Language agnosticDo not try to finish the problem

Delete the code after each sessionFocus on practicing

Experiment each sessionHave fun!

www.mozaicworks.com

Page 18: Coderetreat in Lille 06 05 2017

How to take advantage1. Embrace the freedom of deleting the code

2. Do what you always wanted but couldn't

3. Get out of your comfort zone

4. Pair with strangers in languages you don't know

5. What you learn is your responsibility

Page 19: Coderetreat in Lille 06 05 2017

Prerequisites

ComputerCoding environmentTesting framework

Source control (git, svn, etc)

www.mozaicworks.com

Page 20: Coderetreat in Lille 06 05 2017

Class Rules

Write codeDiscuss codePresentations

Important: There is no best solution. It depends.

You will receive slides on email

www.mozaicworks.com

Page 21: Coderetreat in Lille 06 05 2017

Today’s purposes

As discussed with your colleagues:

1. Write tests on your code2. Collaborate by pair-programming

3. The code looks like on person wrote it

www.mozaicworks.com

Page 22: Coderetreat in Lille 06 05 2017

What would you like to learn?

Use post-itsWrite one idea on post-it

When ready stick them on the flip-chart

Important: The list is always open

www.mozaicworks.com

Page 23: Coderetreat in Lille 06 05 2017

Conway's game of life

Having an infinite 2D orthogonal universeBeing given an initial generation called a seedThe following rules are applied simultaneously

A live cell having less than 2 live neighbors diesA live cell having 2 or 3 live neighbors lives A live cell having more than 3 neighbors diesA dead cell having 3 neighbors becomes alive

www.mozaicworks.com

Page 24: Coderetreat in Lille 06 05 2017

Session 1: Understand the problem

Find a pairChoose a programming language

Setup the environmentChoose an entry point for the problem

Understand the problemAdd any constraint if you want

www.mozaicworks.com

Page 25: Coderetreat in Lille 06 05 2017

Conway's game of life

Having an infinite 2D orthogonal universeBeing given an initial generation called a seedThe following rules are applied simultaneously

A live cell having less than 2 live neighbors diesA live cell having 2 or 3 live neighbors lives A live cell having more than 3 neighbors diesA dead cell having 3 neighbors becomes alive

www.mozaicworks.com

Page 26: Coderetreat in Lille 06 05 2017

RECAP Session 1

What did you learn?

What surprised you?

What would you start using?

www.mozaicworks.com

Page 27: Coderetreat in Lille 06 05 2017

Session 2: Test drive your code

How to test your code:

Test After Design, Code, Test→Test First Design, Test, Code→

Test Driven Test, Code, Design→

Each has its purpose and usageTest Driven is very hard to learn

www.mozaicworks.com

Page 28: Coderetreat in Lille 06 05 2017

Session 2: Test drive your code

Find a pair

Red Write the test method. The code compiles.→Green Write the → simplest code to make the

test passRefactor Look at duplication. Make the code →

look nicerImportant: Focus on testing

www.mozaicworks.com

Page 29: Coderetreat in Lille 06 05 2017

RECAP Session 2

What did you learn?

What surprised you?

What would you start using?

www.mozaicworks.com

Page 30: Coderetreat in Lille 06 05 2017

Code retreat

1 hour Lunch

www.mozaicworks.com

Page 31: Coderetreat in Lille 06 05 2017

Session 3:Domain Driven Design

Analyze your domain1. Brainstorm Domain Entities

2. Add relationships3. Add bounded contexts

4. Add constraints (eg. invariants)5. Review the model

6. Write a guiding test for a bounded context7. Write unit tests

Check Domain Modelling Kata http://mozaicworks.com/blog/domain-modeling-kata

www.mozaicworks.com

Page 32: Coderetreat in Lille 06 05 2017

RECAP Session 3

What did you learn?

What surprised you?

What would you start using?

www.mozaicworks.com

Page 33: Coderetreat in Lille 06 05 2017

Session 4:Ping-Pong Pair-Programming

Choose a pairOne person write a test

The other implements the production codeThe other writes a test

The first person implements the production codeGo back

Use TDD approach

www.mozaicworks.com

Page 34: Coderetreat in Lille 06 05 2017

RECAP Session 4

What did you learn?

What surprised you?

What would you start using?

www.mozaicworks.com

Page 35: Coderetreat in Lille 06 05 2017

Session 5: Taking Baby Steps1) Initialize source control repository2) Start a timer for 2 minutes3) Write exactly one testa) Timer rings, the test is red, then revert and go to 2)b) The test is green before the timer rings, then commit

4) Restart timer5) Refactora) Timer rings, the refactoring is not complete then revert and restart

b) The refactoring is complete before the timer rings, commit and go to 2)

Obs.The timers must run continuously, don't stop to talk! www.mozaicworks.com

Page 36: Coderetreat in Lille 06 05 2017

RECAP Session 5

What did you learn?

What surprised you?

What would you start using?

www.mozaicworks.com

Page 37: Coderetreat in Lille 06 05 2017

Session 6: Code Swap

Find a pair to swap the code withWrite the best code you can for 40 minutes.

After ~40 minutes, swap the code and make a code review

Focus on Clean Code, clear names, usable software design

When review-ing write comments in the code

www.mozaicworks.com

Page 38: Coderetreat in Lille 06 05 2017

RECAP Session 6

What did you learn?

What surprised you?

What would you start using?

www.mozaicworks.com

Page 39: Coderetreat in Lille 06 05 2017

Closing circle

1) How did you feel? 2) What did you learn today?

3) What will you do differently tomorrow?

www.mozaicworks.com

Page 40: Coderetreat in Lille 06 05 2017

Code retreatWhy?

Learn through pairingExtend your comfort zone

PracticeExperiment

Learn new practices

www.mozaicworks.com

Page 41: Coderetreat in Lille 06 05 2017

Contact me● Remote pair-programming● Unit testing workshop● Test driven development workshop● Clean code workshop● Refactoring workshop● Legacy code retreat● Working FAST and Safe with existing

code● Code retreat

www.mozaicworks.com

Page 42: Coderetreat in Lille 06 05 2017

Code retreatExtend your mentoring & training capacity

Accelerate learning through communities of practice

Grow your functional leaders and top talents

http://www.mozaicworks.com

[email protected]

@adibolb