SlideShare uma empresa Scribd logo
1 de 76
Test First,
Refresh Second
               Test-Driven Development with




Tim Berglund
August, 2009
TDD
Failure to Write Tests?
KINDS OF TESTING
KINDS OF TESTING


   UNIT TESTING
KINDS OF TESTING


   UNIT TESTING
      XUNIT
KINDS OF TESTING
KINDS OF TESTING

INTEGRATION TESTING
KINDS OF TESTING

INTEGRATION TESTING
  XUNIT EXTENSIONS
KINDS OF TESTING

INTEGRATION TESTING
  XUNIT EXTENSIONS
      TESTNG
KINDS OF TESTING
KINDS OF TESTING

FUNCTIONAL TESTING
KINDS OF TESTING

FUNCTIONAL TESTING
KINDS OF TESTING

FUNCTIONAL TESTING
UNIT TESTS
EXECUTABLE
ISOLATED
AUTOMATED
ISOLATED?
WEB APP ISOLATION
  CHALLENGES
WEB APP ISOLATION
  CHALLENGES
      DATABASE
WEB APP ISOLATION
  CHALLENGES
       DATABASE
   SERVLET CONTAINER
WEB APP ISOLATION
  CHALLENGES
       DATABASE
   SERVLET CONTAINER
   HTTP INTERACTION
WEB APP ISOLATION
  CHALLENGES
       DATABASE
   SERVLET CONTAINER
   HTTP INTERACTION
    PAGE RENDERING
WEB APP ISOLATION
  CHALLENGES
          DATABASE
     SERVLET CONTAINER
     HTTP INTERACTION
      PAGE RENDERING
ENTERPRISE INTEGRATION POINTS
TO THE RESCUE!
    (especially 1.1 and later)
THE GOOD STUFF
THE GOOD STUFF


  GrailsUnitTestCase
ControllerUnitTestCase
THE GOOD STUFF
THE GOOD STUFF

   mockDomain
  mockController
   mockLogging
   mockConfig
METACLASS MAGIC
mockDomain
mockDomain
  SUPPORTS
mockDomain
         SUPPORTS
   findAll()
findAllByXXX()
      get()
     read()
   getAll()
    ident()
   exists()
mockDomain
         SUPPORTS
   findAll()          count()
findAllByXXX()          list()
      get()         validate()
     read()           save()
   getAll()          delete()
    ident()         discard()
   exists()
mockDomain
mockDomain
DOES NOT SUPPORT
mockDomain
DOES NOT SUPPORT

      Criteria Builders
            HQL
Persistent Class Inheritance
        findWhere()
       findAllWhere()
mockController
mockController
    SUPPORTS
mockController
       SUPPORTS
    log
 request
response
 session
 params
   flash
mockController
       SUPPORTS
    log
                forward()
 request
                redirect()
response
                 render()
 session
              withFormat()
 params
               withForm()
   flash
mockController
mockController
    SUPPORTS
mockController
    SUPPORTS
    forwardArgs
    redirectArgs
     renderArgs
      template
   modelAndView
mockLogging
mockLogging

ADDS MOCKED LOG PROPERTY
mockLogging

ADDS MOCKED LOG PROPERTY
SENDS OUTPUT TO SYSTEM.OUT
mockLogging

     ADDS MOCKED LOG PROPERTY
    SENDS OUTPUT TO SYSTEM.OUT
IGNORES DEBUG AND TRACE BY DEFAULT
mockLogging

     ADDS MOCKED LOG PROPERTY
    SENDS OUTPUT TO SYSTEM.OUT
IGNORES DEBUG AND TRACE BY DEFAULT
  CAN ENABLE DEBUG WITH A SWITCH
mockConfig
mockConfig

REPLACES DEFAULT GRAILS CONFIG IN
      grailsApplication.config
mockConfig

REPLACES DEFAULT GRAILS CONFIG IN
      grailsApplication.config
      READS FROM A STRING
GrailsUnitTestCase
GrailsUnitTestCase
   INTRINSIC PROPERTIES
      applicationContext
      errorsMap
   INTRINSIC METHODS
      mockFor
      mockDomain
      mockController
      mockTagLib
      mockConfig
GrailsUnitTestCase


MUST CALL super.setUp()!
ControllerUnitTestCase
   INTRINSIC PROPERTIES
ControllerUnitTestCase
   INTRINSIC PROPERTIES
        mockRequest
        mockResponse
         mockSession
         forwardArgs
         redirectArgs
          renderArgs
         mockParams
          mockFlash
ControllerUnitTestCase
ControllerUnitTestCase


  AUTOMATICALLY MOCKS
CONTROLLER FROM TEST CLASS
          NAME
ControllerUnitTestCase



MUST CALL super.setUp()
LET’S USE THIS!
OUR APP


USER GROUP MEMBERSHIP
      MANAGER
STORIES


 AS AN UNREGISTERED USER, I
WANT TO SIGN UP ON THE SITE.
STORIES


AS A REGISTERED USER, I WANT TO
     SEE UPCOMING EVENTS.
STORIES

AS AN ADMINISTRATOR, I WANT
    TO HAVE FULL CRUD
 CAPABILITIES ON MEETINGS.
STORIES


AS AN ADMINISTRATOR, I WANT
TO SEE WHO IS ATTENDING AN
          EVENT.
STORIES


AS A REGISTERED USER, I WANT TO
 BE ABLE TO RSVP TO AN EVENT.
LIVE CODING!
THE CONCLUSION?
IT WORKS!
THERE ARE REAL
 LIMITATIONS
INTEGRATION AND
FUNCTIONAL TESTS
  ARE NECESSARY
CREDIBLE WEB APP
      TDD
THANK YOU!

TIM BERGLUND
AUGUST TECHNOLOGY GROUP, LLC
http://www.augusttechgroup.com
tim.berglund@augusttechgroup.com
@tlberglund
PHOTO CREDITS


WELLS CATHEDRAL CHAPEL: HTTP://WWW.FLICKR.COM/PHOTOS/TASA_M/3483041197/
FIRE: HTTP://WWW.FLICKR.COM/PHOTOS/COBALT/61587166/
SHIPPING CONTAINERS: HTTP://WWW.FLICKR.COM/PHOTOS/PHOTOHOME_UK/1494590209/
COMPUTER CONSOLE: HTTP://WWW.FLICKR.COM/PHOTOS/NOSTRI-IMAGO/2910549047/

Mais conteúdo relacionado

Mais procurados

Unit tests in node.js
Unit tests in node.jsUnit tests in node.js
Unit tests in node.jsRotem Tamir
 
Como NÃO testar o seu projeto de Software. DevDay 2014
Como NÃO testar o seu projeto de Software. DevDay 2014Como NÃO testar o seu projeto de Software. DevDay 2014
Como NÃO testar o seu projeto de Software. DevDay 2014alexandre freire
 
Testing JavaScript Applications
Testing JavaScript ApplicationsTesting JavaScript Applications
Testing JavaScript ApplicationsThe Rolling Scopes
 
PgTAP Best Practices
PgTAP Best PracticesPgTAP Best Practices
PgTAP Best PracticesDavid Wheeler
 
JavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsJavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsKonrad Malawski
 
JavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyJavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyAlexandr Skachkov
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineAnup Singh
 
Jasmine - why JS tests don't smell fishy
Jasmine - why JS tests don't smell fishyJasmine - why JS tests don't smell fishy
Jasmine - why JS tests don't smell fishyIgor Napierala
 
Unit testing with mocha
Unit testing with mochaUnit testing with mocha
Unit testing with mochaRevath S Kumar
 
Fear no fragments
Fear no fragmentsFear no fragments
Fear no fragmentsDipo Areoye
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma Christopher Bartling
 
Testing javascript in the frontend
Testing javascript in the frontendTesting javascript in the frontend
Testing javascript in the frontendFrederic CABASSUT
 
Advanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit TestingAdvanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit TestingLars Thorup
 
JSRs 303 and 330 in Action
JSRs 303 and 330 in ActionJSRs 303 and 330 in Action
JSRs 303 and 330 in Actionsimonetripodi
 
Javascript Testing with Jasmine 101
Javascript Testing with Jasmine 101Javascript Testing with Jasmine 101
Javascript Testing with Jasmine 101Roy Yu
 
Java8 tgtbatu devoxxuk18
Java8 tgtbatu devoxxuk18Java8 tgtbatu devoxxuk18
Java8 tgtbatu devoxxuk18Brian Vermeer
 

Mais procurados (20)

Unit tests in node.js
Unit tests in node.jsUnit tests in node.js
Unit tests in node.js
 
Como NÃO testar o seu projeto de Software. DevDay 2014
Como NÃO testar o seu projeto de Software. DevDay 2014Como NÃO testar o seu projeto de Software. DevDay 2014
Como NÃO testar o seu projeto de Software. DevDay 2014
 
Agile Android
Agile AndroidAgile Android
Agile Android
 
Testing JavaScript Applications
Testing JavaScript ApplicationsTesting JavaScript Applications
Testing JavaScript Applications
 
Agile Swift
Agile SwiftAgile Swift
Agile Swift
 
PgTAP Best Practices
PgTAP Best PracticesPgTAP Best Practices
PgTAP Best Practices
 
Jasmine BDD for Javascript
Jasmine BDD for JavascriptJasmine BDD for Javascript
Jasmine BDD for Javascript
 
JavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsJavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good Parts
 
JavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyJavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 Proxy
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & Jasmine
 
Jasmine - why JS tests don't smell fishy
Jasmine - why JS tests don't smell fishyJasmine - why JS tests don't smell fishy
Jasmine - why JS tests don't smell fishy
 
Unit testing with mocha
Unit testing with mochaUnit testing with mocha
Unit testing with mocha
 
Fear no fragments
Fear no fragmentsFear no fragments
Fear no fragments
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
 
Goto devoxx
Goto devoxxGoto devoxx
Goto devoxx
 
Testing javascript in the frontend
Testing javascript in the frontendTesting javascript in the frontend
Testing javascript in the frontend
 
Advanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit TestingAdvanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit Testing
 
JSRs 303 and 330 in Action
JSRs 303 and 330 in ActionJSRs 303 and 330 in Action
JSRs 303 and 330 in Action
 
Javascript Testing with Jasmine 101
Javascript Testing with Jasmine 101Javascript Testing with Jasmine 101
Javascript Testing with Jasmine 101
 
Java8 tgtbatu devoxxuk18
Java8 tgtbatu devoxxuk18Java8 tgtbatu devoxxuk18
Java8 tgtbatu devoxxuk18
 

Destaque

Romanii pot face cariera
Romanii pot face carieraRomanii pot face cariera
Romanii pot face carieraCarla Alman
 
Mainstreaming the Disruption: Up-skilling for Online Learning
Mainstreaming the Disruption: Up-skilling for Online LearningMainstreaming the Disruption: Up-skilling for Online Learning
Mainstreaming the Disruption: Up-skilling for Online LearningJeremy Williams
 
Adin Durumlari
Adin DurumlariAdin Durumlari
Adin Durumlariyardimt
 
Biggest Hole On Earth
Biggest Hole On EarthBiggest Hole On Earth
Biggest Hole On Earthninedots
 
Property Brochure
Property BrochureProperty Brochure
Property Brochureguest3bdd0e
 
School as Sustainable Enterprise
School as Sustainable EnterpriseSchool as Sustainable Enterprise
School as Sustainable EnterpriseJeremy Williams
 
Kökler ve ekler
Kökler ve eklerKökler ve ekler
Kökler ve ekleryardimt
 
Sfantul Valentin pe criza
Sfantul Valentin pe crizaSfantul Valentin pe criza
Sfantul Valentin pe crizaCarla Alman
 
Social media traning_for_mf_1
Social media traning_for_mf_1Social media traning_for_mf_1
Social media traning_for_mf_1pandec
 
Planning & Executing Successful Practices
Planning & Executing Successful PracticesPlanning & Executing Successful Practices
Planning & Executing Successful PracticesNeil Giarratana
 
Hoe uw website aantrekkelijker maken ?
Hoe uw website aantrekkelijker maken ?Hoe uw website aantrekkelijker maken ?
Hoe uw website aantrekkelijker maken ?the AIM
 
(Alexandra & michaela)comenius week tuesday (at the science park)
(Alexandra & michaela)comenius week   tuesday (at the science park)(Alexandra & michaela)comenius week   tuesday (at the science park)
(Alexandra & michaela)comenius week tuesday (at the science park)Eva Rekkedal
 
8-Cümle Yorumlama
8-Cümle Yorumlama8-Cümle Yorumlama
8-Cümle Yorumlamayardimt
 
JDRQUEST + CO Newsletter
JDRQUEST + CO NewsletterJDRQUEST + CO Newsletter
JDRQUEST + CO Newsletterjoshuareich
 
Writing initiative pp sara duke - nov 2010
Writing initiative pp   sara duke - nov 2010Writing initiative pp   sara duke - nov 2010
Writing initiative pp sara duke - nov 2010Ed Ingman
 
Writing Presentation - Bob Wilson - Dec 2010
Writing Presentation - Bob Wilson - Dec 2010Writing Presentation - Bob Wilson - Dec 2010
Writing Presentation - Bob Wilson - Dec 2010Ed Ingman
 

Destaque (20)

Romanii pot face cariera
Romanii pot face carieraRomanii pot face cariera
Romanii pot face cariera
 
Mainstreaming the Disruption: Up-skilling for Online Learning
Mainstreaming the Disruption: Up-skilling for Online LearningMainstreaming the Disruption: Up-skilling for Online Learning
Mainstreaming the Disruption: Up-skilling for Online Learning
 
Adin Durumlari
Adin DurumlariAdin Durumlari
Adin Durumlari
 
Ym
YmYm
Ym
 
Biggest Hole On Earth
Biggest Hole On EarthBiggest Hole On Earth
Biggest Hole On Earth
 
Property Brochure
Property BrochureProperty Brochure
Property Brochure
 
School as Sustainable Enterprise
School as Sustainable EnterpriseSchool as Sustainable Enterprise
School as Sustainable Enterprise
 
Kökler ve ekler
Kökler ve eklerKökler ve ekler
Kökler ve ekler
 
Sfantul Valentin pe criza
Sfantul Valentin pe crizaSfantul Valentin pe criza
Sfantul Valentin pe criza
 
Motivation
MotivationMotivation
Motivation
 
Social media traning_for_mf_1
Social media traning_for_mf_1Social media traning_for_mf_1
Social media traning_for_mf_1
 
Spanish mystery
Spanish mysterySpanish mystery
Spanish mystery
 
Planning & Executing Successful Practices
Planning & Executing Successful PracticesPlanning & Executing Successful Practices
Planning & Executing Successful Practices
 
Hoe uw website aantrekkelijker maken ?
Hoe uw website aantrekkelijker maken ?Hoe uw website aantrekkelijker maken ?
Hoe uw website aantrekkelijker maken ?
 
(Alexandra & michaela)comenius week tuesday (at the science park)
(Alexandra & michaela)comenius week   tuesday (at the science park)(Alexandra & michaela)comenius week   tuesday (at the science park)
(Alexandra & michaela)comenius week tuesday (at the science park)
 
Update on GeoReadiness (Cole)
Update on GeoReadiness (Cole)Update on GeoReadiness (Cole)
Update on GeoReadiness (Cole)
 
8-Cümle Yorumlama
8-Cümle Yorumlama8-Cümle Yorumlama
8-Cümle Yorumlama
 
JDRQUEST + CO Newsletter
JDRQUEST + CO NewsletterJDRQUEST + CO Newsletter
JDRQUEST + CO Newsletter
 
Writing initiative pp sara duke - nov 2010
Writing initiative pp   sara duke - nov 2010Writing initiative pp   sara duke - nov 2010
Writing initiative pp sara duke - nov 2010
 
Writing Presentation - Bob Wilson - Dec 2010
Writing Presentation - Bob Wilson - Dec 2010Writing Presentation - Bob Wilson - Dec 2010
Writing Presentation - Bob Wilson - Dec 2010
 

Semelhante a Test First, Refresh Second: Web App TDD in Grails

점진적인 레거시 웹 애플리케이션 개선 과정
점진적인 레거시 웹 애플리케이션 개선 과정점진적인 레거시 웹 애플리케이션 개선 과정
점진적인 레거시 웹 애플리케이션 개선 과정Arawn Park
 
Profiling distributed Java applications
Profiling distributed Java applicationsProfiling distributed Java applications
Profiling distributed Java applicationsConstantine Slisenka
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and ToolsBob Paulin
 
Troubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineersTroubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineersDocker, Inc.
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneDroidConTLV
 
Marvel of Annotation Preprocessing in Java by Alexey Buzdin
Marvel of Annotation Preprocessing in Java by Alexey BuzdinMarvel of Annotation Preprocessing in Java by Alexey Buzdin
Marvel of Annotation Preprocessing in Java by Alexey BuzdinJava User Group Latvia
 
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
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
 
Programming proxies to do what we need so we don't have to talk to the networ...
Programming proxies to do what we need so we don't have to talk to the networ...Programming proxies to do what we need so we don't have to talk to the networ...
Programming proxies to do what we need so we don't have to talk to the networ...Lori MacVittie
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthDanno Ferrin
 
Selenium-online-training
Selenium-online-trainingSelenium-online-training
Selenium-online-trainingRaghav Arora
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVMSylvain Wallez
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard IntroductionAnthony Chen
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVMJohn Lee
 
如何建立企業級應用的商業規則引擎
如何建立企業級應用的商業規則引擎如何建立企業級應用的商業規則引擎
如何建立企業級應用的商業規則引擎CodeData
 
Securing Java EE Web Apps
Securing Java EE Web AppsSecuring Java EE Web Apps
Securing Java EE Web AppsFrank Kim
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Matthew McCullough
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyonddion
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-finalRuslan Meshenberg
 
Continuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWSContinuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWSDanilo Poccia
 

Semelhante a Test First, Refresh Second: Web App TDD in Grails (20)

점진적인 레거시 웹 애플리케이션 개선 과정
점진적인 레거시 웹 애플리케이션 개선 과정점진적인 레거시 웹 애플리케이션 개선 과정
점진적인 레거시 웹 애플리케이션 개선 과정
 
Profiling distributed Java applications
Profiling distributed Java applicationsProfiling distributed Java applications
Profiling distributed Java applications
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and Tools
 
Troubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineersTroubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineers
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
 
Marvel of Annotation Preprocessing in Java by Alexey Buzdin
Marvel of Annotation Preprocessing in Java by Alexey BuzdinMarvel of Annotation Preprocessing in Java by Alexey Buzdin
Marvel of Annotation Preprocessing in Java by Alexey Buzdin
 
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
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
Programming proxies to do what we need so we don't have to talk to the networ...
Programming proxies to do what we need so we don't have to talk to the networ...Programming proxies to do what we need so we don't have to talk to the networ...
Programming proxies to do what we need so we don't have to talk to the networ...
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In Depth
 
Selenium-online-training
Selenium-online-trainingSelenium-online-training
Selenium-online-training
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVM
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard Introduction
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 
如何建立企業級應用的商業規則引擎
如何建立企業級應用的商業規則引擎如何建立企業級應用的商業規則引擎
如何建立企業級應用的商業規則引擎
 
Securing Java EE Web Apps
Securing Java EE Web AppsSecuring Java EE Web Apps
Securing Java EE Web Apps
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-final
 
Continuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWSContinuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWS
 

Mais de Tim Berglund

Distributed Systems In One Lesson
Distributed Systems In One LessonDistributed Systems In One Lesson
Distributed Systems In One LessonTim Berglund
 
Decision Making in Software Teams
Decision Making in Software TeamsDecision Making in Software Teams
Decision Making in Software TeamsTim Berglund
 
Then our buildings shape us 10 minutes
Then our buildings shape us   10 minutesThen our buildings shape us   10 minutes
Then our buildings shape us 10 minutesTim Berglund
 
Complexity Theory and Software Development
Complexity Theory and Software DevelopmentComplexity Theory and Software Development
Complexity Theory and Software DevelopmentTim Berglund
 
Gaelyk: Lightweight Groovy on the Google App Engine
Gaelyk: Lightweight Groovy on the Google App EngineGaelyk: Lightweight Groovy on the Google App Engine
Gaelyk: Lightweight Groovy on the Google App EngineTim Berglund
 
Slaying The Legacy Dragon: Practical Lessons in Replacing Old Software
Slaying The Legacy Dragon: Practical Lessons in Replacing Old SoftwareSlaying The Legacy Dragon: Practical Lessons in Replacing Old Software
Slaying The Legacy Dragon: Practical Lessons in Replacing Old SoftwareTim Berglund
 
Test First Refresh Second: Test-Driven Development in Grails
Test First Refresh Second: Test-Driven Development in GrailsTest First Refresh Second: Test-Driven Development in Grails
Test First Refresh Second: Test-Driven Development in GrailsTim Berglund
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with LiquibaseTim Berglund
 
Database Refactoring With Liquibase
Database Refactoring With LiquibaseDatabase Refactoring With Liquibase
Database Refactoring With LiquibaseTim Berglund
 

Mais de Tim Berglund (10)

Distributed Systems In One Lesson
Distributed Systems In One LessonDistributed Systems In One Lesson
Distributed Systems In One Lesson
 
NoSQL Smackdown!
NoSQL Smackdown!NoSQL Smackdown!
NoSQL Smackdown!
 
Decision Making in Software Teams
Decision Making in Software TeamsDecision Making in Software Teams
Decision Making in Software Teams
 
Then our buildings shape us 10 minutes
Then our buildings shape us   10 minutesThen our buildings shape us   10 minutes
Then our buildings shape us 10 minutes
 
Complexity Theory and Software Development
Complexity Theory and Software DevelopmentComplexity Theory and Software Development
Complexity Theory and Software Development
 
Gaelyk: Lightweight Groovy on the Google App Engine
Gaelyk: Lightweight Groovy on the Google App EngineGaelyk: Lightweight Groovy on the Google App Engine
Gaelyk: Lightweight Groovy on the Google App Engine
 
Slaying The Legacy Dragon: Practical Lessons in Replacing Old Software
Slaying The Legacy Dragon: Practical Lessons in Replacing Old SoftwareSlaying The Legacy Dragon: Practical Lessons in Replacing Old Software
Slaying The Legacy Dragon: Practical Lessons in Replacing Old Software
 
Test First Refresh Second: Test-Driven Development in Grails
Test First Refresh Second: Test-Driven Development in GrailsTest First Refresh Second: Test-Driven Development in Grails
Test First Refresh Second: Test-Driven Development in Grails
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with Liquibase
 
Database Refactoring With Liquibase
Database Refactoring With LiquibaseDatabase Refactoring With Liquibase
Database Refactoring With Liquibase
 

Último

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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Último (20)

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
 
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)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Test First, Refresh Second: Web App TDD in Grails

Notas do Editor

  1. Test-driven development has reached the status of received orthodoxy. For my part, I don’t object to the idea of a right way of thinking, but in our line of work, we should watch ourselves. There are some people critical of the idea of testing first, and we should listen to them.
  2. One way to gauge the health of our community is to see what happens to people who don’t toe the line. We don’t want to burn them at the stake. We should listen to them. It’s especially easy to eschew testing in difficult environments, and some people do so. We should ask why.
  3. Small pieces of code tested in isolation from each other. Typically at the class or method level. Often uses practices like stubbing and mocking to effect isolation. Runs fast, particularly if the IDE has a test runner that doesn’t require booting a new JVM or rebuilding the world.
  4. Small pieces of code tested in isolation from each other. Typically at the class or method level. Often uses practices like stubbing and mocking to effect isolation. Runs fast, particularly if the IDE has a test runner that doesn’t require booting a new JVM or rebuilding the world.
  5. Multiple units tested together in collaboration. Usually implies testing our code with a live database and servlet container. Want to test actual ORM, page rendering, service layer, etc. Runs slower. Not suitable for TDD. Should be run by a build server.
  6. Multiple units tested together in collaboration. Usually implies testing our code with a live database and servlet container. Want to test actual ORM, page rendering, service layer, etc. Runs slower. Not suitable for TDD. Should be run by a build server.
  7. Multiple units tested together in collaboration. Usually implies testing our code with a live database and servlet container. Want to test actual ORM, page rendering, service layer, etc. Runs slower. Not suitable for TDD. Should be run by a build server.
  8. Testing features of the fully assembled system. Best to do in a story-driven fashion. Certainly slow, requires significant server infrastructure (compared to JUnit), should be run by a build server.
  9. Testing features of the fully assembled system. Best to do in a story-driven fashion. Certainly slow, requires significant server infrastructure (compared to JUnit), should be run by a build server.
  10. Testing features of the fully assembled system. Best to do in a story-driven fashion. Certainly slow, requires significant server infrastructure (compared to JUnit), should be run by a build server.
  11. Our main concern tonight will be unit tests. You really can’t do TDD with integration or functional tests, because they take too long to run. There are two things that are important when considering unit tests.
  12. These are code, not human procedures.
  13. Each unit test should make assertions about a small, coherent chunk of code. Moreover, it should not matter in what order we run them. Each should be fully responsible for creating the state it needs to run its code under test.
  14. Since they are executable, we should be able to have a computer run them very frequently.
  15. Let’s talk about isolation some more. It’s easy—or can be—when you’re writing APIs in core Java. It’s hard in a web app. Why is that? (DB, servlet container, browser, HTTP loop)
  16. Besides the web and database problems, we usually have problems related to integration points, since
  17. Besides the web and database problems, we usually have problems related to integration points, since
  18. Besides the web and database problems, we usually have problems related to integration points, since
  19. Besides the web and database problems, we usually have problems related to integration points, since
  20. Besides the web and database problems, we usually have problems related to integration points, since
  21. The Testing plugin was made a part of core Grails as of the 1.1 release. It revolutionized the way we can test Grails apps.
  22. These are extensions to GroovyTestCase, which is itself an extension to JUnit’s TestCase.