David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team...

24
3/28/2016 1 1 Take Your Software Beyond Legacy Code Welcome. Thank you! http://ToBeAgile.com [email protected] © Copyright 2012-2016 To Be Agile DB20160328 http://BeyondLegacyCode.com 2 David Scott Bernstein Software developer since 1980 Trained 8,000 developers since 1990 Published author since 2015 Website: http://ToBeAgile.com

Transcript of David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team...

Page 1: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

1

1

Take Your Software Beyond Legacy Code

Welcome.Thank you!

http://[email protected]

© Copyright 2012-2016 To Be Agile DB20160328

http://BeyondLegacyCode.com

2

David Scott Bernstein

Software developer since 1980

Trained 8,000 developers since 1990

Published author since 2015

Website: http://ToBeAgile.com

Page 2: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

2

3

Nine Essential Practices

1. Say What, Why, and for Whom before How: With a Product Owner defining the next mostimportant features to build, the need for upfront requirements goes away.

2. Build in Small Batches: Building incrementally increases feedback, helps simplify theconstruction of complex systems, and reduces risks.

3. Integrate Continuously: Sets up the infrastructure for incremental development.

4. Collaborate: Spiking, pairing, and swarming as a team to solve problems and radiateknowledge throughout an organization.

5. Create CLEAN Code: Share standards and practices for building software with code qualitiesthat support testability.

6. Write the Test First: Drops the cost of building and maintaining software dramatically.

7. Specify Behaviors with Tests: Uses tests to define and document behaviors.

8. Implement the Design Last: Paying technical debt can pay back dividends in the short term aswell as the long term.

9. Refactor Legacy Code: Incorporate learning and pay off technical debt.

Integrate Continuously

Practice 3

Page 3: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

3

The Heartbeat of a Project

Three Kinds of Done

Page 4: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

4

Continuous Deployability

Automate the Build

Page 5: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

5

Integrate Early and Often

Take the First Step

Page 6: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

6

Collaborate

Practice 4

Extreme Programming

Page 7: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

7

Communicate and Collaborate

Pair Program

Page 8: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

8

Buddy Program

Spike, Swarm, and Mob

Page 9: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

9

Time Box Unknowns

Code Reviews, Retrospectives

Page 10: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

10

Amplify Learning

Be Mentoring and Mentored

Page 11: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

11

Create CLEAN Code

We can infer good development principles andpractices through five key code qualities:

CohesiveLoosely CoupledEncapsulatedAssertiveNonredundant

Practice 5

Quality Code is Cohesive

Page 12: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

12

Quality Code is Loosely Coupled

Quality Code is Encapsulated

Page 13: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

13

Quality Code is Assertive

Quality Code is Non-Redundant

Page 14: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

14

Code Qualities Guide Us

Increase Quality Today…

Page 15: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

15

Write the Test First

Practice 6

The Things We Call Tests

Page 16: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

16

Quality Assurance

Write Good Tests

Page 17: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

17

TDD Gives Rapid Feedback

TDD Supports Refactoring

Page 18: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

18

Write Testable Code

TDD Can Fail

Page 19: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

19

Introducing TDD to a Team

Become Test Infected

“Warning:Promiscuouspairing can leadto becoming testinfected.”

Page 20: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

20

Refactor Legacy Code

Practice 9

Investment or Debt?

Page 21: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

21

Become a “Deadbeat”

When Code Needs to Change

Page 22: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

22

Refactoring Techniques

Refactor to Accommodate Change

Page 23: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

23

Refactor to the Open-Closed

Refactor to Support Changeability

Page 24: David Scott Bernstein...WriteTestable Code TDD Can Fail 3/28/2016 19 Introducing TDD to a Team Become Test Infected “Warning: Promiscuous pairing can lead to becoming test infected.”

3/28/2016

24

Do it Right the Second Time

48

Thank You!

We have just scratched the surface, to learn more:

– Read my blog: http://ToBeAgile.com/blog

– Sign up for my newsletter: http://ToBeAgile.com/signup

– Follow me on Twitter (@ToBeAgile)

– Read my book:

– Beyond Legacy Code: Nine Practices to Extend the Life (and Value) ofYour Software (available from http://BeyondLegacyCode.com)

– Attend my one of my Certified Scrum Developer trainings

– See http://ToBeAgile.com/training for my public class schedule

– Or contact me to arrange a private class for your organization

– Visit http://ToBeAgile.com for more information