development strategic test-driven · test driven development. how can development be driven by...

59
Strategic Test-driven Development join at Slido.com with #testcon2019

Upload: others

Post on 02-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Strategic Test-driven Development

join at Slido.com with #testcon2019

Page 2: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Francesco Strazzullo (AKA Strazz)

@TheStrazz86

(Follow me on Twitter!)

Ego Slide

Page 3: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green
Page 4: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

What is Test-driven Development?

Page 5: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green
Page 6: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green
Page 7: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Write a failing test

Write code to pass that test

Refactor keeping the test green

Page 8: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green
Page 9: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green
Page 10: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green
Page 11: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Test Driven Development

Page 12: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

How can Development be driven by Tests?

Page 13: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Write a failing test

Write code to pass that test

Refactor keeping the test green

Page 14: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

A Big Decision is hidden in plain sight

Page 15: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

What is the next test to write?

Page 16: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

“Software development is a learning process, working code is a side effect. If that’s true… how can we maximize learning?”

Alberto Brandolini

Page 17: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Write the test that lets you learn the most about the

problem

Page 18: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Write the test that lets you reach your goal as fast as

possible

Page 19: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Write a test that lets you

approach the goal

Write code to pass that test

Refactor keeping the test green

Page 20: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Another Big Decision is hidden in plain sight

Page 21: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Write just the code that you need to pass the new test

Page 22: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Write a test that lets you

approach the goal

Write just the code needed to

pass that test

Refactor keeping the test green

Page 23: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Your Design emerges from tests

Page 24: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

TDD is a goal oriented decision-making tool based on tests

Page 25: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Test Driven Development

Page 26: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

What is a Test?

Page 27: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

“Tests are just one form of feedback”

Kent Beck

Page 28: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Feedback Driven Development

Page 29: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Define a feedback that lets you

approach the goal

Build something “small”

Validate your code with “fast” feedbacks

Page 30: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

TDD is a goal oriented decision-making tool based on feedbacks

Page 31: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green
Page 32: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Goal Small Outcome

Feedback

Page 33: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

What kind of decisions can you make with TDD?

Page 34: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Strategic long term decisions

Tactical put strategy into action

Operational made daily

Page 35: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

How to use TDD “mindset” for Tactical or Strategic

Decisions?

Page 36: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Choosing the next feature

Page 37: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Impact Mapping

Page 39: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Choose the impact that you believe

will help the most to reach the goal

Build a small deliverable

Use Metrics to validate your assumptions

Page 40: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Software Architecture

Page 41: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

What is the goal of Software Architecture?

Page 42: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Non-functional Requirements

Page 43: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

“A non-functional requirement (NFR) is a requirement that specifies criteria that can

be used to judge the operation of a system, rather than specific behaviors.”

Wikipedia

Page 44: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

accessibility accountability accuracy adaptability reliability

administrability affordability agility auditability responsiveness

autonomy availability compatibility composability seamlessness

configurability correctness credibility customizability simplicity

debugability self-sustainability robustness dependability sustainability

deployability determinability discoverability distributability usability

durability effectiveness efficiency extensibility repeatability

fault tolerance fidelity flexibility inspectability reusability

reproducibility integrity interoperability learnability securability

maintainability manageability mobility modifiability stability

modularity operability evolvability performances tailorability

portability precision predictability resilience transparency

producibility safety recoverability relevance testability

Page 45: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

What are the feedback for Software Architecture?

Page 46: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Fitness Functions

Page 47: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

What is a “small outcome” for Software Architecture?

Page 48: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Walking Skeleton

Page 49: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

“A Walking Skeleton is a tiny implementation of the system that performs a small end-to-end function. It need not use the final architecture, but it should link together the main architectural components. The architecture and the functionality can then evolve in parallel.”

Alistair Cockburn

Page 50: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Define a set of NFRs to check

with fitness functions

Build a “walking skeleton”

Evolve architecture with fitness functions

Page 51: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

We should build this software?

Page 52: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

What kind of feedback do we need?

Page 53: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

User Research

Page 54: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Define your idea Small Outcome

Use User Feedbacks to validate your idea

Page 55: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Strategic OperationalTactical

Page 56: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Goal Small Outcome

Feedback

Page 57: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

In a nutshell...

Page 58: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Learn the rules of the tool

Find the principles that are hidden in the tool

Explore interrelationships between tools

Page 59: Development Strategic Test-driven · Test Driven Development. How can Development be driven by Tests? Write a failing test Write code to pass that test Refactor keeping the test green

Thanks!

Francesco Strazzullo

[email protected]