java: tools & techniques for tdd

21
When I code I write tests

Upload: agileee

Post on 26-May-2015

2.641 views

Category:

Technology


2 download

DESCRIPTION

Slides from Szczepan Faber talking at Agileee conference 2009, Ukraine

TRANSCRIPT

Page 1: Java: tools & techniques for TDD

When I codeI write tests

Page 2: Java: tools & techniques for TDD

X-unit frameworks

Page 3: Java: tools & techniques for TDD
Page 4: Java: tools & techniques for TDD
Page 5: Java: tools & techniques for TDD

http://mockito.org

Page 6: Java: tools & techniques for TDD

substitues of real

objects...

...for testing

purposes

what are mocks?

Page 7: Java: tools & techniques for TDD

Szczepan Faber

Coach at Sabre Holdings

Krakow, Poland

Enough jokes, meet your bartender

Page 8: Java: tools & techniques for TDD

Java: Tools &

techniques for

TDD

Page 9: Java: tools & techniques for TDD

Who does it?

Page 10: Java: tools & techniques for TDD

Learning TDD

Page 11: Java: tools & techniques for TDD
Page 12: Java: tools & techniques for TDD

the student must first resign himself

and his ego to a seemingly random series of repetitious exercises

Yukiyoshi Takamura

Page 13: Java: tools & techniques for TDD

Shu Ha Ri

Page 14: Java: tools & techniques for TDD

Improving TDD

Page 15: Java: tools & techniques for TDD

Stop writing tests

Instead, describe the behavior

Or simply, write examples

http://behaviour-driven.org

Page 16: Java: tools & techniques for TDD

Enough slides.Start coding now...

Page 17: Java: tools & techniques for TDD
Page 18: Java: tools & techniques for TDD

Shu-Ha-Ri

Don’t write tests, write examples

Your takeaways I

Page 19: Java: tools & techniques for TDD

Mockito

Custom assertion with FEST

The ultimate test template

Your takeaways II

Page 20: Java: tools & techniques for TDD

The ultimate test template@Test

public void should...() throws Exception {

//given

...

//when

...

//then

...

}

Sapir-Whorf Theory

Page 21: Java: tools & techniques for TDD

Thanks for surviving the session!

Yummy. No hangover.

(Eastern Europeans only)

• Questions?

• Feedback?

• szczepiq (at) gmail.com