SlideShare a Scribd company logo
Why Test with FlexUnit? Michael Labriola Digital Primates @mlabriola
Who are you? Michael Labriola Senior Consultant at Digital Primates FlexUnit 4 Architect/Lead Developer Fan of Working Code
Are you a genius  developer  who writes perfect code  without   mistakes ?
80%  of  your time  as a developer is spent  identifying  and  correcting defects .
Software  mistakes   cost  the US Economy about  80 billion  dollars  a   year .
Half of that is  absorbed   by   consumers .
The other half is  absorbed   by  the  software developers
Errors   cost   more  to fix the  later  in the process they are found
An  error  found  after release  can  cost   100x more  to fix than during early development
The point is that we need to do a better job of  finding errors  and we need to find them  sooner .
The problem: Software  developers , myself included,  are   hypocrites .
Developers  will go out of there way to  automate things .
We will spend time to  automate  code  formatting  and simple code  generation
But when it comes to  debugging , something we spend 80% of our time doing, we choose to do that  manually
Why  do you want to  spend  your  time  doing a  repetitive task  that a computer can do for you?
What  do you think  happens  to your desire and ability to test  when   time  gets  short  on a project?
 
 
How do we  reverse  this  trend ?  How do we  fix  these  issues ?
In the beginner's mind there are many possibilities, in the expert's mind there are few -- Shunryu Suzuki
We need   to  change our approach. We need to do what we do best,  automate .
Computers  do  repetitive  tasks  faster  than we can. They also  don’t tire  of doing so.
That means if we  automate  our  tests , we can  run  them  continually .
Running tests  continually means  we find errors  sooner . Finding errors  sooner  in the process  is   cheaper .
So, we  spend  some of that 80% of our  time writing tests  instead of all of it debugging.
We let our machine  run  those  tests   constantly  for us.
We  find mistakes sooner .  Mistakes cost less.  We sleep better.  We  enjoy life .
There is another  benefit  too. We write  better code .
When you have  tests  for your code you have  less fear  of change.
When you have  tests , you can  refactor  your code.  Your code can continually  improve  in quality.
Also,  testable code  happens to have a whole lot in common with  well   architected code
The title of this session mentions FlexUnit. I haven’t, so what is it?
Flex•Unit  [fleks-yoo-nit ] – noun a poorly named testing framework that supports unit and integration testing for Flex or ActionScript projects 2. a pluggable testing architecture which facilitates the use of multiple test runners and multiple test listeners
Unit Testing  is taking the  smallest  piece of code,  isolated  from any other factors and determining if it  behaves as  you  expect .
Integration Testing  is assembling already tested units and ensuring the behavior and  interaction between  those  units  are correct.
Functional testing  is translating functional  requirements  of an application  into scripts , which can be executed to ensure requirements have been met.
Unit tests  are for code that can be  isolated . Therefore to be unit tested your  code  must have this trait
To achieve this isolation, you can  mock or  you can  stub dependencies.
Here are some  common techniques  to ensure for code isolation.
Separate construction  from all other application/component logic
function doSomeStuffHere():void { //does stuff var x:SomeClass = new SomeClass(); //does more stuff }
function buildMeOne():SomeClass { return new SomeClass(); } function doSomeStuffHere():void { //does stuff var x:SomeClass = buildMeOne(); //does more stuff }
Favor dependency injection  over dependency lookup
function doIt():void { //does stuff var x:SomeClass = someSingleton.someObj; //does more stuff }
function doIt( someObj:SomeClass ):void { //does stuff //does more stuff }
Code to an  interface   not  to a  implementation
function doIt( someObj:ISomeObj ):void { //does stuff //does more stuff }
Don’t touch  your grandchildren. Don’t play with another  object’s internals .
function doThing():void { someObject.someProperty.someObj.method(); }
Avoid global  state and access if you want to test it
function doThing():void { addValue(singleton.getInstance().firstVal) }
Separate Concerns  because classes that can only be described using the word AND are hard  to test
Understanding FlexUnit
Core Request.iRunner (Suite) Suite A Suite B BlockRunner 1 BlockRunner 2 BlockRunner 3 Suite C BlockRunner 7 BlockRunner 8 Tests Tests Tests Tests Tests UIListener XMLListener CIListener RunNotifier Update a UI Send Data to Server Send Data to Flash Builder Request  Runner:Suite Test Suite A Test Case 1 Test Test Test Test Test Case 2 Test Test Test Test Test Case 3 Test Test Test Test Test Suite C Test Case 7 Test Case 8 Test Suite B Test Case 4 Test Test Test Test Test Case 5 Test Test Test Test Test Case 6 Test Test Test Test Test Suite D Test Case 9 Test Case 10
Some way to start it Something to run it in Someway to know if it passed or failed
Right now it can be started through, Flash Builder, Command Line, Continuous Integration Systems, Ant, IntelliJ
Coming Soon to FDT and Flash Professional
 
Ways to run tests include FlexUnit .9, Fluint1, FlexUnit 4 (Theories, Params, others)
Ways to get data out include Flash Builder, XML, Flex UI
Coming Soon: The World
 
Questions?
Why Test with FlexUnit? Michael Labriola Digital Primates @mlabriola

More Related Content

What's hot (20)

PPS
Transforming Power Point Show with VBA
DCPS
 
PPTX
Introduction to Visual Basic 6.0 Fundamentals
Sanay Kumar
 
PPTX
Visual Programming
Bagzzz
 
PDF
Igor Cernopolc - Http authentication in automated testing - presentation script
Codecamp Romania
 
PPT
Visual programming lecture
AqsaHayat3
 
ODP
Uklug2011 raven newman_21_may
Mary Raven
 
PPT
Visual basic ppt for tutorials computer
simran153
 
PDF
Prepare for "Microsoft Word Skills" Job Interview Questions
Dan Armishaw
 
PPTX
Programming basics
Senri DLN
 
PDF
Apress.migrating.to.windows.phone.dec.2011
gautamkumar048
 
PPTX
Generic Tools - Specific Languages (PhD Defense Slides)
Markus Voelter
 
PDF
Handling errors in t sql code (1)
Ris Fernandez
 
PDF
Visual Basic 6.0
Anjan Mahanta
 
PDF
Refactoring 2 The Max
Alfredo Morresi
 
PPTX
Language-Oriented Business Applications
Markus Voelter
 
PPTX
FrameMaker Corporate Templates with DITA
Publishing Smarter
 
PPT
Introduction to programming using Visual Basic 6
Jeanie Arnoco
 
PPTX
Adobe DITA World: Templates, DITA, and FrameMaker 2015
Publishing Smarter
 
PDF
Wireframe and MVP
Lian Xun
 
PPT
Intro1
phanleson
 
Transforming Power Point Show with VBA
DCPS
 
Introduction to Visual Basic 6.0 Fundamentals
Sanay Kumar
 
Visual Programming
Bagzzz
 
Igor Cernopolc - Http authentication in automated testing - presentation script
Codecamp Romania
 
Visual programming lecture
AqsaHayat3
 
Uklug2011 raven newman_21_may
Mary Raven
 
Visual basic ppt for tutorials computer
simran153
 
Prepare for "Microsoft Word Skills" Job Interview Questions
Dan Armishaw
 
Programming basics
Senri DLN
 
Apress.migrating.to.windows.phone.dec.2011
gautamkumar048
 
Generic Tools - Specific Languages (PhD Defense Slides)
Markus Voelter
 
Handling errors in t sql code (1)
Ris Fernandez
 
Visual Basic 6.0
Anjan Mahanta
 
Refactoring 2 The Max
Alfredo Morresi
 
Language-Oriented Business Applications
Markus Voelter
 
FrameMaker Corporate Templates with DITA
Publishing Smarter
 
Introduction to programming using Visual Basic 6
Jeanie Arnoco
 
Adobe DITA World: Templates, DITA, and FrameMaker 2015
Publishing Smarter
 
Wireframe and MVP
Lian Xun
 
Intro1
phanleson
 

Viewers also liked (6)

PPTX
L2624 labriola
michael.labriola
 
PPTX
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
michael.labriola
 
PPTX
Les nouveautés du Windows Runtime 8.1
Microsoft
 
PPT
Developing for a world wide audience
michael.labriola
 
PPTX
Archives of the Columbia-Princeton Electronic Music Center
Nick Patterson
 
PDF
Blaze Ds Slides
michael.labriola
 
L2624 labriola
michael.labriola
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
michael.labriola
 
Les nouveautés du Windows Runtime 8.1
Microsoft
 
Developing for a world wide audience
michael.labriola
 
Archives of the Columbia-Princeton Electronic Music Center
Nick Patterson
 
Blaze Ds Slides
michael.labriola
 
Ad

Similar to Why test with flex unit (20)

PPTX
Unit Testing and TDD 2017
Xavi Hidalgo
 
PPT
Test-Driven Development
Effective
 
PPT
Test Driven Development
John Blanco
 
PPT
Test-Driven Development
EffectiveUI
 
PDF
DSR Testing (Part 1)
Steve Upton
 
PDF
Test Drive Development
satya sudheer
 
PDF
Unit testing - An introduction
Alejandro Claro Mosqueda
 
PPTX
1.1 Chapter_22_ Unit Testing-testing (1).pptx
tiyaAbid
 
PDF
Unit testing (Exploring the other side as a tester)
Abhijeet Vaikar
 
PDF
Unit testing, principles
Renato Primavera
 
PDF
Introduction to Automated Testing
Lars Thorup
 
PDF
Introduction to-automated-testing
BestBrains
 
PPTX
The Test way
Mikhail Grinfeld
 
KEY
Client Side Unit Testing
cloud chen
 
PDF
Unit Testing
Scott Leberknight
 
KEY
Driving application development through behavior driven development
Einar Ingebrigtsen
 
PPTX
Beginners overview of automated testing with Rspec
jeffrey1ross
 
PPTX
Testing 101
Noam Barkai
 
PPTX
Coding Naked
Caleb Jenkins
 
PPTX
Testing & should i do it
Martin Sykora
 
Unit Testing and TDD 2017
Xavi Hidalgo
 
Test-Driven Development
Effective
 
Test Driven Development
John Blanco
 
Test-Driven Development
EffectiveUI
 
DSR Testing (Part 1)
Steve Upton
 
Test Drive Development
satya sudheer
 
Unit testing - An introduction
Alejandro Claro Mosqueda
 
1.1 Chapter_22_ Unit Testing-testing (1).pptx
tiyaAbid
 
Unit testing (Exploring the other side as a tester)
Abhijeet Vaikar
 
Unit testing, principles
Renato Primavera
 
Introduction to Automated Testing
Lars Thorup
 
Introduction to-automated-testing
BestBrains
 
The Test way
Mikhail Grinfeld
 
Client Side Unit Testing
cloud chen
 
Unit Testing
Scott Leberknight
 
Driving application development through behavior driven development
Einar Ingebrigtsen
 
Beginners overview of automated testing with Rspec
jeffrey1ross
 
Testing 101
Noam Barkai
 
Coding Naked
Caleb Jenkins
 
Testing & should i do it
Martin Sykora
 
Ad

More from michael.labriola (16)

PPTX
Optimizing Browser Rendering
michael.labriola
 
PPT
Randori design goals and justification
michael.labriola
 
PPT
Talking trash
michael.labriola
 
PPTX
Flex 4 components from the firehose
michael.labriola
 
PPT
Developing for a world wide audience
michael.labriola
 
PPT
FlexUnit 4 for contributors
michael.labriola
 
PPT
Write once... Take Less Time to Deploy
michael.labriola
 
PPT
Apocalypse Soon
michael.labriola
 
PPTX
Flex 4 Component Development
michael.labriola
 
PPTX
Any Which Array But Loose
michael.labriola
 
PPT
Air Drag And Drop
michael.labriola
 
PPT
Diving in the Flex Data Binding Waters
michael.labriola
 
PPT
How To Navigate And Extend The Flex Infrastructure
michael.labriola
 
PPT
2007 Max Presentation - Creating Custom Flex Components
michael.labriola
 
PPT
Dense And Hot 360 Flex
michael.labriola
 
PPT
Dense And Hot Web Du
michael.labriola
 
Optimizing Browser Rendering
michael.labriola
 
Randori design goals and justification
michael.labriola
 
Talking trash
michael.labriola
 
Flex 4 components from the firehose
michael.labriola
 
Developing for a world wide audience
michael.labriola
 
FlexUnit 4 for contributors
michael.labriola
 
Write once... Take Less Time to Deploy
michael.labriola
 
Apocalypse Soon
michael.labriola
 
Flex 4 Component Development
michael.labriola
 
Any Which Array But Loose
michael.labriola
 
Air Drag And Drop
michael.labriola
 
Diving in the Flex Data Binding Waters
michael.labriola
 
How To Navigate And Extend The Flex Infrastructure
michael.labriola
 
2007 Max Presentation - Creating Custom Flex Components
michael.labriola
 
Dense And Hot 360 Flex
michael.labriola
 
Dense And Hot Web Du
michael.labriola
 

Recently uploaded (20)

PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
July Patch Tuesday
Ivanti
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 

Why test with flex unit

  • 1. Why Test with FlexUnit? Michael Labriola Digital Primates @mlabriola
  • 2. Who are you? Michael Labriola Senior Consultant at Digital Primates FlexUnit 4 Architect/Lead Developer Fan of Working Code
  • 3. Are you a genius developer who writes perfect code without mistakes ?
  • 4. 80% of your time as a developer is spent identifying and correcting defects .
  • 5. Software mistakes cost the US Economy about 80 billion dollars a year .
  • 6. Half of that is absorbed by consumers .
  • 7. The other half is absorbed by the software developers
  • 8. Errors cost more to fix the later in the process they are found
  • 9. An error found after release can cost 100x more to fix than during early development
  • 10. The point is that we need to do a better job of finding errors and we need to find them sooner .
  • 11. The problem: Software developers , myself included, are hypocrites .
  • 12. Developers will go out of there way to automate things .
  • 13. We will spend time to automate code formatting and simple code generation
  • 14. But when it comes to debugging , something we spend 80% of our time doing, we choose to do that manually
  • 15. Why do you want to spend your time doing a repetitive task that a computer can do for you?
  • 16. What do you think happens to your desire and ability to test when time gets short on a project?
  • 17.  
  • 18.  
  • 19. How do we reverse this trend ? How do we fix these issues ?
  • 20. In the beginner's mind there are many possibilities, in the expert's mind there are few -- Shunryu Suzuki
  • 21. We need to change our approach. We need to do what we do best, automate .
  • 22. Computers do repetitive tasks faster than we can. They also don’t tire of doing so.
  • 23. That means if we automate our tests , we can run them continually .
  • 24. Running tests continually means we find errors sooner . Finding errors sooner in the process is cheaper .
  • 25. So, we spend some of that 80% of our time writing tests instead of all of it debugging.
  • 26. We let our machine run those tests constantly for us.
  • 27. We find mistakes sooner . Mistakes cost less. We sleep better. We enjoy life .
  • 28. There is another benefit too. We write better code .
  • 29. When you have tests for your code you have less fear of change.
  • 30. When you have tests , you can refactor your code. Your code can continually improve in quality.
  • 31. Also, testable code happens to have a whole lot in common with well architected code
  • 32. The title of this session mentions FlexUnit. I haven’t, so what is it?
  • 33. Flex•Unit [fleks-yoo-nit ] – noun a poorly named testing framework that supports unit and integration testing for Flex or ActionScript projects 2. a pluggable testing architecture which facilitates the use of multiple test runners and multiple test listeners
  • 34. Unit Testing is taking the smallest piece of code, isolated from any other factors and determining if it behaves as you expect .
  • 35. Integration Testing is assembling already tested units and ensuring the behavior and interaction between those units are correct.
  • 36. Functional testing is translating functional requirements of an application into scripts , which can be executed to ensure requirements have been met.
  • 37. Unit tests are for code that can be isolated . Therefore to be unit tested your code must have this trait
  • 38. To achieve this isolation, you can mock or you can stub dependencies.
  • 39. Here are some common techniques to ensure for code isolation.
  • 40. Separate construction from all other application/component logic
  • 41. function doSomeStuffHere():void { //does stuff var x:SomeClass = new SomeClass(); //does more stuff }
  • 42. function buildMeOne():SomeClass { return new SomeClass(); } function doSomeStuffHere():void { //does stuff var x:SomeClass = buildMeOne(); //does more stuff }
  • 43. Favor dependency injection over dependency lookup
  • 44. function doIt():void { //does stuff var x:SomeClass = someSingleton.someObj; //does more stuff }
  • 45. function doIt( someObj:SomeClass ):void { //does stuff //does more stuff }
  • 46. Code to an interface not to a implementation
  • 47. function doIt( someObj:ISomeObj ):void { //does stuff //does more stuff }
  • 48. Don’t touch your grandchildren. Don’t play with another object’s internals .
  • 49. function doThing():void { someObject.someProperty.someObj.method(); }
  • 50. Avoid global state and access if you want to test it
  • 51. function doThing():void { addValue(singleton.getInstance().firstVal) }
  • 52. Separate Concerns because classes that can only be described using the word AND are hard to test
  • 54. Core Request.iRunner (Suite) Suite A Suite B BlockRunner 1 BlockRunner 2 BlockRunner 3 Suite C BlockRunner 7 BlockRunner 8 Tests Tests Tests Tests Tests UIListener XMLListener CIListener RunNotifier Update a UI Send Data to Server Send Data to Flash Builder Request Runner:Suite Test Suite A Test Case 1 Test Test Test Test Test Case 2 Test Test Test Test Test Case 3 Test Test Test Test Test Suite C Test Case 7 Test Case 8 Test Suite B Test Case 4 Test Test Test Test Test Case 5 Test Test Test Test Test Case 6 Test Test Test Test Test Suite D Test Case 9 Test Case 10
  • 55. Some way to start it Something to run it in Someway to know if it passed or failed
  • 56. Right now it can be started through, Flash Builder, Command Line, Continuous Integration Systems, Ant, IntelliJ
  • 57. Coming Soon to FDT and Flash Professional
  • 58.  
  • 59. Ways to run tests include FlexUnit .9, Fluint1, FlexUnit 4 (Theories, Params, others)
  • 60. Ways to get data out include Flash Builder, XML, Flex UI
  • 62.  
  • 64. Why Test with FlexUnit? Michael Labriola Digital Primates @mlabriola

Editor's Notes

  • #18: These are influence diagrams from Test-Driven Development by Kent Beck.
  • #19: These are influence diagrams from Test-Driven Development by Kent Beck.
  • #21: Calligraphy Copyright © by Shunryu Suzuki. Quote by Shunryu Suzuki