SlideShare a Scribd company logo
TDD With Apache
                   Cassandra
Nate Mccall
@zznate
Hi.
We are talking about
two things...
1. Test Driven
Development
(TDD)
2. Apache Cassandra
...and how difficult it
is to put them
together
TDD
Unit testing
       (Integration Testing)
Unit Testing: F.I.R.S.T.
F ast
I solated
R epeatable
S elf-validating
T imely
Integration Testing
Run less often
Fewer of them
Cassandra
(not an acronym)
Distributed, high
performance
database
Two problems with
that...
1. “Distributed”
2. “Database”
Specifically
Configurations and
behavior tied to
environment
Heavy weight
resource
requirements
Failures difficult to
simulate
Oscon 2012 tdd_cassandra
Applying TDD
But first: a dirty
secret to share...
I’m Doing it wrong
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
3 minutes for one
module
The Culprit:
EmbeddedCassandraHelper
Easy to setup
Known state per test
Client setup is easy
Oscon 2012 tdd_cassandra
Slowwwww
Lots of fixture code
Hacking cassandra
 lifecycle
mvn install -DskipTests
mvn install -DskipTests

Fail.
How can I solve this?
“Refactoring tests”
Pro tip:
propose it as a
conference topic :)
So some time has
been weaseled...
What other tools are
available?
cassandra-maven-plugin
cassandra-unit
2nd dirty secret...
I’ve contributed to both
projects :(
Cassandra Unit
Easy data loading
   (no fixtures)
Multiple formats
Client setup provided
Cassandra instance in
  process
Slow on large data sets
External instance support
(not a pro for my use case)
Cassandra Maven Plugin
Cassandra(s) in forked
JVM(s)
Setup/teardown (still) in
maven lifecycle
Multi-node support FTW!
No easy means of loading
  bulk data
Code level fixtures
Manual client setup
Back to original issue
What to focus on first
1. Separate unit tests
from integration tests
Maven test plugins
Maven test plugins:
surefire
failsafe
Maven test plugins:
failfire
suresafe
Maven test plugins:
surefail
firesafe?
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
Failsafe:
For integration tests.
Keeps going even if there
 are failures
Failsafe:
Fails to make it easy to
find your mistake
Configuring
exclusions
Oscon 2012 tdd_cassandra
While i’m there...
Oscon 2012 tdd_cassandra
There’s got to be
more to do
Remember the Goals:
Avoid fixture code
No per-developer configs
Not in process
Is it just choosing
between different
tools?
You got your fixtures
in my plugin!
Cassandra-unit
      +
cassandra-maven-plugin
      =
    WIN
Benefits:
Maven lifecycle
No fixtures
RunListeners
@Rule for special case-ing
Maven configuration:
	 failsafe
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
Maven configuration:
	 Cassandra
Oscon 2012 tdd_cassandra
RunListener code
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
Parallel *allthethings*
I can has cluster!
$ sudo ifconfig lo0 alias 127.0.0.2 up
$ sudo ifconfig lo0 alias 127.0.0.3 up
$ sudo ifconfig lo0 alias 127.0.0.4 up
$ mvn cassandra:start-cluster 
cassandra:run
Next Steps...
Next Steps...
(am i really this psyched about
testing?)
Instrumentation...
Gradle
(or: How I sat next to Tim
Berglund at lunch)
Gradle
... found my next proposal :)
aws-java-sdk.jar
     +
cassandra launcher
     =
AWESOME
... yep, this one too.
Continue to contribute
Continue
to
Contribute
Questions?

More Related Content

What's hot (6)

Jdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsJdk Tools For Performance Diagnostics
Jdk Tools For Performance Diagnostics
Dror Bereznitsky
 
AVA - a futuristic test runner
AVA - a futuristic test runnerAVA - a futuristic test runner
AVA - a futuristic test runner
andreaslubbe
 
Just in Time Resourcing
Just in Time ResourcingJust in Time Resourcing
Just in Time Resourcing
ESUG
 
Speeding up your testflow
Speeding up your testflowSpeeding up your testflow
Speeding up your testflow
Mircea Mare
 
Whatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deploymentWhatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deployment
Christian Schwede
 
Thread priority in java
Thread priority in javaThread priority in java
Thread priority in java
Rakesh Mittal
 
Jdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsJdk Tools For Performance Diagnostics
Jdk Tools For Performance Diagnostics
Dror Bereznitsky
 
AVA - a futuristic test runner
AVA - a futuristic test runnerAVA - a futuristic test runner
AVA - a futuristic test runner
andreaslubbe
 
Just in Time Resourcing
Just in Time ResourcingJust in Time Resourcing
Just in Time Resourcing
ESUG
 
Speeding up your testflow
Speeding up your testflowSpeeding up your testflow
Speeding up your testflow
Mircea Mare
 
Whatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deploymentWhatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deployment
Christian Schwede
 
Thread priority in java
Thread priority in javaThread priority in java
Thread priority in java
Rakesh Mittal
 

Viewers also liked (20)

Successful Software Development with Apache Cassandra
Successful Software Development with Apache CassandraSuccessful Software Development with Apache Cassandra
Successful Software Development with Apache Cassandra
zznate
 
Apachecon cassandra transport
Apachecon cassandra transportApachecon cassandra transport
Apachecon cassandra transport
zznate
 
Strata west 2012_java_cassandra
Strata west 2012_java_cassandraStrata west 2012_java_cassandra
Strata west 2012_java_cassandra
zznate
 
Intravert atx meetup_condensed
Intravert atx meetup_condensedIntravert atx meetup_condensed
Intravert atx meetup_condensed
zznate
 
Ben Coverston - The Apache Cassandra Project
Ben Coverston - The Apache Cassandra ProjectBen Coverston - The Apache Cassandra Project
Ben Coverston - The Apache Cassandra Project
Morningstar Tech Talks
 
Planificación modelo TPACK
Planificación modelo TPACKPlanificación modelo TPACK
Planificación modelo TPACK
lucecita1
 
Jeanyveswelter
JeanyveswelterJeanyveswelter
Jeanyveswelter
Hammond
 
Cynthia A Ross Resume
Cynthia A Ross ResumeCynthia A Ross Resume
Cynthia A Ross Resume
CynRoss
 
先用再学 - 借助 XNA 快速开发游戏原型
先用再学  - 借助 XNA 快速开发游戏原型先用再学  - 借助 XNA 快速开发游戏原型
先用再学 - 借助 XNA 快速开发游戏原型
onlyfeng
 
Parkison Portfolio
Parkison PortfolioParkison Portfolio
Parkison Portfolio
Dan_Parkison
 
Planificación modelo TPACK
Planificación modelo TPACKPlanificación modelo TPACK
Planificación modelo TPACK
lucecita1
 
Cover It Live Training Presentation
Cover It Live Training PresentationCover It Live Training Presentation
Cover It Live Training Presentation
Britney Wright
 
Meetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbcMeetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbc
zznate
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
zznate
 
An Introduction to the Vert.x framework
An Introduction to the Vert.x frameworkAn Introduction to the Vert.x framework
An Introduction to the Vert.x framework
zznate
 
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
zznate
 
Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMX
zznate
 
Introduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_developeIntroduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_develope
zznate
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhg
zznate
 
Successful Software Development with Apache Cassandra
Successful Software Development with Apache CassandraSuccessful Software Development with Apache Cassandra
Successful Software Development with Apache Cassandra
zznate
 
Apachecon cassandra transport
Apachecon cassandra transportApachecon cassandra transport
Apachecon cassandra transport
zznate
 
Strata west 2012_java_cassandra
Strata west 2012_java_cassandraStrata west 2012_java_cassandra
Strata west 2012_java_cassandra
zznate
 
Intravert atx meetup_condensed
Intravert atx meetup_condensedIntravert atx meetup_condensed
Intravert atx meetup_condensed
zznate
 
Ben Coverston - The Apache Cassandra Project
Ben Coverston - The Apache Cassandra ProjectBen Coverston - The Apache Cassandra Project
Ben Coverston - The Apache Cassandra Project
Morningstar Tech Talks
 
Planificación modelo TPACK
Planificación modelo TPACKPlanificación modelo TPACK
Planificación modelo TPACK
lucecita1
 
Jeanyveswelter
JeanyveswelterJeanyveswelter
Jeanyveswelter
Hammond
 
Cynthia A Ross Resume
Cynthia A Ross ResumeCynthia A Ross Resume
Cynthia A Ross Resume
CynRoss
 
先用再学 - 借助 XNA 快速开发游戏原型
先用再学  - 借助 XNA 快速开发游戏原型先用再学  - 借助 XNA 快速开发游戏原型
先用再学 - 借助 XNA 快速开发游戏原型
onlyfeng
 
Parkison Portfolio
Parkison PortfolioParkison Portfolio
Parkison Portfolio
Dan_Parkison
 
Planificación modelo TPACK
Planificación modelo TPACKPlanificación modelo TPACK
Planificación modelo TPACK
lucecita1
 
Cover It Live Training Presentation
Cover It Live Training PresentationCover It Live Training Presentation
Cover It Live Training Presentation
Britney Wright
 
Meetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbcMeetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbc
zznate
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
zznate
 
An Introduction to the Vert.x framework
An Introduction to the Vert.x frameworkAn Introduction to the Vert.x framework
An Introduction to the Vert.x framework
zznate
 
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
zznate
 
Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMX
zznate
 
Introduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_developeIntroduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_develope
zznate
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhg
zznate
 

Similar to Oscon 2012 tdd_cassandra (20)

Automated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE ApplicationsAutomated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE Applications
Jelastic Multi-Cloud PaaS
 
MAVEN - Short documentation
MAVEN - Short documentationMAVEN - Short documentation
MAVEN - Short documentation
Holasz Kati
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
Testing Cassandra Guarantees under Diverse Failure Modes with Jepsen
Testing Cassandra Guarantees under Diverse Failure Modes with JepsenTesting Cassandra Guarantees under Diverse Failure Modes with Jepsen
Testing Cassandra Guarantees under Diverse Failure Modes with Jepsen
jkni
 
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With JepsenDataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax Academy
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
Kevin Harvey
 
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
Eric Smalling
 
JEEconf 2017
JEEconf 2017JEEconf 2017
JEEconf 2017
Ihor Kolodyuk
 
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
Jelastic Multi-Cloud PaaS
 
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Cωνσtantίnoς Giannoulis
 
Building and running cloud native cassandra
Building and running cloud native cassandraBuilding and running cloud native cassandra
Building and running cloud native cassandra
Vinay Kumar Chella
 
John Adams Puppet Camp 2010
John Adams Puppet Camp 2010John Adams Puppet Camp 2010
John Adams Puppet Camp 2010
Puppet
 
Dev Environments: The Next Generation
Dev Environments: The Next GenerationDev Environments: The Next Generation
Dev Environments: The Next Generation
Travis Thieman
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2
Shuji Watanabe
 
Zero to tested
Zero to testedZero to tested
Zero to tested
MagenTys
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Intro
boyw165
 
Rspec Tips
Rspec TipsRspec Tips
Rspec Tips
lionpeal
 
Security as Code: DOES15
Security as Code: DOES15Security as Code: DOES15
Security as Code: DOES15
Ed Bellis
 
SELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdfSELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdf
Eric Selje
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
Vadym Lotar
 
Automated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE ApplicationsAutomated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE Applications
Jelastic Multi-Cloud PaaS
 
MAVEN - Short documentation
MAVEN - Short documentationMAVEN - Short documentation
MAVEN - Short documentation
Holasz Kati
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
Testing Cassandra Guarantees under Diverse Failure Modes with Jepsen
Testing Cassandra Guarantees under Diverse Failure Modes with JepsenTesting Cassandra Guarantees under Diverse Failure Modes with Jepsen
Testing Cassandra Guarantees under Diverse Failure Modes with Jepsen
jkni
 
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With JepsenDataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax Academy
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
Kevin Harvey
 
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
Eric Smalling
 
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017
Jelastic Multi-Cloud PaaS
 
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Cωνσtantίnoς Giannoulis
 
Building and running cloud native cassandra
Building and running cloud native cassandraBuilding and running cloud native cassandra
Building and running cloud native cassandra
Vinay Kumar Chella
 
John Adams Puppet Camp 2010
John Adams Puppet Camp 2010John Adams Puppet Camp 2010
John Adams Puppet Camp 2010
Puppet
 
Dev Environments: The Next Generation
Dev Environments: The Next GenerationDev Environments: The Next Generation
Dev Environments: The Next Generation
Travis Thieman
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2
Shuji Watanabe
 
Zero to tested
Zero to testedZero to tested
Zero to tested
MagenTys
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Intro
boyw165
 
Rspec Tips
Rspec TipsRspec Tips
Rspec Tips
lionpeal
 
Security as Code: DOES15
Security as Code: DOES15Security as Code: DOES15
Security as Code: DOES15
Ed Bellis
 
SELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdfSELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdf
Eric Selje
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
Vadym Lotar
 

More from zznate (7)

Hardening cassandra q2_2016
Hardening cassandra q2_2016Hardening cassandra q2_2016
Hardening cassandra q2_2016
zznate
 
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiaSeattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
zznate
 
Software Development with Apache Cassandra
Software Development with Apache CassandraSoftware Development with Apache Cassandra
Software Development with Apache Cassandra
zznate
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
zznate
 
Stampede con 2014 cassandra in the real world
Stampede con 2014   cassandra in the real worldStampede con 2014   cassandra in the real world
Stampede con 2014 cassandra in the real world
zznate
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cql
zznate
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
zznate
 
Hardening cassandra q2_2016
Hardening cassandra q2_2016Hardening cassandra q2_2016
Hardening cassandra q2_2016
zznate
 
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiaSeattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
zznate
 
Software Development with Apache Cassandra
Software Development with Apache CassandraSoftware Development with Apache Cassandra
Software Development with Apache Cassandra
zznate
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
zznate
 
Stampede con 2014 cassandra in the real world
Stampede con 2014   cassandra in the real worldStampede con 2014   cassandra in the real world
Stampede con 2014 cassandra in the real world
zznate
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cql
zznate
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
zznate
 

Recently uploaded (20)

TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 

Oscon 2012 tdd_cassandra

Editor's Notes

  • #2: \n
  • #3: I’m Nate McCall, I’m platform development lead for the usergrid product at Apigee\n
  • #4: I’m here to talk about just two things really...\n
  • #5: \n
  • #6: \n
  • #7: \n
  • #8: What is it? Well, by itself it can (and does) take up it’s own talk. But for a gross generalization, well start here.\n
  • #9: When we talk test driven devlopment, we are really talking about unit testing code. We’ll talk about integration testing too, since that’s really what we care about for our case, but we’ll treat them as separate for now\n
  • #10: Again, we don’t have much time, so I’m not going to go into this except to emphasize some of the core rules of unit testing. Another way to think about this is that unit testing is a method by which the smallest testable part of an application is validated. \n
  • #11: Basically we want tests to be: fast, Isolated, Repeatable , Self-Validated (in that it asserts a condition ) and Timely (which really means we write them first so they stay in sync with the code).\n
  • #12: For integration testing, we mean interfacing with external systems or processes really, to validate that components integrate correctly. pretty straight forward.\n
  • #13: Generally there are fewer of them and, ideally, we run them less often because they are far more expensive\n
  • #14: \n
  • #15: \n
  • #16: \n
  • #17: For us, and are requirements here, there are 2 problems with that\n
  • #18: Inherently makes it difficutlt to test locally. One of the things i really want to avoid is having developers needing to manage their own internal or external clusters of cassandra\n
  • #19: It’s a service. Thus it’s an integration test. \n
  • #20: To specific, here are some details.\n
  • #21: Every operation sends whats called a ConsistencyLevel - essentially the level of sfety of an op\n
  • #22: \n
  • #23: \n
  • #24: Writing for the key “P” then the primary node is down. The remaining replicas capture the a hint which will be “replayed” to the down node when it comes back. In a smaller cluster where a quorum is not possible, these operations would return an exception to the caller. Obviously this become difficult to test for\n\n\n
  • #25: So we’re here to talk about applying test driven development to apache cassandra. I’m going to do this in a way that’s a little different\n
  • #26: \n
  • #27: I’m doing it wrong. \n
  • #28: Here’s some output from a run of ‘mvn test’ on one module of the Usergrid codebase. Seems Typical. Tests ran, the passed, etc. But if we look a little closer...\n
  • #29: We see some serious ugly.\n
  • #30: I’ll be frank, that sucks.\n
  • #31: This \n
  • #32: \n
  • #33: \n
  • #34: \n
  • #35: The worst result of all of this is that you end up in this situation in order just to get things completed. \n
  • #36: If you do this, you will miss bugs. You will tie up cycles hunting down ‘blames’ on continous integration failures. The worst part about this is that it discourages test driven development in the first place. I’ve done this and it’s turned around to bite me.\n
  • #37: So we’re in this situation - how do we get out of it? Taking this to the suits and trying to get time for it is extremely difficult.\n
  • #38: Say that at your next priority meeting\n
  • #39: This is a shockingly easy way to disquise a ton of refactoring work in “preparing for a conference”\n
  • #40: \n
  • #41: The first thing I needed to do was get a handle again on the test framework landscape without causing too much trauma to the code. \n
  • #42: There’s really two way to approach this other than EmbeddedCassandraHelper. These two have been around for a year and are relatively stable and track recent cassandra releases.\n
  • #43: \n
  • #44: I should know better. I really should. \n
  • #45: So let’s take a look at cassandra unit\n
  • #46: The benefits are pretty straight forward\n
  • #47: A couple of cons though. External instances is not going to work with one of my main requirements\n
  • #48: Now cassandra maven plugin. Precisely what it says on the tin really, it’s a maven plugin designed to control cassandra instances. \n
  • #49: Essentially, you can use maven to fork one or more cassandra instances in their own jvms. If you’ve never soon JVM forking in the wild, cassandra-maven-plugin is a decent example of using the commons-exec utility from the Apache Commons project\n
  • #50: Thats great, but there’s some things missing\n
  • #51: We need to speed up the test cycle so we dont throw the skipTest flag and miss bugs.\n
  • #52: There is some low hanging fruit to address here that could speed things up for utility and mock-based test cases. \n
  • #53: Basically things that are not integration tests. \nBy doing this, we can isolate those different requirements, inherently cutting time out of the test process.\n
  • #54: There are two primary plugins used for test integration with maven. One is designed for unit testing, the other for integration testing.\n
  • #55: If you get these confused your not alone. Who knows which is which?\n
  • #56: \n
  • #57: the names are not terribly descriptive. The documentation does not help much.\n
  • #58: Even better: here is the surefire page. Note the URL, as this next slide is not very different.\n
  • #59: Here is the failsafe page. Note the typos. They did manage one of out 3 find/replaces though. Note: I plan on submitting a patch to the site docs this evening to fix this. \n
  • #60: Basically. The failsafe plugin is for integration testing.\n
  • #61: Because failsafe is designed to continue after failures, here’s an easy way to remember that failsafe is for integration testing. \n
  • #62: \n
  • #63: Spend some time renaming to facilitate the Unit/integration test separation\n
  • #64: Once you do this, there are some additional tweaks to really boost performance on test designed along FIRST guidelines\n
  • #65: \n
  • #66: The easy stuff’s out of the way, and we’ve shave some time off - particularly for the utility code. What else can we do?\n
  • #67: Let’s look at our goals again... \n
  • #68: \n
  • #69: No. We can combine them.\n
  • #70: \n
  • #71: T\n
  • #72: \n
  • #73: Will see an example of this in a minute, but we need to attach a listener to the the build process to get this to fire off correct.\n
  • #74: Here we are binding failsafe to the integration and verify phase\n
  • #75: This configures our naming scheme - opposite of the surefire configuration - to run only the unit tests. We also have a regex on the bottom to exclude our RunListener from being invoked as a test case.\n
  • #76: \n
  • #77: Really straight forward. All configurations are handled by default for the simple cases, we only specify start and stop in order to bind to the integration and verify phases above.\n
  • #78: \n
  • #79: \n
  • #80: \n
  • #81: \n
  • #82: \n
  • #83: \n
  • #84: \n
  • #85: \n
  • #86: \n
  • #87: \n
  • #88: \n
  • #89: \n
  • #90: \n
  • #91: \n
  • #92: \n
  • #93: \n
  • #94: \n
  • #95: \n