SlideShare une entreprise Scribd logo
you
an
existing
library
(the horse is
probably your ego)
at some point in your career, as a programmer, you will become frustrated with your tools, with the software you use every day.
It will start as a chafe, as some mild friction, but will grow, it will fester, and nag at you, distracting you from otherwise productive endeavours.
you your
ideal
library
language ✘
app framework ✘
test framework ✔
test/unit
rspec
cucumber
you hate test/unit because it’s a convoluted codebase that’s a pain to work with and impossible to extend
you hate rspec because it’s bloated and you bear some inexplicable long-term grudge against it, and the latest API change is the straw that broken your
proverbial camel’s back
or maybe you hate cucumber because it’s slow and limited
for me it was test/unit
before / setup
test ...
should ...
it ...
after / teardown
blah = Hubris.new do
before do
@x = 1
end
it “works” do
raise unless 1 == @x
end
after do
@x = nil
end
end
blah.run
class Hubris
def initialize(&block)
instance_eval(&block)
end
def before(&block)
@before = block
end
def it(name, &block)
@test = block
end
# etc ...
def run
instance_eval(&@before)
instance_eval(&@test)
instance_eval(&@after)
end
end
stash
evaluate
evaluate
before / setup
test ...
should ...
it ...
after / teardown
@f = File.new
@f.unlink
@f.read
in order to share state, you either need the code in all three stages to run with the same value of self,
or copy state around like crazy
subcontexts:
parent & child
def run_befores
@parent.run_befores if @parent
instance_eval(&@before)
end
def run
run_befores
instance_eval(&@test)
# etc ...
end
in order to share state, you either need the code in all three stages to run with the same value of self,
or copy state around like crazy
Hubris.new do
def some_method
@x = 1
end
it “works” do
raise unless 1 == some_method
end
end
where does this
method live?
the value of self in the method needs to be the same as in the test
you find yourself either needing to re-implement inheritance, or change your library implementation to be based on inheritance.
This is the point at which your simple library turns a corner, and becomes non-obvious.
all of this has
happened before;
and it will all
happen again.
how do I know all this? I have just done it.
step through the history of the kintama project.
as it started to get more complicated, i wondered if anyone else had done the same.
at least 45 libraries
pure testing - not testing ‘addons’ like mocha
i became profoundly depressed.
AXIS OF
WTF
either building the same features on TOP of Test::Unit
or a complete standalone implementation of a nested test framework
it’s probably OK.
it’s a good learning experience
you will learn loads about advanced block manipulation and a new appreciation for
convergent evolution - independent appearance of features which tend towards similarity
diversity is a good thing
except maybe it’s
not OK?
why do we feel the need to re-invent?
Is it because the existing libaries are “too heavy”, and you think people need something “lightweight”? Perhaps you think it’s time for a “testing library for
the rest of us”?
I think “too heavy” and “for the rest of us” can be “developer smells” - I suspect it means that either the project is ideologically incompatible with their
particular manifesto, or that they cannot be bother putting the effort in to understanding the existing code.
I’m not sure I really buy my “convergent evolution” explanation, because while there might be some form of “survival of the fittest” that weeds out the
weaker libraries, we are not developing blindly.
We are aware of these other islands of development, or certainly can be, but instead choose to go ahead and repeat the same decisions.
maybe don’t write
anything.
perhaps there’s already another trailblazing re-implementer who has satisfied your need.
use that!
question the urge to create another project just to bump up your authority on working with rails
maybe become a
contributer.
maybe there is something you can do to modify one of the existing projects to address your needs? (do you even really understand your needs?)
this is the point of open source that is most often missed; we can collaborate.
open source
responsibility.
github makes it very easy to make a project available for other people to use
but it also doesn’t provide any differentiation between your polished, maintained, and thoroughly tested and the piece of shit that I knocked up because I
am bored and arrogant.
if you know something is broken, at least update the README.
if you fork something, send a pull request or communicate in some other way WHY you have forked. (see cucumber bundle)
if you get a pull request, deal with it! look after your code and the people who use it.
give some context.
if you’re going to write a replacement tool, make it clear in the README that you understand its setting within the larger ecosystem.
this is like a literature review in a dissertation; it demonstrates that you are aware of other tools, how they work, what their problems are.
kill-ish your darlings.
bit.ly/rubytesting
have the courage to say “this is just a sketch, and I’m not suggesting that it is suitable for public consumption”.

Contenu connexe

Similaire à Do we need more test frameworks? (2011)

Boxen: How to Manage an Army of Laptops and Live to Talk About It
Boxen: How to Manage an Army of Laptops and Live to Talk About ItBoxen: How to Manage an Army of Laptops and Live to Talk About It
Boxen: How to Manage an Army of Laptops and Live to Talk About It
Puppet
 
Tensorflow go
Tensorflow goTensorflow go
Tensorflow go
Patrick Walker
 
scala-intro
scala-introscala-intro
scala-intro
Manav Prasad
 
Do Languages Matter?
Do Languages Matter?Do Languages Matter?
Do Languages Matter?
Bruce Eckel
 
Principled io in_scala_2019_distribution
Principled io in_scala_2019_distributionPrincipled io in_scala_2019_distribution
Principled io in_scala_2019_distribution
Raymond Tay
 
Creativity vs Best Practices
Creativity vs Best PracticesCreativity vs Best Practices
Creativity vs Best Practices
Supun Dissanayake
 
Naming Things
Naming ThingsNaming Things
Naming Things
Pete Nicholls
 
thinkapjava_1
thinkapjava_1thinkapjava_1
thinkapjava_1
Alaa Khateeb
 
Open experiments and open-source
Open experiments and open-sourceOpen experiments and open-source
Open experiments and open-source
peircej
 
Scilabpdf
ScilabpdfScilabpdf
Scilabpdf
kishorebingi
 
C++ Introduction brown bag
C++ Introduction brown bagC++ Introduction brown bag
C++ Introduction brown bag
Jacob Green
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Zoe Landon
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem
Claudson Oliveira
 
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JSFestUA
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic Revisited
Adam Keys
 
C# and java comparing programming languages
C# and java  comparing programming languagesC# and java  comparing programming languages
C# and java comparing programming languages
Shishir Roy
 
A class action
A class actionA class action
A class action
Luciano Colosio
 
I broke what?!??!? Taking over maintenance on well loved projects
I broke what?!??!? Taking over maintenance on well loved projectsI broke what?!??!? Taking over maintenance on well loved projects
I broke what?!??!? Taking over maintenance on well loved projects
Bert JW Regeer
 
I broke what? Taking over maintenance on existing (well loved) projects, by B...
I broke what? Taking over maintenance on existing (well loved) projects, by B...I broke what? Taking over maintenance on existing (well loved) projects, by B...
I broke what? Taking over maintenance on existing (well loved) projects, by B...
T. Kim Nguyen
 
The best way to learn java script
The best way to learn java scriptThe best way to learn java script
The best way to learn java script
Wei Sun
 

Similaire à Do we need more test frameworks? (2011) (20)

Boxen: How to Manage an Army of Laptops and Live to Talk About It
Boxen: How to Manage an Army of Laptops and Live to Talk About ItBoxen: How to Manage an Army of Laptops and Live to Talk About It
Boxen: How to Manage an Army of Laptops and Live to Talk About It
 
Tensorflow go
Tensorflow goTensorflow go
Tensorflow go
 
scala-intro
scala-introscala-intro
scala-intro
 
Do Languages Matter?
Do Languages Matter?Do Languages Matter?
Do Languages Matter?
 
Principled io in_scala_2019_distribution
Principled io in_scala_2019_distributionPrincipled io in_scala_2019_distribution
Principled io in_scala_2019_distribution
 
Creativity vs Best Practices
Creativity vs Best PracticesCreativity vs Best Practices
Creativity vs Best Practices
 
Naming Things
Naming ThingsNaming Things
Naming Things
 
thinkapjava_1
thinkapjava_1thinkapjava_1
thinkapjava_1
 
Open experiments and open-source
Open experiments and open-sourceOpen experiments and open-source
Open experiments and open-source
 
Scilabpdf
ScilabpdfScilabpdf
Scilabpdf
 
C++ Introduction brown bag
C++ Introduction brown bagC++ Introduction brown bag
C++ Introduction brown bag
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem
 
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic Revisited
 
C# and java comparing programming languages
C# and java  comparing programming languagesC# and java  comparing programming languages
C# and java comparing programming languages
 
A class action
A class actionA class action
A class action
 
I broke what?!??!? Taking over maintenance on well loved projects
I broke what?!??!? Taking over maintenance on well loved projectsI broke what?!??!? Taking over maintenance on well loved projects
I broke what?!??!? Taking over maintenance on well loved projects
 
I broke what? Taking over maintenance on existing (well loved) projects, by B...
I broke what? Taking over maintenance on existing (well loved) projects, by B...I broke what? Taking over maintenance on existing (well loved) projects, by B...
I broke what? Taking over maintenance on existing (well loved) projects, by B...
 
The best way to learn java script
The best way to learn java scriptThe best way to learn java script
The best way to learn java script
 

Plus de lazyatom

Extending Rails with Plugins (2007)
Extending Rails with Plugins (2007)Extending Rails with Plugins (2007)
Extending Rails with Plugins (2007)
lazyatom
 
Engines: Team Development on Rails (2005)
Engines: Team Development on Rails (2005)Engines: Team Development on Rails (2005)
Engines: Team Development on Rails (2005)
lazyatom
 
The Even Darker Art of Rails Engines (2009)
The Even Darker Art of Rails Engines (2009)The Even Darker Art of Rails Engines (2009)
The Even Darker Art of Rails Engines (2009)
lazyatom
 
The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)
lazyatom
 
Gem That (2009)
Gem That (2009)Gem That (2009)
Gem That (2009)
lazyatom
 
IoT Printer (2012)
IoT Printer (2012)IoT Printer (2012)
IoT Printer (2012)
lazyatom
 
The Even Darker Art Of Rails Engines
The Even Darker Art Of Rails EnginesThe Even Darker Art Of Rails Engines
The Even Darker Art Of Rails Engines
lazyatom
 

Plus de lazyatom (7)

Extending Rails with Plugins (2007)
Extending Rails with Plugins (2007)Extending Rails with Plugins (2007)
Extending Rails with Plugins (2007)
 
Engines: Team Development on Rails (2005)
Engines: Team Development on Rails (2005)Engines: Team Development on Rails (2005)
Engines: Team Development on Rails (2005)
 
The Even Darker Art of Rails Engines (2009)
The Even Darker Art of Rails Engines (2009)The Even Darker Art of Rails Engines (2009)
The Even Darker Art of Rails Engines (2009)
 
The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)
 
Gem That (2009)
Gem That (2009)Gem That (2009)
Gem That (2009)
 
IoT Printer (2012)
IoT Printer (2012)IoT Printer (2012)
IoT Printer (2012)
 
The Even Darker Art Of Rails Engines
The Even Darker Art Of Rails EnginesThe Even Darker Art Of Rails Engines
The Even Darker Art Of Rails Engines
 

Dernier

KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
Drona Infotech
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 

Dernier (20)

KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 

Do we need more test frameworks? (2011)

  • 1. you an existing library (the horse is probably your ego) at some point in your career, as a programmer, you will become frustrated with your tools, with the software you use every day. It will start as a chafe, as some mild friction, but will grow, it will fester, and nag at you, distracting you from otherwise productive endeavours.
  • 3. language ✘ app framework ✘ test framework ✔
  • 4. test/unit rspec cucumber you hate test/unit because it’s a convoluted codebase that’s a pain to work with and impossible to extend you hate rspec because it’s bloated and you bear some inexplicable long-term grudge against it, and the latest API change is the straw that broken your proverbial camel’s back or maybe you hate cucumber because it’s slow and limited for me it was test/unit
  • 5. before / setup test ... should ... it ... after / teardown
  • 6. blah = Hubris.new do before do @x = 1 end it “works” do raise unless 1 == @x end after do @x = nil end end blah.run
  • 7. class Hubris def initialize(&block) instance_eval(&block) end def before(&block) @before = block end def it(name, &block) @test = block end # etc ... def run instance_eval(&@before) instance_eval(&@test) instance_eval(&@after) end end stash evaluate evaluate
  • 8. before / setup test ... should ... it ... after / teardown @f = File.new @f.unlink @f.read in order to share state, you either need the code in all three stages to run with the same value of self, or copy state around like crazy
  • 9. subcontexts: parent & child def run_befores @parent.run_befores if @parent instance_eval(&@before) end def run run_befores instance_eval(&@test) # etc ... end in order to share state, you either need the code in all three stages to run with the same value of self, or copy state around like crazy
  • 10. Hubris.new do def some_method @x = 1 end it “works” do raise unless 1 == some_method end end where does this method live? the value of self in the method needs to be the same as in the test you find yourself either needing to re-implement inheritance, or change your library implementation to be based on inheritance. This is the point at which your simple library turns a corner, and becomes non-obvious.
  • 11. all of this has happened before; and it will all happen again. how do I know all this? I have just done it. step through the history of the kintama project. as it started to get more complicated, i wondered if anyone else had done the same.
  • 12. at least 45 libraries pure testing - not testing ‘addons’ like mocha i became profoundly depressed.
  • 13. AXIS OF WTF either building the same features on TOP of Test::Unit or a complete standalone implementation of a nested test framework
  • 14. it’s probably OK. it’s a good learning experience you will learn loads about advanced block manipulation and a new appreciation for convergent evolution - independent appearance of features which tend towards similarity diversity is a good thing
  • 15. except maybe it’s not OK? why do we feel the need to re-invent? Is it because the existing libaries are “too heavy”, and you think people need something “lightweight”? Perhaps you think it’s time for a “testing library for the rest of us”? I think “too heavy” and “for the rest of us” can be “developer smells” - I suspect it means that either the project is ideologically incompatible with their particular manifesto, or that they cannot be bother putting the effort in to understanding the existing code. I’m not sure I really buy my “convergent evolution” explanation, because while there might be some form of “survival of the fittest” that weeds out the weaker libraries, we are not developing blindly. We are aware of these other islands of development, or certainly can be, but instead choose to go ahead and repeat the same decisions.
  • 16. maybe don’t write anything. perhaps there’s already another trailblazing re-implementer who has satisfied your need. use that! question the urge to create another project just to bump up your authority on working with rails
  • 17. maybe become a contributer. maybe there is something you can do to modify one of the existing projects to address your needs? (do you even really understand your needs?) this is the point of open source that is most often missed; we can collaborate.
  • 18. open source responsibility. github makes it very easy to make a project available for other people to use but it also doesn’t provide any differentiation between your polished, maintained, and thoroughly tested and the piece of shit that I knocked up because I am bored and arrogant. if you know something is broken, at least update the README. if you fork something, send a pull request or communicate in some other way WHY you have forked. (see cucumber bundle) if you get a pull request, deal with it! look after your code and the people who use it.
  • 19. give some context. if you’re going to write a replacement tool, make it clear in the README that you understand its setting within the larger ecosystem. this is like a literature review in a dissertation; it demonstrates that you are aware of other tools, how they work, what their problems are.
  • 20. kill-ish your darlings. bit.ly/rubytesting have the courage to say “this is just a sketch, and I’m not suggesting that it is suitable for public consumption”.