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             ïŹ€
        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

More Related Content

What's hot

From dot net_to_rails
From dot net_to_railsFrom dot net_to_rails
From dot net_to_railspythonandchips
 
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 JFokusHamletDRC
 
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 - IPC12Stephan 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
 

What's hot (20)

From dot net_to_rails
From dot net_to_railsFrom dot net_to_rails
From dot net_to_rails
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
 
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
 
Smoking docker
Smoking dockerSmoking docker
Smoking docker
 
Getting Testy With Perl6
Getting Testy With Perl6Getting Testy With Perl6
Getting Testy With Perl6
 
Getting testy with Perl
Getting testy with PerlGetting testy with Perl
Getting testy with Perl
 
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
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
 
The algebra of library design
The algebra of library designThe algebra of library design
The algebra of library design
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)
 
Testing untestable code - IPC12
Testing untestable code - IPC12Testing untestable code - IPC12
Testing untestable code - IPC12
 
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
 
Kotlin in action
Kotlin in actionKotlin in action
Kotlin in action
 
Effective Benchmarks
Effective BenchmarksEffective Benchmarks
Effective Benchmarks
 
Kotlin cheat sheet by ekito
Kotlin cheat sheet by ekitoKotlin cheat sheet by ekito
Kotlin cheat sheet by ekito
 
Gatling - Paris Perf User Group
Gatling - Paris Perf User GroupGatling - Paris Perf User Group
Gatling - Paris Perf User Group
 
Kotlin hands on - MorningTech ekito 2017
Kotlin hands on - MorningTech ekito 2017Kotlin hands on - MorningTech ekito 2017
Kotlin hands on - MorningTech ekito 2017
 
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
 
Bytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASMBytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASM
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 

Similar to Testing outside of the Ruby World

Basics of Javascript
Basics of JavascriptBasics of Javascript
Basics of Javascript
Universe41
 
fundamentals of JavaScript for students.ppt
fundamentals of JavaScript for students.pptfundamentals of JavaScript for students.ppt
fundamentals of JavaScript for students.ppt
dejen6
 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayEddie 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 JVMVaclav Pech
 
Javascript status 2016
Javascript status 2016Javascript status 2016
Javascript status 2016
Arshavski Alexander
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheckBeScala
 
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
 
Smalltalk on rubinius
Smalltalk on rubiniusSmalltalk on rubinius
Smalltalk on rubinius
Konstantin Haase
 

Similar to Testing outside of the Ruby World (20)

Basics of Javascript
Basics of JavascriptBasics of Javascript
Basics of Javascript
 
fundamentals of JavaScript for students.ppt
fundamentals of JavaScript for students.pptfundamentals of JavaScript for students.ppt
fundamentals of JavaScript for students.ppt
 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-Tuesday
 
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
 
Maintainable JavaScript
Maintainable JavaScriptMaintainable JavaScript
Maintainable JavaScript
 
Anatomy of a Reactive Application
Anatomy of a Reactive ApplicationAnatomy of a Reactive Application
Anatomy of a Reactive Application
 
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
 
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
 
Lagergren jvmls-2013-final
Lagergren jvmls-2013-finalLagergren jvmls-2013-final
Lagergren jvmls-2013-final
 
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.
 
Concurrency on the JVM
Concurrency on the JVMConcurrency on the JVM
Concurrency on the JVM
 
Javascript status 2016
Javascript status 2016Javascript status 2016
Javascript status 2016
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
 
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
 
Designing with Groovy Traits - Gr8Conf India
Designing with Groovy Traits - Gr8Conf IndiaDesigning with Groovy Traits - Gr8Conf India
Designing with Groovy Traits - Gr8Conf India
 
IntroTestMore
IntroTestMoreIntroTestMore
IntroTestMore
 
IntroTestMore
IntroTestMoreIntroTestMore
IntroTestMore
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka features
 
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
 
Smalltalk on rubinius
Smalltalk on rubiniusSmalltalk on rubinius
Smalltalk on rubinius
 

More from Joseph Wilk

Frozenrails2011
Frozenrails2011Frozenrails2011
Frozenrails2011Joseph 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 talkJoseph 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 startupJoseph Wilk
 
Cucumber Patterns Workshop
Cucumber Patterns WorkshopCucumber Patterns Workshop
Cucumber Patterns WorkshopJoseph 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 StringsJoseph 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
 

More from Joseph Wilk (16)

Frozenrails2011
Frozenrails2011Frozenrails2011
Frozenrails2011
 
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
 
Rubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talkRubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talk
 
The Limited Red Society
The Limited Red SocietyThe Limited Red Society
The Limited Red Society
 
The Limited Red Society
The Limited Red Society The Limited Red Society
The Limited Red Society
 
Spa2011
Spa2011Spa2011
Spa2011
 
Rubyconf lightning talk
Rubyconf lightning talkRubyconf lightning talk
Rubyconf lightning talk
 
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
 
Cucumber Patterns Workshop
Cucumber Patterns WorkshopCucumber Patterns Workshop
Cucumber Patterns Workshop
 
Musichackday
MusichackdayMusichackday
Musichackday
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
 
Cucumber Ru09 Web
Cucumber Ru09 WebCucumber Ru09 Web
Cucumber Ru09 Web
 
Cucumbered
CucumberedCucumbered
Cucumbered
 
Dynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the StringsDynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the Strings
 
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
 
Testing with Ruby
Testing with RubyTesting with Ruby
Testing with Ruby
 

Recently uploaded

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 

Recently uploaded (20)

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

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", "zombie@underworld.dead"). 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 ïŹ€ 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
  • 47. http://vimeo.com/22165070 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