SlideShare a Scribd company logo
T       O
    f
Rb W r      Joseph Wilk
W     ’
R b   fr   ?
Sr         ...

N R b             .

  R     .
“The number of languages you know
 corresponds to your programming
               skill”


           S
Y ... T
JUnit             ScrewUnit
Rspec             JBehave
PHPSpec           Jasmine
JSpec             Cucumber
Circumspec        BlahSpec
SomethingSpec     WhateverSpec
Y ... T
JUnit             ScrewUnit
Rspec               BORING!
                  JBehave
PHPSpec           Jasmine
JSpec             Cucumber
Circumspec        BlahSpec
SomethingSpec     WhateverSpec
T              &M
Ruby

Monkey.stub!(:new).and_return(mock("monkey"))



Java

I owe you one Java mocking example.

I don’t have the will power to write it.
Sorry.
T              &M
Ruby
                                 BORING!
Monkey.stub!(:new).and_return(mock("monkey"))



Java

I owe you one Java mocking example.

I don’t have the will power to write it.
Sorry.
I    r
  Asynchronous            Property testing


Permutation                      Model testing
explosions


  Metrics                       Test feedback


              Graphical tests
H
    Curry
“Program testing can be used to show the
presence of bugs, but never to show their
absence!”
                             Edsger Dijkstra
Q               C
               Properties



For all values of s the length of the thing
returned by five_random_characters is 5
Q         C
            Properties

            QuickCheck

            Randomly
Logic        generate    Function
               tests
Q         C
            Properties

            QuickCheck

            Randomly
Logic        generate    Function
               tests
Q         C
            Properties

            QuickCheck

            Randomly
Logic        generate    Function
               tests
Q         C
            Properties

            QuickCheck

            Randomly
Logic        generate    Function
               tests
Q         C
            Properties

            QuickCheck

            Randomly
Logic        generate    Function
               tests


                          Counter
                         Examples
Q              C
                     Properties


it "should reverse a string" do
  "monkeys".reverse.reverse.should == "monkeys"
end


100.times.map {“#{rand(10)}#{rand(10)}”}.each do |char|
  it "should reverse a string" do
    char.reverse.reverse.should == char
  end
end
Q             C
                    Properties

import Data.Char
import Test.QuickCheck

instance Arbitrary Char where
  arbitrary     = choose ('32', '128')
  coarbitrary c = variant (ord c `rem` 4)


prop_RevRev xs = reverse (reverse xs) == xs
  where types = xs::[Char]


$ Main> quickCheck prop_RevRev
OK, passed 100 tests.
Er
      Messaging/
     Concurrency
M Er   Models

    Erlang               McErlang
   runtime               runtime
    system                system


communication

 concurrency

 distribution
M Er Models



message       Messenger
                               “Scottish
“Scottish      Service
                               fiction”
fiction”




 Message    login    login   Message
  client                      client


  Fred                       Clara
M Er      Models
if user1 does not send a message m to user2 until user2 is logged on,
then
  if user1 does send a message m to user2
then
  eventually user2 receives the message m.


  "not P until Q => (eventually P => eventually R)”

  P: clara sends message “Scottish fiction” to fred
  Q: fred is logged on
  R: fred receives the message “Scottish fiction” from clara
M Er    Models
{program={scenario,start,[[
[{logon,clara},{message,fred,"hi"},logoff],
[{logon,fred},logoff]]]},

monitor={mce_ltl_parse:ltl_string2module_and_load
("not P until Q implies (eventually P implies
eventually R)", messenger_mon),
{void,[{'P',basicPredicates:message_to
(clara,fred,"hi")},
       {'Q',basicPredicates:logon(fred)},
       {'R',basicPredicates:message_received
(fred,clara,"hi")}]}},
  algorithm={mce_alg_buechi,void}}).
“Every method you use to prevent or find
bugs leaves a residue of subtler bugs against
which those methods are ineffectual

                         Pesticide Paradox / Beizer
C   r
    Bracket
      hell
M
                      Facts

(fact
 (alive-in-next-generation? ...cell...) => truthy
   (provided
    (alive? ...cell...) => false
    (neighbor-count ...cell...) => 3))




cell = mock("a cell")
cell.stub(:alive?).and_return(false)
cell.stub(:neighbour_count).and_return(3)

cell.alive_in_next_generation.should == true
I
    Brief visit
I
Specs are documentation
I
Specs are documentation
J v S rp
     Without
     the Java
Z        b .
Trapped inside a browser
Z           b .
               Trapped inside a browser
var zombie = require("zombie");
var assert = require("assert");

zombie.visit("http://localhost:3000/",
              function (err, browser, status) {

  browser.
    fill("email", "zombie@underworld.dead").
    pressButton("Sign Me Up!",
      function(err, browser, status) {

           assert.equal(browser.text("title"), "Welcome");
      })
});
V w
                    Topics


{ topic: function () { return 42 },

    'should be a number': function (topic) {
       assert.isNumber (topic);
    },
    'should be equal to 42': function (topic) {
       assert.equal (topic, 42);
    }
}
V w
                 Asynchronous calls


{ topic: function () {
     fs.stat('~/FILE', this.callback);
  },
  'can be accessed': function (err, stat) {
     assert.isNull   (err);        // We have no error
     assert.isObject (stat);       // We have a stat object
  },
  'is not empty': function (err, stat) {
     assert.isNotZero (stat.size); // The file size is > 0
  }
}
V w
                 Promises / Futures
{ topic: function () {
     var promise = new(events.EventEmitter);
     fs.stat('~/FILE', function (e, res) {
         if (e) { promise.emit('error', e) }
         else   { promise.emit('success', res) }
     });
     return promise;
  },
  'can be accessed': function (err, stat) {
     assert.isNull   (err);        //We have no error
     assert.isObject (stat);       //We have a stat object
  },
  'is not empty': function (err, stat) {
     assert.isNotZero (stat.size); //The file size is > 0
  }
}
V w
                          Parallel Execution

{ '/dev/stdout': {
     topic:    function   () { path.exists('/dev/stdout',this.callback) },
     'exists': function   (result) { assert.isTrue(result) }
  },
  '/dev/tty': {
     topic:    function   () { path.exists('/dev/tty',this.callback) },
     'exists': function   (result) { assert.isTrue(result) }
  },
  '/dev/null': {
     topic:    function   () { path.exists('/dev/null',this.callback) },
     'exists': function   (result) { assert.isTrue(result) }
  }
}
T Sw r
Permutation Explosion
T Sw r
Permutation Explosion
J v
      Really
J       M
Faster Test feedback


            Failures are not
            randomly distributed




            Lots of very short tests
            A few very long ones




                                   Kent Beck
J       M
Faster Test feedback
I         r     L
    Learn from Metrics
O   r             ff
        dessert
‘‘What is the use of a book,’’ thought Alice,
‘‘without pictures or conversations?’’

                                        Lewis Carroll
                   Alice’s Adventures in Wonderland
Sw       L
Words are not enough




                   Ward Cunningham
http://vimeo.com/22165070



                   Ward Cunningham
Gr p   T




           Brian Marick
‘‘How much do you know about the
           heuristics of failure?’

                                                    Joseph Wilk
                                        Scotland Ruby Conf 2011




http://testobsessed.com/wp-content/uploads/2007/02/testheuristicscheatsheetv1.pdf
T   I
Joseph Wilk
                             !
      @josephwilk
http://blog.josephwilk.net
Ad

More Related Content

What's hot (20)

From dot net_to_rails
From dot net_to_railsFrom dot net_to_rails
From dot net_to_rails
pythonandchips
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
Workhorse Computing
 
Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
Bartosz Kosarzycki
 
Smoking docker
Smoking dockerSmoking docker
Smoking docker
Workhorse Computing
 
Getting Testy With Perl6
Getting Testy With Perl6Getting Testy With Perl6
Getting Testy With Perl6
Workhorse Computing
 
Getting testy with Perl
Getting testy with PerlGetting testy with Perl
Getting testy with Perl
Workhorse Computing
 
High Performance web apps in Om, React and ClojureScript
High Performance web apps in Om, React and ClojureScriptHigh Performance web apps in Om, React and ClojureScript
High Performance web apps in Om, React and ClojureScript
Leonardo Borges
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
HamletDRC
 
The algebra of library design
The algebra of library designThe algebra of library design
The algebra of library design
Leonardo Borges
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)
HamletDRC
 
Testing untestable code - IPC12
Testing untestable code - IPC12Testing untestable code - IPC12
Testing untestable code - IPC12
Stephan Hochdörfer
 
Develop your next app with kotlin @ AndroidMakersFr 2017
Develop your next app with kotlin @ AndroidMakersFr 2017Develop your next app with kotlin @ AndroidMakersFr 2017
Develop your next app with kotlin @ AndroidMakersFr 2017
Arnaud Giuliani
 
Kotlin in action
Kotlin in actionKotlin in action
Kotlin in action
Ciro Rizzo
 
Effective Benchmarks
Effective BenchmarksEffective Benchmarks
Effective Benchmarks
Workhorse Computing
 
Kotlin cheat sheet by ekito
Kotlin cheat sheet by ekitoKotlin cheat sheet by ekito
Kotlin cheat sheet by ekito
Arnaud Giuliani
 
Gatling - Paris Perf User Group
Gatling - Paris Perf User GroupGatling - Paris Perf User Group
Gatling - Paris Perf User Group
slandelle
 
Kotlin hands on - MorningTech ekito 2017
Kotlin hands on - MorningTech ekito 2017Kotlin hands on - MorningTech ekito 2017
Kotlin hands on - MorningTech ekito 2017
Arnaud Giuliani
 
TMPA-2015: Kotlin: From Null Dereference to Smart Casts
TMPA-2015: Kotlin: From Null Dereference to Smart CastsTMPA-2015: Kotlin: From Null Dereference to Smart Casts
TMPA-2015: Kotlin: From Null Dereference to Smart Casts
Iosif Itkin
 
Bytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASMBytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASM
ashleypuls
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
Workhorse Computing
 
Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
Bartosz Kosarzycki
 
High Performance web apps in Om, React and ClojureScript
High Performance web apps in Om, React and ClojureScriptHigh Performance web apps in Om, React and ClojureScript
High Performance web apps in Om, React and ClojureScript
Leonardo Borges
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
HamletDRC
 
The algebra of library design
The algebra of library designThe algebra of library design
The algebra of library design
Leonardo Borges
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)
HamletDRC
 
Develop your next app with kotlin @ AndroidMakersFr 2017
Develop your next app with kotlin @ AndroidMakersFr 2017Develop your next app with kotlin @ AndroidMakersFr 2017
Develop your next app with kotlin @ AndroidMakersFr 2017
Arnaud Giuliani
 
Kotlin in action
Kotlin in actionKotlin in action
Kotlin in action
Ciro Rizzo
 
Kotlin cheat sheet by ekito
Kotlin cheat sheet by ekitoKotlin cheat sheet by ekito
Kotlin cheat sheet by ekito
Arnaud Giuliani
 
Gatling - Paris Perf User Group
Gatling - Paris Perf User GroupGatling - Paris Perf User Group
Gatling - Paris Perf User Group
slandelle
 
Kotlin hands on - MorningTech ekito 2017
Kotlin hands on - MorningTech ekito 2017Kotlin hands on - MorningTech ekito 2017
Kotlin hands on - MorningTech ekito 2017
Arnaud Giuliani
 
TMPA-2015: Kotlin: From Null Dereference to Smart Casts
TMPA-2015: Kotlin: From Null Dereference to Smart CastsTMPA-2015: Kotlin: From Null Dereference to Smart Casts
TMPA-2015: Kotlin: From Null Dereference to Smart Casts
Iosif Itkin
 
Bytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASMBytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASM
ashleypuls
 

Similar to Testing outside of the Ruby World (20)

introduction to javascript concepts .ppt
introduction to javascript concepts .pptintroduction to javascript concepts .ppt
introduction to javascript concepts .ppt
ansariparveen06
 
fundamentals of JavaScript for students.ppt
fundamentals of JavaScript for students.pptfundamentals of JavaScript for students.ppt
fundamentals of JavaScript for students.ppt
dejen6
 
Basics of Javascript
Basics of JavascriptBasics of Javascript
Basics of Javascript
Universe41
 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-Tuesday
Eddie Kao
 
A Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert FornalA Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert Fornal
QA or the Highway
 
Maintainable JavaScript
Maintainable JavaScriptMaintainable JavaScript
Maintainable JavaScript
Nicholas Zakas
 
Anatomy of a Reactive Application
Anatomy of a Reactive ApplicationAnatomy of a Reactive Application
Anatomy of a Reactive Application
Mark Wilson
 
Scala Programming for Semantic Web Developers ESWC Semdev2015
Scala Programming for Semantic Web Developers ESWC Semdev2015Scala Programming for Semantic Web Developers ESWC Semdev2015
Scala Programming for Semantic Web Developers ESWC Semdev2015
Jean-Paul Calbimonte
 
Computational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in RComputational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in R
herbps10
 
Lagergren jvmls-2013-final
Lagergren jvmls-2013-finalLagergren jvmls-2013-final
Lagergren jvmls-2013-final
Marcus Lagergren
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
Workhorse Computing
 
Concurrency on the JVM
Concurrency on the JVMConcurrency on the JVM
Concurrency on the JVM
Vaclav Pech
 
Javascript status 2016
Javascript status 2016Javascript status 2016
Javascript status 2016
Arshavski Alexander
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
BeScala
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016
Ben Lesh
 
Designing with Groovy Traits - Gr8Conf India
Designing with Groovy Traits - Gr8Conf IndiaDesigning with Groovy Traits - Gr8Conf India
Designing with Groovy Traits - Gr8Conf India
Naresha K
 
IntroTestMore
IntroTestMoreIntroTestMore
IntroTestMore
tutorialsruby
 
IntroTestMore
IntroTestMoreIntroTestMore
IntroTestMore
tutorialsruby
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka features
Grzegorz Duda
 
How to not write a boring test in Golang
How to not write a boring test in GolangHow to not write a boring test in Golang
How to not write a boring test in Golang
Dan Tran
 
introduction to javascript concepts .ppt
introduction to javascript concepts .pptintroduction to javascript concepts .ppt
introduction to javascript concepts .ppt
ansariparveen06
 
fundamentals of JavaScript for students.ppt
fundamentals of JavaScript for students.pptfundamentals of JavaScript for students.ppt
fundamentals of JavaScript for students.ppt
dejen6
 
Basics of Javascript
Basics of JavascriptBasics of Javascript
Basics of Javascript
Universe41
 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-Tuesday
Eddie Kao
 
A Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert FornalA Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert Fornal
QA or the Highway
 
Maintainable JavaScript
Maintainable JavaScriptMaintainable JavaScript
Maintainable JavaScript
Nicholas Zakas
 
Anatomy of a Reactive Application
Anatomy of a Reactive ApplicationAnatomy of a Reactive Application
Anatomy of a Reactive Application
Mark Wilson
 
Scala Programming for Semantic Web Developers ESWC Semdev2015
Scala Programming for Semantic Web Developers ESWC Semdev2015Scala Programming for Semantic Web Developers ESWC Semdev2015
Scala Programming for Semantic Web Developers ESWC Semdev2015
Jean-Paul Calbimonte
 
Computational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in RComputational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in R
herbps10
 
Lagergren jvmls-2013-final
Lagergren jvmls-2013-finalLagergren jvmls-2013-final
Lagergren jvmls-2013-final
Marcus Lagergren
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
Workhorse Computing
 
Concurrency on the JVM
Concurrency on the JVMConcurrency on the JVM
Concurrency on the JVM
Vaclav Pech
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
BeScala
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016
Ben Lesh
 
Designing with Groovy Traits - Gr8Conf India
Designing with Groovy Traits - Gr8Conf IndiaDesigning with Groovy Traits - Gr8Conf India
Designing with Groovy Traits - Gr8Conf India
Naresha K
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka features
Grzegorz Duda
 
How to not write a boring test in Golang
How to not write a boring test in GolangHow to not write a boring test in Golang
How to not write a boring test in Golang
Dan Tran
 
Ad

More from Joseph Wilk (16)

Frozenrails2011
Frozenrails2011Frozenrails2011
Frozenrails2011
Joseph Wilk
 
Acceptance testing in the land of the startup
Acceptance testing in the land of the startup Acceptance testing in the land of the startup
Acceptance testing in the land of the startup
Joseph Wilk
 
Rubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talkRubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talk
Joseph Wilk
 
The Limited Red Society
The Limited Red SocietyThe Limited Red Society
The Limited Red Society
Joseph Wilk
 
The Limited Red Society
The Limited Red Society The Limited Red Society
The Limited Red Society
Joseph Wilk
 
Spa2011
Spa2011Spa2011
Spa2011
Joseph Wilk
 
Rubyconf lightning talk
Rubyconf lightning talkRubyconf lightning talk
Rubyconf lightning talk
Joseph Wilk
 
Acceptance testing in the land of the startup
Acceptance testing in the land of the startupAcceptance testing in the land of the startup
Acceptance testing in the land of the startup
Joseph Wilk
 
Cucumber Patterns Workshop
Cucumber Patterns WorkshopCucumber Patterns Workshop
Cucumber Patterns Workshop
Joseph Wilk
 
Musichackday
MusichackdayMusichackday
Musichackday
Joseph Wilk
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
Joseph Wilk
 
Cucumber Ru09 Web
Cucumber Ru09 WebCucumber Ru09 Web
Cucumber Ru09 Web
Joseph Wilk
 
Cucumbered
CucumberedCucumbered
Cucumbered
Joseph Wilk
 
Dynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the StringsDynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the Strings
Joseph Wilk
 
Outside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and RspecOutside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and Rspec
Joseph Wilk
 
Testing with Ruby
Testing with RubyTesting with Ruby
Testing with Ruby
Joseph Wilk
 
Acceptance testing in the land of the startup
Acceptance testing in the land of the startup Acceptance testing in the land of the startup
Acceptance testing in the land of the startup
Joseph Wilk
 
Rubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talkRubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talk
Joseph Wilk
 
The Limited Red Society
The Limited Red SocietyThe Limited Red Society
The Limited Red Society
Joseph Wilk
 
The Limited Red Society
The Limited Red Society The Limited Red Society
The Limited Red Society
Joseph Wilk
 
Rubyconf lightning talk
Rubyconf lightning talkRubyconf lightning talk
Rubyconf lightning talk
Joseph Wilk
 
Acceptance testing in the land of the startup
Acceptance testing in the land of the startupAcceptance testing in the land of the startup
Acceptance testing in the land of the startup
Joseph Wilk
 
Cucumber Patterns Workshop
Cucumber Patterns WorkshopCucumber Patterns Workshop
Cucumber Patterns Workshop
Joseph Wilk
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
Joseph Wilk
 
Cucumber Ru09 Web
Cucumber Ru09 WebCucumber Ru09 Web
Cucumber Ru09 Web
Joseph Wilk
 
Dynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the StringsDynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the Strings
Joseph Wilk
 
Outside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and RspecOutside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and Rspec
Joseph Wilk
 
Testing with Ruby
Testing with RubyTesting with Ruby
Testing with Ruby
Joseph Wilk
 
Ad

Recently uploaded (20)

Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
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
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
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
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
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
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
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
 
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
 
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
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
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
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
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
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
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
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
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
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
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
 
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
 
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
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
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
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 

Testing outside of the Ruby World

  • 1. T O f Rb W r Joseph Wilk
  • 2. W ’ R b fr ?
  • 3. Sr ... N R b . R .
  • 4. “The number of languages you know corresponds to your programming skill” S
  • 5. Y ... T JUnit ScrewUnit Rspec JBehave PHPSpec Jasmine JSpec Cucumber Circumspec BlahSpec SomethingSpec WhateverSpec
  • 6. Y ... T JUnit ScrewUnit Rspec BORING! JBehave PHPSpec Jasmine JSpec Cucumber Circumspec BlahSpec SomethingSpec WhateverSpec
  • 7. T &M Ruby Monkey.stub!(:new).and_return(mock("monkey")) Java I owe you one Java mocking example. I don’t have the will power to write it. Sorry.
  • 8. T &M Ruby BORING! Monkey.stub!(:new).and_return(mock("monkey")) Java I owe you one Java mocking example. I don’t have the will power to write it. Sorry.
  • 9. I r Asynchronous Property testing Permutation Model testing explosions Metrics Test feedback Graphical tests
  • 10. H Curry
  • 11. “Program testing can be used to show the presence of bugs, but never to show their absence!” Edsger Dijkstra
  • 12. Q C Properties For all values of s the length of the thing returned by five_random_characters is 5
  • 13. Q C Properties QuickCheck Randomly Logic generate Function tests
  • 14. Q C Properties QuickCheck Randomly Logic generate Function tests
  • 15. Q C Properties QuickCheck Randomly Logic generate Function tests
  • 16. Q C Properties QuickCheck Randomly Logic generate Function tests
  • 17. Q C Properties QuickCheck Randomly Logic generate Function tests Counter Examples
  • 18. Q C Properties it "should reverse a string" do "monkeys".reverse.reverse.should == "monkeys" end 100.times.map {“#{rand(10)}#{rand(10)}”}.each do |char| it "should reverse a string" do char.reverse.reverse.should == char end end
  • 19. Q C Properties import Data.Char import Test.QuickCheck instance Arbitrary Char where arbitrary = choose ('32', '128') coarbitrary c = variant (ord c `rem` 4) prop_RevRev xs = reverse (reverse xs) == xs where types = xs::[Char] $ Main> quickCheck prop_RevRev OK, passed 100 tests.
  • 20. Er Messaging/ Concurrency
  • 21. M Er Models Erlang McErlang runtime runtime system system communication concurrency distribution
  • 22. M Er Models message Messenger “Scottish “Scottish Service fiction” fiction” Message login login Message client client Fred Clara
  • 23. M Er Models if user1 does not send a message m to user2 until user2 is logged on, then if user1 does send a message m to user2 then eventually user2 receives the message m. "not P until Q => (eventually P => eventually R)” P: clara sends message “Scottish fiction” to fred Q: fred is logged on R: fred receives the message “Scottish fiction” from clara
  • 24. M Er Models {program={scenario,start,[[ [{logon,clara},{message,fred,"hi"},logoff], [{logon,fred},logoff]]]}, monitor={mce_ltl_parse:ltl_string2module_and_load ("not P until Q implies (eventually P implies eventually R)", messenger_mon), {void,[{'P',basicPredicates:message_to (clara,fred,"hi")}, {'Q',basicPredicates:logon(fred)}, {'R',basicPredicates:message_received (fred,clara,"hi")}]}}, algorithm={mce_alg_buechi,void}}).
  • 25. “Every method you use to prevent or find bugs leaves a residue of subtler bugs against which those methods are ineffectual Pesticide Paradox / Beizer
  • 26. C r Bracket hell
  • 27. M Facts (fact  (alive-in-next-generation? ...cell...) => truthy    (provided     (alive? ...cell...) => false     (neighbor-count ...cell...) => 3)) cell = mock("a cell") cell.stub(:alive?).and_return(false) cell.stub(:neighbour_count).and_return(3) cell.alive_in_next_generation.should == true
  • 28. I Brief visit
  • 31. J v S rp Without the Java
  • 32. Z b . Trapped inside a browser
  • 33. Z b . Trapped inside a browser var zombie = require("zombie"); var assert = require("assert"); zombie.visit("http://localhost:3000/", function (err, browser, status) { browser. fill("email", "[email protected]"). pressButton("Sign Me Up!", function(err, browser, status) { assert.equal(browser.text("title"), "Welcome"); }) });
  • 34. V w Topics { topic: function () { return 42 }, 'should be a number': function (topic) { assert.isNumber (topic); }, 'should be equal to 42': function (topic) { assert.equal (topic, 42); } }
  • 35. V w Asynchronous calls { topic: function () { fs.stat('~/FILE', this.callback); }, 'can be accessed': function (err, stat) { assert.isNull (err); // We have no error assert.isObject (stat); // We have a stat object }, 'is not empty': function (err, stat) { assert.isNotZero (stat.size); // The file size is > 0 } }
  • 36. V w Promises / Futures { topic: function () { var promise = new(events.EventEmitter); fs.stat('~/FILE', function (e, res) { if (e) { promise.emit('error', e) } else { promise.emit('success', res) } }); return promise; }, 'can be accessed': function (err, stat) { assert.isNull (err); //We have no error assert.isObject (stat); //We have a stat object }, 'is not empty': function (err, stat) { assert.isNotZero (stat.size); //The file size is > 0 } }
  • 37. V w Parallel Execution { '/dev/stdout': { topic: function () { path.exists('/dev/stdout',this.callback) }, 'exists': function (result) { assert.isTrue(result) } }, '/dev/tty': { topic: function () { path.exists('/dev/tty',this.callback) }, 'exists': function (result) { assert.isTrue(result) } }, '/dev/null': { topic: function () { path.exists('/dev/null',this.callback) }, 'exists': function (result) { assert.isTrue(result) } } }
  • 38. T Sw r Permutation Explosion
  • 39. T Sw r Permutation Explosion
  • 40. J v Really
  • 41. J M Faster Test feedback Failures are not randomly distributed Lots of very short tests A few very long ones Kent Beck
  • 42. J M Faster Test feedback
  • 43. I r L Learn from Metrics
  • 44. O r ff dessert
  • 45. ‘‘What is the use of a book,’’ thought Alice, ‘‘without pictures or conversations?’’ Lewis Carroll Alice’s Adventures in Wonderland
  • 46. Sw L Words are not enough Ward Cunningham
  • 48. Gr p T Brian Marick
  • 49. ‘‘How much do you know about the heuristics of failure?’ Joseph Wilk Scotland Ruby Conf 2011 http://testobsessed.com/wp-content/uploads/2007/02/testheuristicscheatsheetv1.pdf
  • 50. T I
  • 51. Joseph Wilk ! @josephwilk http://blog.josephwilk.net