SlideShare a Scribd company logo
Expressive Testing
…and your Code For Free?
Tim Mackinnon
www.iterex.co.uk
Presentation Outline+Objectives
SUnit – features and flaws
Importance Of Failures – failing is good right?
Readability
Assertions as Intent
More specific testing
Code for free
I want to get feedback on these ideas, is there
something interesting?
SUnit – 13 Years On
From the SUnit site:
“SUnit is the mother of all unit testing frameworks, and
serves as one of the cornerstones of test-driven
development methodologies such as eXtreme
Programming”
Simple model for testing, inspired many X-Unit clones
Available on all Smalltalk implementations
Current Smalltalk version is 3.1 – stable but no recent
development work
Many popular frameworks ship with SUnit tests. So how
are tests in the wild?
Sample SUnit test
Sample SUnit Result
Very minimal indication of
the cause of the failure
Sample SUnit Result
Slightly improved failure indication in the status bar
via “Intelli-Dolphin” but still not particularly helpful
So what’s wrong with this?
Generic style tests require using a debugger to find out
the problem
The error displayed the in SUnit Runner is not very
descriptive/helpful
Not bad when doing initial TDD, but if mass failures afterwards,
can be tedious to track down a problem
Not always clear that you got the failure you expected unless
you take the time to debug
Erwin Reichstein (Carleton University – undergrad CS)
“If you don’t find any errors in your code – you should be
very worried”
How about writing tests a different way?
Concisely indicate your test intent, and leverage this information to
give clear messages for inevitable failure…
And presenting test results more usefully?
Constraint provides a much clearer indication of the error
SUnit Issues that cropped up…
TestResults do not store the exception that causes them
Therefore a UI has no additional information to report
If you store the exception, how can you get a meaningful
message from it?
Expressing Expectations as Objects
Create a family of Constraint
objects with a protocol:
#satisfies:
#verifyWith:
#errorMessageFor:
#printAbbreviationOn:
Try to use readable
terminology for instantiation
Equal to:
Less than:
Loose methods for
convenience of instantiation
#shouldEqual:
Lets explore some code
More Complex Constraints
constraint :=
(Begins with: 'p') | (Ends with: ‘s') & [:i | i size < 5].
In using constraints, discovered some useful new
patterns:
(Begins with: 'p') & Different values.
Only values: #(‘peter’ ‘john’)
Sequence of: #(‘peter’ ‘john’ ‘harry’)
Leverage these objects to generate more specific error
messages:
“john not item 1 in #(‘peter’ ‘john’ ‘harry’)
Do constraints have other users?
Yes - Specifying expected values on method calls for
testing:
MethodWrappers
MockObjects
Code generation
Example of a test using Mocks and Constraints
ObjectDocumentor
SUnitTest Reporter
SUnitNameParser
Use Constraints ( ) to verify each invocation
to a proxy object
Example Mock test using constraints
testDoesntProcessNonTestMethods
|report nameParser methods documentor|
methods := #('setUp' 'testCalculates').
nameParser := mockery createMock: #SUnitNameParser.
report := mockery createMock: #ResponsibilityReport.
documentor := ObjectDocumentor new.
[documentor process: methods using: nameParser onto: report]
expecting:
([nameParser isTestMethod: (Only values: methods)]
answerWith: #(false true))
+ ([nameParser parse: 'testCalculates']
answer: 'Calculates' exactly: 1)
+ [report printResponsibility:
(Kind of: String) &~ (Begins with: 'test')] once
Generating Code from tests….
Run the tests, gather all the mock objects used, ask
them to generate code, protocols, comments.
Future Work
Keep gathering useful constraints (like Sequence,
Different etc.)
Investigate if constraints can improve code generation
(beyond simplistic usages)
Investigate whether constraints can infer missing or
conflicting test cases
Conclusions
Summary
When a test fails – ask yourself:
Is it telling me everything it can about the failure?
Would expressing it as a test constraint make it
clearer?
Speaker:
Tim Mackinnon
http://www.iterex.co.uk/research
Related Work
James Robertson’s Daily Smalltalk: ComplexConditions
(http://www.cincomsmalltalk.com/casts/stDaily/2007/smalltalk_da
ily-08-15-07.html)
Acknowledgements
Blaine Buxton/Brian Rice for encouragement at
STS2006
Nat Pryce for introducing me to the idea of constraints as
objects
Tim Mackinnon - Who are you?
1996 – OTI
Developer on teams credited for early use of agile practices
1999 – Connextra
Formed one of the first Agile teams in the UK
Invented “Mock Objects” test technique
Pioneered Iteration/Heartbeat Retrospectives
2003 – ThoughtWorks
Agile enablement coaching
Established hi-level release estimation techniques
Developed worldwide QuickStart project workshops
2006 – Iterative Excellence
Tailored Consulting for Agile projects
Iterex Professional – Software helping teams plan and track agile
projects

More Related Content

What's hot

The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debugging
svilen.ivanov
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
Oksana
 
Debugging by induction
Debugging by inductionDebugging by induction
Debugging by induction
Waqar Ali
 
Test case design_the_basicsv0.4
Test case design_the_basicsv0.4Test case design_the_basicsv0.4
Test case design_the_basicsv0.4
guest31fced
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test cases
Confiz
 
Bt0082, visual basic
Bt0082, visual basicBt0082, visual basic
Bt0082, visual basic
smumbahelp
 
Test Cases Maintaining & Documenting
Test Cases Maintaining & DocumentingTest Cases Maintaining & Documenting
Test Cases Maintaining & Documenting
Seyed Ali Marjaie
 
Industrial Control System Assignment Help|25% Online Assignment Help
Industrial Control System Assignment Help|25% Online Assignment HelpIndustrial Control System Assignment Help|25% Online Assignment Help
Industrial Control System Assignment Help|25% Online Assignment Help
Nicole Valerio
 
Best Practices for Test Case Writing
Best Practices for Test Case WritingBest Practices for Test Case Writing
Best Practices for Test Case Writing
Sarah Goldberg
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
solutionjug4
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
helpido9
 
Blackbox
BlackboxBlackbox
Blackbox
GuruKrishnaTeja
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStrings
Alan Richardson
 
Dakiry_qastandup_Olia Didyk_testdesign
Dakiry_qastandup_Olia Didyk_testdesignDakiry_qastandup_Olia Didyk_testdesign
Dakiry_qastandup_Olia Didyk_testdesign
Dakiry
 
Md university cmis 102 week 5 hands
Md university cmis 102 week 5 handsMd university cmis 102 week 5 hands
Md university cmis 102 week 5 hands
eyavagal
 
Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniques
Khuong Nguyen
 
Advanced unit testing – real life examples and mistakes
Advanced unit testing – real life examples and mistakesAdvanced unit testing – real life examples and mistakes
Advanced unit testing – real life examples and mistakes
Milan Vukoje
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
Bipul Roy Bpl
 
Software Debugging for High-altitude Balloons
Software Debugging for High-altitude BalloonsSoftware Debugging for High-altitude Balloons
Software Debugging for High-altitude Balloons
jgrahamc
 

What's hot (19)

The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debugging
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Debugging by induction
Debugging by inductionDebugging by induction
Debugging by induction
 
Test case design_the_basicsv0.4
Test case design_the_basicsv0.4Test case design_the_basicsv0.4
Test case design_the_basicsv0.4
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test cases
 
Bt0082, visual basic
Bt0082, visual basicBt0082, visual basic
Bt0082, visual basic
 
Test Cases Maintaining & Documenting
Test Cases Maintaining & DocumentingTest Cases Maintaining & Documenting
Test Cases Maintaining & Documenting
 
Industrial Control System Assignment Help|25% Online Assignment Help
Industrial Control System Assignment Help|25% Online Assignment HelpIndustrial Control System Assignment Help|25% Online Assignment Help
Industrial Control System Assignment Help|25% Online Assignment Help
 
Best Practices for Test Case Writing
Best Practices for Test Case WritingBest Practices for Test Case Writing
Best Practices for Test Case Writing
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
Blackbox
BlackboxBlackbox
Blackbox
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStrings
 
Dakiry_qastandup_Olia Didyk_testdesign
Dakiry_qastandup_Olia Didyk_testdesignDakiry_qastandup_Olia Didyk_testdesign
Dakiry_qastandup_Olia Didyk_testdesign
 
Md university cmis 102 week 5 hands
Md university cmis 102 week 5 handsMd university cmis 102 week 5 hands
Md university cmis 102 week 5 hands
 
Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniques
 
Advanced unit testing – real life examples and mistakes
Advanced unit testing – real life examples and mistakesAdvanced unit testing – real life examples and mistakes
Advanced unit testing – real life examples and mistakes
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Software Debugging for High-altitude Balloons
Software Debugging for High-altitude BalloonsSoftware Debugging for High-altitude Balloons
Software Debugging for High-altitude Balloons
 

Viewers also liked

Cincom Smalltalk
Cincom SmalltalkCincom Smalltalk
Cincom Smalltalk
ESUG
 
Jesucristo
JesucristoJesucristo
Jesucristo
Arcelino Campos
 
Dachbegruener 1 2009
Dachbegruener 1 2009Dachbegruener 1 2009
Dachbegruener 1 2009guest6d9a536
 
Presentación1
Presentación1Presentación1
Presentación1
crisept08
 
Livro
LivroLivro
Ads Sesion1 10393
Ads Sesion1 10393Ads Sesion1 10393
Ads Sesion1 10393
guest31882d
 
Weihnachten in binago
Weihnachten in binagoWeihnachten in binago
Weihnachten in binago
frauspinello
 
00gt0411 (1)
00gt0411 (1)00gt0411 (1)
00gt0411 (1)
Isabel Almeida
 
PresentacióN Sobre Software Libre En EducacióN De Maria Polo Ribera
PresentacióN Sobre Software Libre En EducacióN De Maria Polo RiberaPresentacióN Sobre Software Libre En EducacióN De Maria Polo Ribera
PresentacióN Sobre Software Libre En EducacióN De Maria Polo Ribera
guest445331
 
DGT Multimodal - Apresentação Institucional
DGT Multimodal - Apresentação InstitucionalDGT Multimodal - Apresentação Institucional
DGT Multimodal - Apresentação Institucional
Grupo DGT
 
Vision 2020
Vision 2020Vision 2020
Vision 2020
guesta00cdc
 
Software para Imobiliaria
Software para ImobiliariaSoftware para Imobiliaria
Software para Imobiliaria
Barbara Damacena
 
Test con truco
Test con trucoTest con truco
Test con truco
amaraps1991
 
Percepcion
PercepcionPercepcion
Percepcion
amaraps1991
 
Historia De Amor
Historia De Amor Historia De Amor
Historia De Amor
guest62c6fe
 
Me echaron de ingenieria
Me echaron de ingenieriaMe echaron de ingenieria
Me echaron de ingenieria
AxelMR
 
Sociedade informação
Sociedade informaçãoSociedade informação
Sociedade informação
Barbara Damacena
 

Viewers also liked (20)

Cincom Smalltalk
Cincom SmalltalkCincom Smalltalk
Cincom Smalltalk
 
Jesucristo
JesucristoJesucristo
Jesucristo
 
Dachbegruener 1 2009
Dachbegruener 1 2009Dachbegruener 1 2009
Dachbegruener 1 2009
 
Presentación1
Presentación1Presentación1
Presentación1
 
Power point pa
Power point paPower point pa
Power point pa
 
Cassoela
CassoelaCassoela
Cassoela
 
Ostern 1 b
Ostern 1 bOstern 1 b
Ostern 1 b
 
Livro
LivroLivro
Livro
 
Ads Sesion1 10393
Ads Sesion1 10393Ads Sesion1 10393
Ads Sesion1 10393
 
Weihnachten in binago
Weihnachten in binagoWeihnachten in binago
Weihnachten in binago
 
00gt0411 (1)
00gt0411 (1)00gt0411 (1)
00gt0411 (1)
 
PresentacióN Sobre Software Libre En EducacióN De Maria Polo Ribera
PresentacióN Sobre Software Libre En EducacióN De Maria Polo RiberaPresentacióN Sobre Software Libre En EducacióN De Maria Polo Ribera
PresentacióN Sobre Software Libre En EducacióN De Maria Polo Ribera
 
DGT Multimodal - Apresentação Institucional
DGT Multimodal - Apresentação InstitucionalDGT Multimodal - Apresentação Institucional
DGT Multimodal - Apresentação Institucional
 
Vision 2020
Vision 2020Vision 2020
Vision 2020
 
Software para Imobiliaria
Software para ImobiliariaSoftware para Imobiliaria
Software para Imobiliaria
 
Test con truco
Test con trucoTest con truco
Test con truco
 
Percepcion
PercepcionPercepcion
Percepcion
 
Historia De Amor
Historia De Amor Historia De Amor
Historia De Amor
 
Me echaron de ingenieria
Me echaron de ingenieriaMe echaron de ingenieria
Me echaron de ingenieria
 
Sociedade informação
Sociedade informaçãoSociedade informação
Sociedade informação
 

Similar to Expressive Testing ...and your Code For Free?

Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
priya_trivedi
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
Priya Sharma
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
priya_trivedi
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Anuj Arora
 
Unit testing
Unit testingUnit testing
Unit testing
Murugesan Nataraj
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQL
Steven Feuerstein
 
SELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdfSELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdf
Eric Selje
 
How to complement TDD with static analysis
How to complement TDD with static analysisHow to complement TDD with static analysis
How to complement TDD with static analysis
PVS-Studio
 
Testing Options in Java
Testing Options in JavaTesting Options in Java
Testing Options in Java
Michael Fons
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
UTC Fire & Security
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
Attila Bertók
 
SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)
Amr E. Mohamed
 
Unit test
Unit testUnit test
Unit test
Tran Duc
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
michael.labriola
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
Amr E. Mohamed
 
Computer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.pptComputer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.ppt
TrevorChinguwo
 
Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)
Foyzul Karim
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
John Blum
 
Nguyenvandungb seminar
Nguyenvandungb seminarNguyenvandungb seminar
Nguyenvandungb seminar
dunglinh111
 
Soren Lynggaard & Pusser Janvit - How To Hire A True Tester - EuroSTAR 2013
Soren Lynggaard & Pusser Janvit - How To Hire A True Tester - EuroSTAR 2013Soren Lynggaard & Pusser Janvit - How To Hire A True Tester - EuroSTAR 2013
Soren Lynggaard & Pusser Janvit - How To Hire A True Tester - EuroSTAR 2013
TEST Huddle
 

Similar to Expressive Testing ...and your Code For Free? (20)

Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Unit testing
Unit testingUnit testing
Unit testing
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQL
 
SELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdfSELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdf
 
How to complement TDD with static analysis
How to complement TDD with static analysisHow to complement TDD with static analysis
How to complement TDD with static analysis
 
Testing Options in Java
Testing Options in JavaTesting Options in Java
Testing Options in Java
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
 
SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)
 
Unit test
Unit testUnit test
Unit test
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
 
Computer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.pptComputer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.ppt
 
Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Nguyenvandungb seminar
Nguyenvandungb seminarNguyenvandungb seminar
Nguyenvandungb seminar
 
Soren Lynggaard & Pusser Janvit - How To Hire A True Tester - EuroSTAR 2013
Soren Lynggaard & Pusser Janvit - How To Hire A True Tester - EuroSTAR 2013Soren Lynggaard & Pusser Janvit - How To Hire A True Tester - EuroSTAR 2013
Soren Lynggaard & Pusser Janvit - How To Hire A True Tester - EuroSTAR 2013
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
ESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
ESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 
AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)
HarpalGohil4
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
Fwdays
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
AlexanderRichford
 
Containers & AI - Beauty and the Beast!?!
Containers & AI - Beauty and the Beast!?!Containers & AI - Beauty and the Beast!?!
Containers & AI - Beauty and the Beast!?!
Tobias Schneck
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's TipsGetting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
ScyllaDB
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 

Recently uploaded (20)

The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 
AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...
 
Containers & AI - Beauty and the Beast!?!
Containers & AI - Beauty and the Beast!?!Containers & AI - Beauty and the Beast!?!
Containers & AI - Beauty and the Beast!?!
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's TipsGetting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 

Expressive Testing ...and your Code For Free?

  • 1. Expressive Testing …and your Code For Free? Tim Mackinnon www.iterex.co.uk
  • 2. Presentation Outline+Objectives SUnit – features and flaws Importance Of Failures – failing is good right? Readability Assertions as Intent More specific testing Code for free I want to get feedback on these ideas, is there something interesting?
  • 3. SUnit – 13 Years On From the SUnit site: “SUnit is the mother of all unit testing frameworks, and serves as one of the cornerstones of test-driven development methodologies such as eXtreme Programming” Simple model for testing, inspired many X-Unit clones Available on all Smalltalk implementations Current Smalltalk version is 3.1 – stable but no recent development work Many popular frameworks ship with SUnit tests. So how are tests in the wild?
  • 5. Sample SUnit Result Very minimal indication of the cause of the failure
  • 6. Sample SUnit Result Slightly improved failure indication in the status bar via “Intelli-Dolphin” but still not particularly helpful
  • 7. So what’s wrong with this? Generic style tests require using a debugger to find out the problem The error displayed the in SUnit Runner is not very descriptive/helpful Not bad when doing initial TDD, but if mass failures afterwards, can be tedious to track down a problem Not always clear that you got the failure you expected unless you take the time to debug Erwin Reichstein (Carleton University – undergrad CS) “If you don’t find any errors in your code – you should be very worried”
  • 8. How about writing tests a different way? Concisely indicate your test intent, and leverage this information to give clear messages for inevitable failure…
  • 9. And presenting test results more usefully? Constraint provides a much clearer indication of the error
  • 10. SUnit Issues that cropped up… TestResults do not store the exception that causes them Therefore a UI has no additional information to report If you store the exception, how can you get a meaningful message from it?
  • 11. Expressing Expectations as Objects Create a family of Constraint objects with a protocol: #satisfies: #verifyWith: #errorMessageFor: #printAbbreviationOn: Try to use readable terminology for instantiation Equal to: Less than: Loose methods for convenience of instantiation #shouldEqual:
  • 13. More Complex Constraints constraint := (Begins with: 'p') | (Ends with: ‘s') & [:i | i size < 5]. In using constraints, discovered some useful new patterns: (Begins with: 'p') & Different values. Only values: #(‘peter’ ‘john’) Sequence of: #(‘peter’ ‘john’ ‘harry’) Leverage these objects to generate more specific error messages: “john not item 1 in #(‘peter’ ‘john’ ‘harry’)
  • 14. Do constraints have other users? Yes - Specifying expected values on method calls for testing: MethodWrappers MockObjects Code generation
  • 15. Example of a test using Mocks and Constraints ObjectDocumentor SUnitTest Reporter SUnitNameParser Use Constraints ( ) to verify each invocation to a proxy object
  • 16. Example Mock test using constraints testDoesntProcessNonTestMethods |report nameParser methods documentor| methods := #('setUp' 'testCalculates'). nameParser := mockery createMock: #SUnitNameParser. report := mockery createMock: #ResponsibilityReport. documentor := ObjectDocumentor new. [documentor process: methods using: nameParser onto: report] expecting: ([nameParser isTestMethod: (Only values: methods)] answerWith: #(false true)) + ([nameParser parse: 'testCalculates'] answer: 'Calculates' exactly: 1) + [report printResponsibility: (Kind of: String) &~ (Begins with: 'test')] once
  • 17. Generating Code from tests…. Run the tests, gather all the mock objects used, ask them to generate code, protocols, comments.
  • 18. Future Work Keep gathering useful constraints (like Sequence, Different etc.) Investigate if constraints can improve code generation (beyond simplistic usages) Investigate whether constraints can infer missing or conflicting test cases
  • 20. Summary When a test fails – ask yourself: Is it telling me everything it can about the failure? Would expressing it as a test constraint make it clearer? Speaker: Tim Mackinnon http://www.iterex.co.uk/research
  • 21. Related Work James Robertson’s Daily Smalltalk: ComplexConditions (http://www.cincomsmalltalk.com/casts/stDaily/2007/smalltalk_da ily-08-15-07.html)
  • 22. Acknowledgements Blaine Buxton/Brian Rice for encouragement at STS2006 Nat Pryce for introducing me to the idea of constraints as objects
  • 23. Tim Mackinnon - Who are you? 1996 – OTI Developer on teams credited for early use of agile practices 1999 – Connextra Formed one of the first Agile teams in the UK Invented “Mock Objects” test technique Pioneered Iteration/Heartbeat Retrospectives 2003 – ThoughtWorks Agile enablement coaching Established hi-level release estimation techniques Developed worldwide QuickStart project workshops 2006 – Iterative Excellence Tailored Consulting for Agile projects Iterex Professional – Software helping teams plan and track agile projects