SlideShare una empresa de Scribd logo
1 de 21
Generation_P Consulting Ltd
Software Solutions for the Travel Industry




               TDD
        Make your life better




               Antanina Shafranskaya
     Antanina.Shafranskaya@generation_p.com
TDD: way to better life

 Test before code!
 TDD principals:
    think first


    trivial first


    test <=> what ; implementation <=> how


    different levels of tests



 red – green – refactor
     red: behavior (responsibility oriented design)


     green: coding


     refactor: design, refactor

TDD: Pair programming




    ping – pong


    who has keyboard is a King!


    through-test driving

TDD: Testing best practices
TDD: Test naming
TDD: Test naming
TDD: Exception processing
TDD: given-when-then
TDD: multiple asserts
TDD: Whole test system



     manual
    auto gui
  acceptance
 integration
unit tests
TDD: Unit tests




    One test – one behavior


    Independent: isolated class


    Reliable


    Fast

TDD: Integration and Acceptance Tests




          integration: component
     


          communication with some
          isolation




          acceptance: full system test, no
      


          isolation or mocks
          client requirements
      
TDD: Mocks




    fake – some little implementation


    stub – return some predefined result


    mock – object with programmed expectation


    spy – stub with flow verification

TDD: Mockito

 Easy to:
     stub methods


     verify behavior


     verify sequence of calls



 Cannot:
    mock final classes,

    methods
    mock static

TDD: Mockito


   @RunWith(MockitoJUnitRunner.class) annotation at
    the class-level of the test case
   @Mock annotation at mocking objects
   init tested class in method annotated with @Before


   when(mock.methodCall()).thenReturn(someResult);
   doThrow(exception).when(object).voidMethodCall();


   verify(mock, times).methodCall()
   verifyZeroInteractions(mocks)
   inOrder(mock)
TDD: Mockito
TDD: PowerMock



 Easy way to mock:
     static methods


     final methods or classes


     private methods


     construction of new objects



     partial mocking

TDD: PowerMock


      @RunWith(PowerMockRunner.class) annotation at the class-level of the test case.
      @PrepareForTest(ClassThatContainsStaticMethod.class) annotation at the class-level
       of the test case.
      PowerMock.mockStatic(ClassThatContainsStaticMethod.class) to mock all methods of
       this class.
      PowerMock.mockStaticPartial(ClassThatContainsStaticMethod.class, "methodName",
       ArgumentClass.class);
      PowerMock.replay(ClassThatContainsStaticMethod.class) to change the class to
       replay mode.
      PowerMock.verify(ClassThatContainsStaticMethod.class) to change the class to verify
       mode.


example: http://code.google.com/p/powermock/source/browse/trunk/modules/module-
        test/easymock/junit4-
        test/src/test/java/samples/junit4/singleton/MockStaticTest.java
What to read?




    Robert C. Martin “Clean Code: A Handbook

    of Agile Software Craftsmanship”


    Joshua Kerievsky “Refactoring to Patterns”



    Steve Freeman, Nat Pryce “Growing Object-

    Oriented Software, Guided by Tests”
Questions?




Thank you and good luck!
References


   http://www.slideshare.net/agileee/clean-
    tests
   http://www.slideshare.net/wakaleo/junit-
    kung-fu-getting-more-out-of-your-unit-
    tests
   http://mockito.googlecode.com/svn/tags/
    latest/javadoc/org/mockito/Mockito.html
   http://code.google.com/p/powermock/

Más contenido relacionado

La actualidad más candente

Cpp Testing Techniques Tips and Tricks - Cpp Europe
Cpp Testing Techniques Tips and Tricks - Cpp EuropeCpp Testing Techniques Tips and Tricks - Cpp Europe
Cpp Testing Techniques Tips and Tricks - Cpp EuropeClare Macrae
 
Hotspot & hotswap, who and who are best freinds
Hotspot & hotswap, who and who are best freindsHotspot & hotswap, who and who are best freinds
Hotspot & hotswap, who and who are best freinds亚军 汪
 
Software Engineering - RS3
Software Engineering - RS3Software Engineering - RS3
Software Engineering - RS3AtakanAral
 
Test Driven Development - The art of fearless programming
Test Driven Development - The art of fearless programmingTest Driven Development - The art of fearless programming
Test Driven Development - The art of fearless programmingChamil Jeewantha
 
Refactoring Legacy Code
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy CodeAdam Culp
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development CodeOps Technologies LLP
 
Introduction To J unit
Introduction To J unitIntroduction To J unit
Introduction To J unitOlga Extone
 
TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012Pietro Di Bello
 
New Features Of Test Unit 2.x
New Features Of Test Unit 2.xNew Features Of Test Unit 2.x
New Features Of Test Unit 2.xdjberg96
 

La actualidad más candente (20)

Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Java
 
Cpp Testing Techniques Tips and Tricks - Cpp Europe
Cpp Testing Techniques Tips and Tricks - Cpp EuropeCpp Testing Techniques Tips and Tricks - Cpp Europe
Cpp Testing Techniques Tips and Tricks - Cpp Europe
 
Working Effectively with Legacy Code
Working Effectively with Legacy CodeWorking Effectively with Legacy Code
Working Effectively with Legacy Code
 
Hotspot & hotswap, who and who are best freinds
Hotspot & hotswap, who and who are best freindsHotspot & hotswap, who and who are best freinds
Hotspot & hotswap, who and who are best freinds
 
Junit
JunitJunit
Junit
 
Software Engineering - RS3
Software Engineering - RS3Software Engineering - RS3
Software Engineering - RS3
 
TestNG vs Junit
TestNG vs JunitTestNG vs Junit
TestNG vs Junit
 
Test Driven Development - The art of fearless programming
Test Driven Development - The art of fearless programmingTest Driven Development - The art of fearless programming
Test Driven Development - The art of fearless programming
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
Mutation testing
Mutation testingMutation testing
Mutation testing
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 
Unit test
Unit testUnit test
Unit test
 
Refactoring Legacy Code
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy Code
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Introduction To J unit
Introduction To J unitIntroduction To J unit
Introduction To J unit
 
TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012
 
Unit testing with java
Unit testing with javaUnit testing with java
Unit testing with java
 
New Features Of Test Unit 2.x
New Features Of Test Unit 2.xNew Features Of Test Unit 2.x
New Features Of Test Unit 2.x
 
Greach 2015 Spock workshop
Greach 2015 Spock workshopGreach 2015 Spock workshop
Greach 2015 Spock workshop
 
Unit test-using-spock in Grails
Unit test-using-spock in GrailsUnit test-using-spock in Grails
Unit test-using-spock in Grails
 

Destacado

The International climate negotiations. Is there hope?
The International climate negotiations. Is there hope? The International climate negotiations. Is there hope?
The International climate negotiations. Is there hope? Julie-Anne Richards
 
Fase dan masalah 1 6
Fase dan masalah 1 6Fase dan masalah 1 6
Fase dan masalah 1 6skyneter
 
Presentatie Youtube (SlideShare)
Presentatie Youtube (SlideShare)Presentatie Youtube (SlideShare)
Presentatie Youtube (SlideShare)hopritme
 
презентація до уроку тканини
презентація до уроку тканинипрезентація до уроку тканини
презентація до уроку тканиниpolyna19
 
Saunier Duval TC C25E
Saunier Duval TC C25ESaunier Duval TC C25E
Saunier Duval TC C25Esco2wmnoas
 
Pagkalinawan malikhaing-pagtuturo-ng-wika-1
Pagkalinawan malikhaing-pagtuturo-ng-wika-1Pagkalinawan malikhaing-pagtuturo-ng-wika-1
Pagkalinawan malikhaing-pagtuturo-ng-wika-1thobie_cute20
 
Prototipo proyecto: Musicarte
Prototipo proyecto: MusicartePrototipo proyecto: Musicarte
Prototipo proyecto: MusicarteeTwinning España
 
Ireland dublin my student experience
Ireland dublin my student experienceIreland dublin my student experience
Ireland dublin my student experienceHUI SYUEN YUE
 
Erroll bennett tahitian footballer
Erroll bennett tahitian footballerErroll bennett tahitian footballer
Erroll bennett tahitian footballerJohn Pooley
 
Yemek zaman¹
Yemek zaman¹ Yemek zaman¹
Yemek zaman¹ filipj2000
 
Resume (1) (1) (1) AR
Resume (1) (1) (1) ARResume (1) (1) (1) AR
Resume (1) (1) (1) ARSyed Ahmed
 
Lecture ngw 2 feb 2016 handouts
Lecture ngw 2 feb 2016 handoutsLecture ngw 2 feb 2016 handouts
Lecture ngw 2 feb 2016 handoutsRadboud University
 
Erreequadro_2mlab - Sicilia - 20 e 21 Giugno 2012
Erreequadro_2mlab - Sicilia - 20 e 21 Giugno 2012Erreequadro_2mlab - Sicilia - 20 e 21 Giugno 2012
Erreequadro_2mlab - Sicilia - 20 e 21 Giugno 2012BTO Educational
 
100學年度第二學期少事法期末報告劉姓少年調查報告
100學年度第二學期少事法期末報告劉姓少年調查報告100學年度第二學期少事法期末報告劉姓少年調查報告
100學年度第二學期少事法期末報告劉姓少年調查報告黛西 姚
 
Change My Path - slides
Change My Path - slidesChange My Path - slides
Change My Path - slidesrastapup
 

Destacado (20)

Sp gifts 11
Sp gifts 11Sp gifts 11
Sp gifts 11
 
Filogeografia en Suramerica
Filogeografia en SuramericaFilogeografia en Suramerica
Filogeografia en Suramerica
 
The International climate negotiations. Is there hope?
The International climate negotiations. Is there hope? The International climate negotiations. Is there hope?
The International climate negotiations. Is there hope?
 
Gdiaz final-mag 2
Gdiaz final-mag 2Gdiaz final-mag 2
Gdiaz final-mag 2
 
Tap chi f world
Tap chi f worldTap chi f world
Tap chi f world
 
Fase dan masalah 1 6
Fase dan masalah 1 6Fase dan masalah 1 6
Fase dan masalah 1 6
 
Presentatie Youtube (SlideShare)
Presentatie Youtube (SlideShare)Presentatie Youtube (SlideShare)
Presentatie Youtube (SlideShare)
 
презентація до уроку тканини
презентація до уроку тканинипрезентація до уроку тканини
презентація до уроку тканини
 
Saunier Duval TC C25E
Saunier Duval TC C25ESaunier Duval TC C25E
Saunier Duval TC C25E
 
Pagkalinawan malikhaing-pagtuturo-ng-wika-1
Pagkalinawan malikhaing-pagtuturo-ng-wika-1Pagkalinawan malikhaing-pagtuturo-ng-wika-1
Pagkalinawan malikhaing-pagtuturo-ng-wika-1
 
Now You Can Invest In It
Now You Can Invest In ItNow You Can Invest In It
Now You Can Invest In It
 
Prototipo proyecto: Musicarte
Prototipo proyecto: MusicartePrototipo proyecto: Musicarte
Prototipo proyecto: Musicarte
 
Ireland dublin my student experience
Ireland dublin my student experienceIreland dublin my student experience
Ireland dublin my student experience
 
Erroll bennett tahitian footballer
Erroll bennett tahitian footballerErroll bennett tahitian footballer
Erroll bennett tahitian footballer
 
Yemek zaman¹
Yemek zaman¹ Yemek zaman¹
Yemek zaman¹
 
Resume (1) (1) (1) AR
Resume (1) (1) (1) ARResume (1) (1) (1) AR
Resume (1) (1) (1) AR
 
Lecture ngw 2 feb 2016 handouts
Lecture ngw 2 feb 2016 handoutsLecture ngw 2 feb 2016 handouts
Lecture ngw 2 feb 2016 handouts
 
Erreequadro_2mlab - Sicilia - 20 e 21 Giugno 2012
Erreequadro_2mlab - Sicilia - 20 e 21 Giugno 2012Erreequadro_2mlab - Sicilia - 20 e 21 Giugno 2012
Erreequadro_2mlab - Sicilia - 20 e 21 Giugno 2012
 
100學年度第二學期少事法期末報告劉姓少年調查報告
100學年度第二學期少事法期末報告劉姓少年調查報告100學年度第二學期少事法期末報告劉姓少年調查報告
100學年度第二學期少事法期末報告劉姓少年調查報告
 
Change My Path - slides
Change My Path - slidesChange My Path - slides
Change My Path - slides
 

Similar a Solit 2012, TDD и отдельные аспекты тестирования в Java, Антонина Шафранская

Journey's diary developing a framework using tdd
Journey's diary   developing a framework using tddJourney's diary   developing a framework using tdd
Journey's diary developing a framework using tddeduardomg23
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseUTC Fire & Security
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testingpleeps
 
Xp Day 080506 Unit Tests And Mocks
Xp Day 080506 Unit Tests And MocksXp Day 080506 Unit Tests And Mocks
Xp Day 080506 Unit Tests And Mocksguillaumecarre
 
Test driven development
Test driven developmentTest driven development
Test driven developmentlukaszkujawa
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Ukraine
 
TDD Flow: The Mantra in Action
TDD Flow: The Mantra in ActionTDD Flow: The Mantra in Action
TDD Flow: The Mantra in ActionDionatan default
 
S313352 optimizing java device testing with automatic feature discovering
S313352 optimizing java device testing with automatic feature discoveringS313352 optimizing java device testing with automatic feature discovering
S313352 optimizing java device testing with automatic feature discoveringromanovfedor
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Babul Mirdha
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
 
Making Your Own Static Analyzer Using Freud DSL. Marat Vyshegorodtsev
 Making Your Own Static Analyzer Using Freud DSL. Marat Vyshegorodtsev Making Your Own Static Analyzer Using Freud DSL. Marat Vyshegorodtsev
Making Your Own Static Analyzer Using Freud DSL. Marat VyshegorodtsevYandex
 
Unit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of PurityUnit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of PurityVictor Rentea
 
Advance unittest
Advance unittestAdvance unittest
Advance unittestReza Arbabi
 
Stopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under TestStopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under TestSeb Rose
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android ApplicationsRody Middelkoop
 
Refactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGRefactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGLuca Minudel
 

Similar a Solit 2012, TDD и отдельные аспекты тестирования в Java, Антонина Шафранская (20)

Journey's diary developing a framework using tdd
Journey's diary   developing a framework using tddJourney's diary   developing a framework using tdd
Journey's diary developing a framework using tdd
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testing
 
Xp Day 080506 Unit Tests And Mocks
Xp Day 080506 Unit Tests And MocksXp Day 080506 Unit Tests And Mocks
Xp Day 080506 Unit Tests And Mocks
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
 
TDD Flow: The Mantra in Action
TDD Flow: The Mantra in ActionTDD Flow: The Mantra in Action
TDD Flow: The Mantra in Action
 
S313352 optimizing java device testing with automatic feature discovering
S313352 optimizing java device testing with automatic feature discoveringS313352 optimizing java device testing with automatic feature discovering
S313352 optimizing java device testing with automatic feature discovering
 
Simple testable code
Simple testable codeSimple testable code
Simple testable code
 
Testing w-mocks
Testing w-mocksTesting w-mocks
Testing w-mocks
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
 
Making Your Own Static Analyzer Using Freud DSL. Marat Vyshegorodtsev
 Making Your Own Static Analyzer Using Freud DSL. Marat Vyshegorodtsev Making Your Own Static Analyzer Using Freud DSL. Marat Vyshegorodtsev
Making Your Own Static Analyzer Using Freud DSL. Marat Vyshegorodtsev
 
Unit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of PurityUnit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of Purity
 
Advance unittest
Advance unittestAdvance unittest
Advance unittest
 
Stopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under TestStopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under Test
 
Unit testing - A&BP CC
Unit testing - A&BP CCUnit testing - A&BP CC
Unit testing - A&BP CC
 
Unit testing
Unit testingUnit testing
Unit testing
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android Applications
 
Refactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGRefactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENG
 

Más de solit

Jazz team cooperation roadmap
Jazz team cooperation roadmapJazz team cooperation roadmap
Jazz team cooperation roadmapsolit
 
JazzTeam company presentation
JazzTeam company presentationJazzTeam company presentation
JazzTeam company presentationsolit
 
Solit 2014, Agile ValueTeam, учимся понимать Scrum, Семенченко Антон
Solit 2014, Agile ValueTeam, учимся понимать Scrum, Семенченко АнтонSolit 2014, Agile ValueTeam, учимся понимать Scrum, Семенченко Антон
Solit 2014, Agile ValueTeam, учимся понимать Scrum, Семенченко Антонsolit
 
Solit 2014, Scrum guide 2013, Семенченко Антон
Solit 2014, Scrum guide 2013, Семенченко АнтонSolit 2014, Scrum guide 2013, Семенченко Антон
Solit 2014, Scrum guide 2013, Семенченко Антонsolit
 
Solit 2014, Подготовка специалистов в сфере It на факультетe информационных т...
Solit 2014, Подготовка специалистов в сфере It на факультетe информационных т...Solit 2014, Подготовка специалистов в сфере It на факультетe информационных т...
Solit 2014, Подготовка специалистов в сфере It на факультетe информационных т...solit
 
Solit 2014, Адраджэнне Памяти аб продках пачынаецца з дзеянняу нашчадкау, Уру...
Solit 2014, Адраджэнне Памяти аб продках пачынаецца з дзеянняу нашчадкау, Уру...Solit 2014, Адраджэнне Памяти аб продках пачынаецца з дзеянняу нашчадкау, Уру...
Solit 2014, Адраджэнне Памяти аб продках пачынаецца з дзеянняу нашчадкау, Уру...solit
 
Solit 2014, Централизованное управление тестами с помощью TestLink, Зубович В...
Solit 2014, Централизованное управление тестами с помощью TestLink, Зубович В...Solit 2014, Централизованное управление тестами с помощью TestLink, Зубович В...
Solit 2014, Централизованное управление тестами с помощью TestLink, Зубович В...solit
 
Solit 2014, Инструменты автоматизации тестирования мобильных приложений. Срав...
Solit 2014, Инструменты автоматизации тестирования мобильных приложений. Срав...Solit 2014, Инструменты автоматизации тестирования мобильных приложений. Срав...
Solit 2014, Инструменты автоматизации тестирования мобильных приложений. Срав...solit
 
Solit 2014, Cемантическое ядро сайта, Нагибович Юлия
Solit 2014, Cемантическое ядро сайта, Нагибович ЮлияSolit 2014, Cемантическое ядро сайта, Нагибович Юлия
Solit 2014, Cемантическое ядро сайта, Нагибович Юлияsolit
 
Solit 2014, Геоанамальные зоны и сейсмоакустика. Субъективный взгляд. Миснико...
Solit 2014, Геоанамальные зоны и сейсмоакустика. Субъективный взгляд. Миснико...Solit 2014, Геоанамальные зоны и сейсмоакустика. Субъективный взгляд. Миснико...
Solit 2014, Геоанамальные зоны и сейсмоакустика. Субъективный взгляд. Миснико...solit
 
Solit 2014, Обзор белоруского интернет потребителя и рекламодателя. Что хочет...
Solit 2014, Обзор белоруского интернет потребителя и рекламодателя. Что хочет...Solit 2014, Обзор белоруского интернет потребителя и рекламодателя. Что хочет...
Solit 2014, Обзор белоруского интернет потребителя и рекламодателя. Что хочет...solit
 
Solit 2014, Как эффективно организовать Автоматизацию, Семенченко Антон
Solit 2014, Как эффективно организовать Автоматизацию, Семенченко АнтонSolit 2014, Как эффективно организовать Автоматизацию, Семенченко Антон
Solit 2014, Как эффективно организовать Автоматизацию, Семенченко Антонsolit
 
Solit 2014, Freelance and Nearshoring from a Dutch Perspective, Peter Reitsma
Solit 2014, Freelance and Nearshoring from a Dutch Perspective, Peter ReitsmaSolit 2014, Freelance and Nearshoring from a Dutch Perspective, Peter Reitsma
Solit 2014, Freelance and Nearshoring from a Dutch Perspective, Peter Reitsmasolit
 
Solit 2014, Мифы и легенды SEO, Крылов Александр
Solit 2014, Мифы и легенды SEO, Крылов АлександрSolit 2014, Мифы и легенды SEO, Крылов Александр
Solit 2014, Мифы и легенды SEO, Крылов Александрsolit
 
Solit 2014, Измеряем производительность Webприложения на сторне клиента с пом...
Solit 2014, Измеряем производительность Webприложения на сторне клиента с пом...Solit 2014, Измеряем производительность Webприложения на сторне клиента с пом...
Solit 2014, Измеряем производительность Webприложения на сторне клиента с пом...solit
 
Solit 2014, Непрерывная интеграция сложного проекта. Кто все сломал?, Русаков...
Solit 2014, Непрерывная интеграция сложного проекта. Кто все сломал?, Русаков...Solit 2014, Непрерывная интеграция сложного проекта. Кто все сломал?, Русаков...
Solit 2014, Непрерывная интеграция сложного проекта. Кто все сломал?, Русаков...solit
 
Solit 2014, Реактивный Javascript. Победа над асинхронностью и вложенностью, ...
Solit 2014, Реактивный Javascript. Победа над асинхронностью и вложенностью, ...Solit 2014, Реактивный Javascript. Победа над асинхронностью и вложенностью, ...
Solit 2014, Реактивный Javascript. Победа над асинхронностью и вложенностью, ...solit
 
Solit 2014, 3 этапа развития аналитики вашего бизнеса. Как правильно определи...
Solit 2014, 3 этапа развития аналитики вашего бизнеса. Как правильно определи...Solit 2014, 3 этапа развития аналитики вашего бизнеса. Как правильно определи...
Solit 2014, 3 этапа развития аналитики вашего бизнеса. Как правильно определи...solit
 
Solit 2014, Опыт участия в конкурсе по спортивному программированию Russian A...
Solit 2014, Опыт участия в конкурсе по спортивному программированию Russian A...Solit 2014, Опыт участия в конкурсе по спортивному программированию Russian A...
Solit 2014, Опыт участия в конкурсе по спортивному программированию Russian A...solit
 
Solit 2014, MapReduce и машинное обучение на hadoop и mahout, Слисенко Конста...
Solit 2014, MapReduce и машинное обучение на hadoop и mahout, Слисенко Конста...Solit 2014, MapReduce и машинное обучение на hadoop и mahout, Слисенко Конста...
Solit 2014, MapReduce и машинное обучение на hadoop и mahout, Слисенко Конста...solit
 

Más de solit (20)

Jazz team cooperation roadmap
Jazz team cooperation roadmapJazz team cooperation roadmap
Jazz team cooperation roadmap
 
JazzTeam company presentation
JazzTeam company presentationJazzTeam company presentation
JazzTeam company presentation
 
Solit 2014, Agile ValueTeam, учимся понимать Scrum, Семенченко Антон
Solit 2014, Agile ValueTeam, учимся понимать Scrum, Семенченко АнтонSolit 2014, Agile ValueTeam, учимся понимать Scrum, Семенченко Антон
Solit 2014, Agile ValueTeam, учимся понимать Scrum, Семенченко Антон
 
Solit 2014, Scrum guide 2013, Семенченко Антон
Solit 2014, Scrum guide 2013, Семенченко АнтонSolit 2014, Scrum guide 2013, Семенченко Антон
Solit 2014, Scrum guide 2013, Семенченко Антон
 
Solit 2014, Подготовка специалистов в сфере It на факультетe информационных т...
Solit 2014, Подготовка специалистов в сфере It на факультетe информационных т...Solit 2014, Подготовка специалистов в сфере It на факультетe информационных т...
Solit 2014, Подготовка специалистов в сфере It на факультетe информационных т...
 
Solit 2014, Адраджэнне Памяти аб продках пачынаецца з дзеянняу нашчадкау, Уру...
Solit 2014, Адраджэнне Памяти аб продках пачынаецца з дзеянняу нашчадкау, Уру...Solit 2014, Адраджэнне Памяти аб продках пачынаецца з дзеянняу нашчадкау, Уру...
Solit 2014, Адраджэнне Памяти аб продках пачынаецца з дзеянняу нашчадкау, Уру...
 
Solit 2014, Централизованное управление тестами с помощью TestLink, Зубович В...
Solit 2014, Централизованное управление тестами с помощью TestLink, Зубович В...Solit 2014, Централизованное управление тестами с помощью TestLink, Зубович В...
Solit 2014, Централизованное управление тестами с помощью TestLink, Зубович В...
 
Solit 2014, Инструменты автоматизации тестирования мобильных приложений. Срав...
Solit 2014, Инструменты автоматизации тестирования мобильных приложений. Срав...Solit 2014, Инструменты автоматизации тестирования мобильных приложений. Срав...
Solit 2014, Инструменты автоматизации тестирования мобильных приложений. Срав...
 
Solit 2014, Cемантическое ядро сайта, Нагибович Юлия
Solit 2014, Cемантическое ядро сайта, Нагибович ЮлияSolit 2014, Cемантическое ядро сайта, Нагибович Юлия
Solit 2014, Cемантическое ядро сайта, Нагибович Юлия
 
Solit 2014, Геоанамальные зоны и сейсмоакустика. Субъективный взгляд. Миснико...
Solit 2014, Геоанамальные зоны и сейсмоакустика. Субъективный взгляд. Миснико...Solit 2014, Геоанамальные зоны и сейсмоакустика. Субъективный взгляд. Миснико...
Solit 2014, Геоанамальные зоны и сейсмоакустика. Субъективный взгляд. Миснико...
 
Solit 2014, Обзор белоруского интернет потребителя и рекламодателя. Что хочет...
Solit 2014, Обзор белоруского интернет потребителя и рекламодателя. Что хочет...Solit 2014, Обзор белоруского интернет потребителя и рекламодателя. Что хочет...
Solit 2014, Обзор белоруского интернет потребителя и рекламодателя. Что хочет...
 
Solit 2014, Как эффективно организовать Автоматизацию, Семенченко Антон
Solit 2014, Как эффективно организовать Автоматизацию, Семенченко АнтонSolit 2014, Как эффективно организовать Автоматизацию, Семенченко Антон
Solit 2014, Как эффективно организовать Автоматизацию, Семенченко Антон
 
Solit 2014, Freelance and Nearshoring from a Dutch Perspective, Peter Reitsma
Solit 2014, Freelance and Nearshoring from a Dutch Perspective, Peter ReitsmaSolit 2014, Freelance and Nearshoring from a Dutch Perspective, Peter Reitsma
Solit 2014, Freelance and Nearshoring from a Dutch Perspective, Peter Reitsma
 
Solit 2014, Мифы и легенды SEO, Крылов Александр
Solit 2014, Мифы и легенды SEO, Крылов АлександрSolit 2014, Мифы и легенды SEO, Крылов Александр
Solit 2014, Мифы и легенды SEO, Крылов Александр
 
Solit 2014, Измеряем производительность Webприложения на сторне клиента с пом...
Solit 2014, Измеряем производительность Webприложения на сторне клиента с пом...Solit 2014, Измеряем производительность Webприложения на сторне клиента с пом...
Solit 2014, Измеряем производительность Webприложения на сторне клиента с пом...
 
Solit 2014, Непрерывная интеграция сложного проекта. Кто все сломал?, Русаков...
Solit 2014, Непрерывная интеграция сложного проекта. Кто все сломал?, Русаков...Solit 2014, Непрерывная интеграция сложного проекта. Кто все сломал?, Русаков...
Solit 2014, Непрерывная интеграция сложного проекта. Кто все сломал?, Русаков...
 
Solit 2014, Реактивный Javascript. Победа над асинхронностью и вложенностью, ...
Solit 2014, Реактивный Javascript. Победа над асинхронностью и вложенностью, ...Solit 2014, Реактивный Javascript. Победа над асинхронностью и вложенностью, ...
Solit 2014, Реактивный Javascript. Победа над асинхронностью и вложенностью, ...
 
Solit 2014, 3 этапа развития аналитики вашего бизнеса. Как правильно определи...
Solit 2014, 3 этапа развития аналитики вашего бизнеса. Как правильно определи...Solit 2014, 3 этапа развития аналитики вашего бизнеса. Как правильно определи...
Solit 2014, 3 этапа развития аналитики вашего бизнеса. Как правильно определи...
 
Solit 2014, Опыт участия в конкурсе по спортивному программированию Russian A...
Solit 2014, Опыт участия в конкурсе по спортивному программированию Russian A...Solit 2014, Опыт участия в конкурсе по спортивному программированию Russian A...
Solit 2014, Опыт участия в конкурсе по спортивному программированию Russian A...
 
Solit 2014, MapReduce и машинное обучение на hadoop и mahout, Слисенко Конста...
Solit 2014, MapReduce и машинное обучение на hadoop и mahout, Слисенко Конста...Solit 2014, MapReduce и машинное обучение на hadoop и mahout, Слисенко Конста...
Solit 2014, MapReduce и машинное обучение на hadoop и mahout, Слисенко Конста...
 

Último

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Solit 2012, TDD и отдельные аспекты тестирования в Java, Антонина Шафранская

  • 1. Generation_P Consulting Ltd Software Solutions for the Travel Industry TDD Make your life better Antanina Shafranskaya Antanina.Shafranskaya@generation_p.com
  • 2. TDD: way to better life Test before code! TDD principals: think first  trivial first  test <=> what ; implementation <=> how  different levels of tests  red – green – refactor red: behavior (responsibility oriented design)  green: coding  refactor: design, refactor 
  • 3. TDD: Pair programming ping – pong  who has keyboard is a King!  through-test driving 
  • 4. TDD: Testing best practices
  • 10. TDD: Whole test system manual auto gui acceptance integration unit tests
  • 11. TDD: Unit tests One test – one behavior  Independent: isolated class  Reliable  Fast 
  • 12. TDD: Integration and Acceptance Tests integration: component  communication with some isolation acceptance: full system test, no  isolation or mocks client requirements 
  • 13. TDD: Mocks fake – some little implementation  stub – return some predefined result  mock – object with programmed expectation  spy – stub with flow verification 
  • 14. TDD: Mockito Easy to: stub methods  verify behavior  verify sequence of calls  Cannot: mock final classes,  methods mock static 
  • 15. TDD: Mockito  @RunWith(MockitoJUnitRunner.class) annotation at the class-level of the test case  @Mock annotation at mocking objects  init tested class in method annotated with @Before  when(mock.methodCall()).thenReturn(someResult);  doThrow(exception).when(object).voidMethodCall();  verify(mock, times).methodCall()  verifyZeroInteractions(mocks)  inOrder(mock)
  • 17. TDD: PowerMock Easy way to mock: static methods  final methods or classes  private methods  construction of new objects  partial mocking 
  • 18. TDD: PowerMock  @RunWith(PowerMockRunner.class) annotation at the class-level of the test case.  @PrepareForTest(ClassThatContainsStaticMethod.class) annotation at the class-level of the test case.  PowerMock.mockStatic(ClassThatContainsStaticMethod.class) to mock all methods of this class.  PowerMock.mockStaticPartial(ClassThatContainsStaticMethod.class, "methodName", ArgumentClass.class);  PowerMock.replay(ClassThatContainsStaticMethod.class) to change the class to replay mode.  PowerMock.verify(ClassThatContainsStaticMethod.class) to change the class to verify mode. example: http://code.google.com/p/powermock/source/browse/trunk/modules/module- test/easymock/junit4- test/src/test/java/samples/junit4/singleton/MockStaticTest.java
  • 19. What to read? Robert C. Martin “Clean Code: A Handbook  of Agile Software Craftsmanship” Joshua Kerievsky “Refactoring to Patterns”  Steve Freeman, Nat Pryce “Growing Object-  Oriented Software, Guided by Tests”
  • 21. References  http://www.slideshare.net/agileee/clean- tests  http://www.slideshare.net/wakaleo/junit- kung-fu-getting-more-out-of-your-unit- tests  http://mockito.googlecode.com/svn/tags/ latest/javadoc/org/mockito/Mockito.html  http://code.google.com/p/powermock/

Notas del editor

  1. 28.01.2012
  2. 28.01.2012
  3. 28.01.2012
  4. 28.01.2012
  5. 28.01.2012
  6. 28.01.2012
  7. 28.01.2012
  8. 28.01.2012
  9. 28.01.2012
  10. 28.01.2012
  11. 28.01.2012
  12. 28.01.2012
  13. 28.01.2012
  14. 28.01.2012
  15. 28.01.2012
  16. 28.01.2012
  17. 28.01.2012
  18. 28.01.2012
  19. 28.01.2012
  20. 28.01.2012
  21. 28.01.2012