SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debuggingsvilen.ivanov
 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesOksana
 
Debugging by induction
Debugging by inductionDebugging by induction
Debugging by inductionWaqar Ali
 
Test case design_the_basicsv0.4
Test case design_the_basicsv0.4Test case design_the_basicsv0.4
Test case design_the_basicsv0.4guest31fced
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test casesConfiz
 
Bt0082, visual basic
Bt0082, visual basicBt0082, visual basic
Bt0082, visual basicsmumbahelp
 
Test Cases Maintaining & Documenting
Test Cases Maintaining & DocumentingTest Cases Maintaining & Documenting
Test Cases Maintaining & DocumentingSeyed 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 HelpNicole Valerio
 
Best Practices for Test Case Writing
Best Practices for Test Case WritingBest Practices for Test Case Writing
Best Practices for Test Case WritingSarah 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 6solutionjug4
 
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 6helpido9
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsAlan Richardson
 
Dakiry_qastandup_Olia Didyk_testdesign
Dakiry_qastandup_Olia Didyk_testdesignDakiry_qastandup_Olia Didyk_testdesign
Dakiry_qastandup_Olia Didyk_testdesignDakiry
 
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 handseyavagal
 
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 techniquesKhuong 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 mistakesMilan Vukoje
 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesBipul Roy Bpl
 
Software Debugging for High-altitude Balloons
Software Debugging for High-altitude BalloonsSoftware Debugging for High-altitude Balloons
Software Debugging for High-altitude Balloonsjgrahamc
 

Was ist angesagt? (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
 

Andere mochten auch

Cincom Smalltalk
Cincom SmalltalkCincom Smalltalk
Cincom SmalltalkESUG
 
Dachbegruener 1 2009
Dachbegruener 1 2009Dachbegruener 1 2009
Dachbegruener 1 2009guest6d9a536
 
Presentación1
Presentación1Presentación1
Presentación1crisept08
 
Ads Sesion1 10393
Ads Sesion1 10393Ads Sesion1 10393
Ads Sesion1 10393guest31882d
 
Weihnachten in binago
Weihnachten in binagoWeihnachten in binago
Weihnachten in binagofrauspinello
 
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 Riberaguest445331
 
DGT Multimodal - Apresentação Institucional
DGT Multimodal - Apresentação InstitucionalDGT Multimodal - Apresentação Institucional
DGT Multimodal - Apresentação InstitucionalGrupo DGT
 
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 ingenieriaAxelMR
 

Andere mochten auch (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
 

Ähnlich wie Expressive Testing ...and your Code For Free?

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/SQLSteven Feuerstein
 
SELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdfSELJE_Database_Unit_Testing_Slides.pdf
SELJE_Database_Unit_Testing_Slides.pdfEric 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 analysisPVS-Studio
 
Testing Options in Java
Testing Options in JavaTesting Options in Java
Testing Options in JavaMichael 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 + EclipseUTC Fire & Security
 
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
 
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 Flexmichael.labriola
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitAmr E. Mohamed
 
Computer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.pptComputer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.pptTrevorChinguwo
 
Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)Foyzul Karim
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven DevelopmentJohn Blum
 
Nguyenvandungb seminar
Nguyenvandungb seminarNguyenvandungb seminar
Nguyenvandungb seminardunglinh111
 
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 2013TEST Huddle
 

Ähnlich wie 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
 

Mehr von 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 programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
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 RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
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 resultsESUG
 
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 6ESUG
 
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 GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
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 ModesESUG
 
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 ReportESUG
 
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 APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
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 CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
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 JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
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 TransformationsESUG
 

Mehr von 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
 

Kürzlich hochgeladen

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Kürzlich hochgeladen (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

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