SlideShare a Scribd company logo
1 of 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/

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Recently uploaded (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Test First, Refresh Second: Web App TDD in Grails

Editor's Notes

  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.