SlideShare une entreprise Scribd logo
1  sur  35
Using FlexUnit 4 with Flash Professional CS5 Ben Schmidtke Digital Primates
Who Am I? Ben Schmidtke III Consultant - Digital Primates IT Consulting Group Flash Platform Developer for 11 years Adobe Certified Instructor & Developer Currently primary focus is enterprise Flex application development Mentoring clients to become better developers and help overcome complex project requirements using the Flash Platform 2
Who Are You? A Flash ActionScript developer who spends a significant amount of time in Flash Professional CS. You are interested in FlexUnit 4 and learning ways to use it with Flash Professional application development. You may or may not have experience with unit tests.  If this doesn’t describe you then go and enjoy another session. People fitting the above description will get the most out of this session and I personally want you to get the most from your MAX experience. 3
What Is This Session About? Overview of FlexUnit 4 Why we should consider using FlexUnit 4 with Flash CS5 Projects ActionScript Development Workflows For CS5 Building a testable class using Flash CS5 Workflow and testing using Flash Builder 4 Workflow and testing using only Flash Professional CS5 Sneak peak of the FlexUnit 4 panel for Flash CS5 Resources Q&A 4
What Is Not On The Agenda? There is a lot of functionality in FlexUnit 4, we will not be covering a majority of it’s features. There are numerous articles on FlexUnit 4 that go into greater detail regarding it’s full functionality For more information visit www.FlexUnit.org Our time will be spent less on FlexUnit features and more about how to use it with Flash Professional CS 5
A Common Assumption One of the most common false assumptions is that:  “FlexUnit is only for Flex.” This is incorrect! 6
FlexUnit is a Mystical Beast? Possibly… A poorly named testing framework that supports unit and integration testing for ActionScript or Flex projects A pluggable testing architecture which facilitates the use of multiple test runners and multiple test listeners Resulting in FlexUnit 4 being able to: Be used with a Flash Professional CS5 Project Be used with a Flash Builder 4: Flash Professional Project 7
Brief List of FlexUnit 4.x Features Used with ActionScript 3 and Flex projects Use of Metadata tags: [Test], [Suite], etc. Test environment support [Before], [After], [BeforeClass], [AfterClass] Exception Handling Async testing: per test & timeout support Hamcrest assertions Suites & Parameterized Testing Theories, Datapoints and Assumptions And more! 8
Why Should We Be Unit Testing? Developer responsibility to ensure the code written works 100% of the time, all the time. Responsibility to the client Responsibility to fellow developers Responsibility to the budget Responsibility to the brand Flash brand is under increased scrutiny over stability of the platform and the quality of the developers “Flash crashes … ( insert random browser or operation system ) ” 9
Strive To Be Better Programmers 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 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 10
ActionScript Development Workflows For CS5 When writing a Flash application there are two main workflows available to us within the Adobe software when working with ActionScript Native development in Flash Professional CS New workflow using Flash Builder 4 for ActionScript development 11
Workflow Considerations Native Flash Professional CS5 Development No dependency on other programs ActionScript editor is lacking in many areas Hybrid Development using Flash Builder 4 Possibly better ActionScript editor and code generation tools Constantly having to switch between tools 12
Multiple Workflows Allows For Multiple Implementations There are multiple ways to use FlexUnit 4: Native Approach in Flash Professional CS5 Building a FlexUnit 4 application in CS5 to test your application Requires manual setup and additional work No dependency on having Flash Builder Hybrid Approach using Flash Builder 4 Using existing FlexUnit 4 functionality in Flash Builder to test the Flash Professional project Arguably the easiest solution Dependency on having Flash Builder 13
Limitations of Flash Professional CS5 No built in support for FlexUnit 4 No panels No visual feedback for tests run Unable to support additional compiler arguments Required for custom MetaData tags No templates for Tests and Theories 14
Limitations of Flash Builder 4 Flash Builder does not know how to compile FLA’s Flash Builder needs to modify the application to: Support MetaData tags Compile & Run the tests Provide visual feedback regarding success / failures 15
Thinking Small In The Project Writing testable code means writing small pieces of functionality Tests focus on testing small pieces of code “Good Lego’s make strong Lego castles” Many tests result in the testing of the project framework Build an ActionScript framework for your project Building corresponding tests to ensure the framework is bulletproof 16
Walkthrough: Creating the Circle Class In this walkthrough: Using Flash Professional CS5 Create a class that will have rules about a Circle Create a property for diameter Create a property for radius Make sure the class can be compiled into the swf 17
Option 1: Using an ActionScript Library in FB4 In Flash Professional CS5: Go to: “File > Publish Settings…” On the “Flash” Options Tab, Select “Export SWC” Publish the project In Flash Builder 4:  Create a ActionScript 3 project Add the SWC built by Flash Professional to Flex Build Path Write tests 18
FlexUnit 4 Terminology Assert A piece of code that asserts something meets the expected results. Test Method The smallest unit of the testing framework Executes code and checks an outcome Test  Case Collection of Test Methods that share a common test environment Test Suite Collection of Test Cases, and possibly other Test Suite’s 19
Closer Look: What is a Test? A test is a piece of code that determines if a small portion of your project is working as intended In the example below, the test verifies the rules of a Circle by checking if (radius * 2) is equal to the diameter property on a circle object. [Test] public function testDiameter():void { assertEquals( (circle_r2.radius * 2), circle_r2.diameter ); } 20
Walkthrough 2: Write a Test for the Circle Class Export & Add the Flash Project SWC Create a Test Case Class Write a Test Method for the radius property Run the test Review the results Look at a more complete example 21
Notes on Hybrid Testing Workflow & Issues Have to publish the project to generate the SWC when changes are made to the FLA project. Classes and Assets Linkage: Classes must be referenced at least once in the project Assets & Fonts should be linked in via “Export for ActionScript” 22
Option 2: Using FlexUnit 4 in Flash CS5 Required to include FlexUnit4 SWC as a External Library Download latest build from FlexUnit.org ActionScript only version Optionally include additional libraries that work with FlexUnit4 Hamcrest Library CI Library for use with Hudson or other Continuous Integration Systems 23
Option 2: Using FlexUnit 4 in Flash CS5 Setup Setup FlexUnit 4 FLA project to run tests for Flash CS5 project Check “Export SWC” on Flash publish settings Required to use MetaData tags in FlexUnit 4 Add FlexUnit SWC to ActionScript 3 Library Path Add Flash CS5 Project SWC to Library Path Write code to use FlexUnit core & attach a listener to report the outcome of the FlexUnit tests Write code for what FlexUnit tests, suites, etc. to run 24
Walkthrough 3: FlexUnit 4 in Flash CS5 Setup Create FlexUnit CS5 Project Include required SWC’s Setup core & attach TraceListener Include tests used in previous examples Run FlexUnit Application application, review results 25
Option 2: Pros and Cons The Pros: Can do all development and testing from Flash Professional No use of Flash Builder 4 No use of the Flex Framework The Cons: Manual process of setting everything up Use TraceListener or create a UI for FlexUnit Results No templates or panels for assistance 26
Two Problems For Available Workflows Option 1: Importing Project SWC into Flash Builder Dependency on Flash Builder 4 to use FlexUnit 4 FlexUnit does not require Flash Builder Option 2: Bringing FlexUnit 4 into Flash CS5 Requires a lot of manual work! Get/build the AS version of FlexUnit Build a FlexUnit Runner application Etc. 27
Coming Soon: FlexUnit 4 Panel for CS5 Automated process for using FlexUnit 4 in the authoring environment FlexUnit Project Panel Similar to another workspace project for FlexUnit in Flash Builder Easy creation of FlexUnit files Templates for: Tests & Suites Built in UI runner when executing tests 28
A Look at the FlexUnit 4 Panel Overview of the project panel Target SWC’s to test Ability to separate the tests from the Flash Project Easy user interface for developing and managing tests Walkthrough 29
How Does It Work? 30
Future Development Flash CS5 Panel Support Support  Results Panel Provide visual feedback about the results Detailed information for failed tests Ability to upgrade and add new FlexUnit supported SWC’s as new libraries are supported. 31
Honorable Mention ActionScript editors supporting FlexUnit 4 FDT 4 Support for FlexUnit 4 Intellij Numerous community projects integrating with FlexUnit we can leverage: AS3Signals, Hamcrest, Mockolate, FlexMojos, FlexCover, PMD, JavaNCSS, FlexCPD, FlexMentrics And many more For more information: http://docs.flexunit.org/index.php?title=Community_Projects 32
Resources FlexUnit.org – Wiki, Tutorials and More http://flexunit.org/ Adobe Open Source Site http://opensource.adobe.com/wiki/display/flexunit/FlexUnit Latest Source http://www.flexunit.org/?page_id=14 Nightly Builds: http://flexunit.digitalprimates.net:8080/ 33
Q&A? Questions, comments or clarification? Contact: bschmidtke@digitalprimates.net Blog: http://blogs.digitalprimates.net/excessiveRecursion/ Twitter: http://twitter.com/stunnedgrowth 34
Using FlexUnit 4 with Flash CS5

Contenu connexe

Tendances

Using open cv 249 with vs2012
Using open cv 249 with vs2012Using open cv 249 with vs2012
Using open cv 249 with vs2012Wei-Wen Hsu
 
Record of Achievement - Microsoft Virtual Academy
Record of Achievement - Microsoft Virtual AcademyRecord of Achievement - Microsoft Virtual Academy
Record of Achievement - Microsoft Virtual AcademyCliff O'Sullivan
 
Provar webinar 15-03-2018
Provar webinar 15-03-2018Provar webinar 15-03-2018
Provar webinar 15-03-2018Geraint Waters
 
Integrating SalesforceDX and Test Automation
Integrating SalesforceDX and Test AutomationIntegrating SalesforceDX and Test Automation
Integrating SalesforceDX and Test AutomationRichard Clark
 
Team Foundation Server - Tracking & Reporting
Team Foundation Server - Tracking & ReportingTeam Foundation Server - Tracking & Reporting
Team Foundation Server - Tracking & ReportingSteve Lange
 
Branching and Merging Practices
Branching and Merging Practices Branching and Merging Practices
Branching and Merging Practices Rajesh Kumar
 
Telerik Test studio
Telerik Test studio Telerik Test studio
Telerik Test studio Ahamad Sk
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programmingStoian Kirov
 
Team Foundation Server 2010 - Overview
Team Foundation Server 2010 - OverviewTeam Foundation Server 2010 - Overview
Team Foundation Server 2010 - OverviewSteve Lange
 
Continuous integration and delivery
Continuous integration and deliveryContinuous integration and delivery
Continuous integration and deliveryDanilo Pianini
 
MOTODEV Studio for Testing A platform testing based on Eclipse
MOTODEV Studio for Testing A platform testing based on EclipseMOTODEV Studio for Testing A platform testing based on Eclipse
MOTODEV Studio for Testing A platform testing based on Eclipsegustavoeliano
 
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Aravindharamanan S
 
Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"GoIT
 
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp).NET Crowd
 
Understand release engineering
Understand release engineeringUnderstand release engineering
Understand release engineeringgaoliang641
 

Tendances (19)

Using open cv 249 with vs2012
Using open cv 249 with vs2012Using open cv 249 with vs2012
Using open cv 249 with vs2012
 
Record of Achievement - Microsoft Virtual Academy
Record of Achievement - Microsoft Virtual AcademyRecord of Achievement - Microsoft Virtual Academy
Record of Achievement - Microsoft Virtual Academy
 
Provar webinar 15-03-2018
Provar webinar 15-03-2018Provar webinar 15-03-2018
Provar webinar 15-03-2018
 
Integrating SalesforceDX and Test Automation
Integrating SalesforceDX and Test AutomationIntegrating SalesforceDX and Test Automation
Integrating SalesforceDX and Test Automation
 
Team Foundation Server - Tracking & Reporting
Team Foundation Server - Tracking & ReportingTeam Foundation Server - Tracking & Reporting
Team Foundation Server - Tracking & Reporting
 
Branching and Merging Practices
Branching and Merging Practices Branching and Merging Practices
Branching and Merging Practices
 
Telerik Test studio
Telerik Test studio Telerik Test studio
Telerik Test studio
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programming
 
Team Foundation Server 2010 - Overview
Team Foundation Server 2010 - OverviewTeam Foundation Server 2010 - Overview
Team Foundation Server 2010 - Overview
 
DevOps and Visual Studio Team Services
DevOps and Visual Studio Team Services DevOps and Visual Studio Team Services
DevOps and Visual Studio Team Services
 
Continuous integration and delivery
Continuous integration and deliveryContinuous integration and delivery
Continuous integration and delivery
 
Develop MS Office Plugins
Develop MS Office Plugins Develop MS Office Plugins
Develop MS Office Plugins
 
MOTODEV Studio for Testing A platform testing based on Eclipse
MOTODEV Studio for Testing A platform testing based on EclipseMOTODEV Studio for Testing A platform testing based on Eclipse
MOTODEV Studio for Testing A platform testing based on Eclipse
 
Code quality tools
Code quality toolsCode quality tools
Code quality tools
 
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
 
Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"
 
TELERIK COURSE
TELERIK COURSETELERIK COURSE
TELERIK COURSE
 
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
 
Understand release engineering
Understand release engineeringUnderstand release engineering
Understand release engineering
 

Similaire à Using FlexUnit 4 with Flash CS5

Silverlight 4 and Expression Blend
Silverlight 4 and Expression BlendSilverlight 4 and Expression Blend
Silverlight 4 and Expression BlendBruce Johnson
 
Bootstrap4XPages
Bootstrap4XPagesBootstrap4XPages
Bootstrap4XPagesTeamstudio
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development GuideStanley Fok
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010guest5639fa9
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoElad Elrom
 
M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionThomas Daly
 
Afik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAfik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAlphageeks
 
Introduction To Silverlight and Prism
Introduction To Silverlight and PrismIntroduction To Silverlight and Prism
Introduction To Silverlight and Prismtombeuckelaere
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...Paul Withers
 
Exploring Visual Studio 2010
Exploring Visual Studio 2010Exploring Visual Studio 2010
Exploring Visual Studio 2010Sven Vanoirbeek
 
565847651-Az-400t00a-Enu-Powerpoint-05.pptx
565847651-Az-400t00a-Enu-Powerpoint-05.pptx565847651-Az-400t00a-Enu-Powerpoint-05.pptx
565847651-Az-400t00a-Enu-Powerpoint-05.pptxCharlstonMVita
 
flex and flash platform
flex and flash platformflex and flash platform
flex and flash platformMuhammad Rodhy
 
AN INTRODUCTION TO APACHE FLEX
AN INTRODUCTION TO APACHE FLEXAN INTRODUCTION TO APACHE FLEX
AN INTRODUCTION TO APACHE FLEXJoseph Labrecque
 
What's New in Visual Studio 2010
What's New in Visual Studio 2010What's New in Visual Studio 2010
What's New in Visual Studio 2010Adil Mughal
 
mxmlc: fitter, happier, more productive
mxmlc: fitter, happier, more productivemxmlc: fitter, happier, more productive
mxmlc: fitter, happier, more productiveBrian Deitte
 

Similaire à Using FlexUnit 4 with Flash CS5 (20)

Silverlight 4 and Expression Blend
Silverlight 4 and Expression BlendSilverlight 4 and Expression Blend
Silverlight 4 and Expression Blend
 
Bootstrap4XPages
Bootstrap4XPagesBootstrap4XPages
Bootstrap4XPages
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development Guide
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
 
M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx Version
 
Afik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAfik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex Intro
 
Introduction To Silverlight and Prism
Introduction To Silverlight and PrismIntroduction To Silverlight and Prism
Introduction To Silverlight and Prism
 
Tdx highlights
Tdx highlightsTdx highlights
Tdx highlights
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
SB Support System
SB Support SystemSB Support System
SB Support System
 
Exploring Visual Studio 2010
Exploring Visual Studio 2010Exploring Visual Studio 2010
Exploring Visual Studio 2010
 
565847651-Az-400t00a-Enu-Powerpoint-05.pptx
565847651-Az-400t00a-Enu-Powerpoint-05.pptx565847651-Az-400t00a-Enu-Powerpoint-05.pptx
565847651-Az-400t00a-Enu-Powerpoint-05.pptx
 
flex_4_tutorials
flex_4_tutorialsflex_4_tutorials
flex_4_tutorials
 
flex_4_tutorials
flex_4_tutorialsflex_4_tutorials
flex_4_tutorials
 
flex and flash platform
flex and flash platformflex and flash platform
flex and flash platform
 
AN INTRODUCTION TO APACHE FLEX
AN INTRODUCTION TO APACHE FLEXAN INTRODUCTION TO APACHE FLEX
AN INTRODUCTION TO APACHE FLEX
 
What's New in Visual Studio 2010
What's New in Visual Studio 2010What's New in Visual Studio 2010
What's New in Visual Studio 2010
 
mxmlc: fitter, happier, more productive
mxmlc: fitter, happier, more productivemxmlc: fitter, happier, more productive
mxmlc: fitter, happier, more productive
 
Migrate Your E-learning Courses to HTML5 The Right Way!
Migrate Your E-learning Courses to HTML5 The Right Way!Migrate Your E-learning Courses to HTML5 The Right Way!
Migrate Your E-learning Courses to HTML5 The Right Way!
 

Dernier

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Dernier (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Using FlexUnit 4 with Flash CS5

  • 1. Using FlexUnit 4 with Flash Professional CS5 Ben Schmidtke Digital Primates
  • 2. Who Am I? Ben Schmidtke III Consultant - Digital Primates IT Consulting Group Flash Platform Developer for 11 years Adobe Certified Instructor & Developer Currently primary focus is enterprise Flex application development Mentoring clients to become better developers and help overcome complex project requirements using the Flash Platform 2
  • 3. Who Are You? A Flash ActionScript developer who spends a significant amount of time in Flash Professional CS. You are interested in FlexUnit 4 and learning ways to use it with Flash Professional application development. You may or may not have experience with unit tests. If this doesn’t describe you then go and enjoy another session. People fitting the above description will get the most out of this session and I personally want you to get the most from your MAX experience. 3
  • 4. What Is This Session About? Overview of FlexUnit 4 Why we should consider using FlexUnit 4 with Flash CS5 Projects ActionScript Development Workflows For CS5 Building a testable class using Flash CS5 Workflow and testing using Flash Builder 4 Workflow and testing using only Flash Professional CS5 Sneak peak of the FlexUnit 4 panel for Flash CS5 Resources Q&A 4
  • 5. What Is Not On The Agenda? There is a lot of functionality in FlexUnit 4, we will not be covering a majority of it’s features. There are numerous articles on FlexUnit 4 that go into greater detail regarding it’s full functionality For more information visit www.FlexUnit.org Our time will be spent less on FlexUnit features and more about how to use it with Flash Professional CS 5
  • 6. A Common Assumption One of the most common false assumptions is that: “FlexUnit is only for Flex.” This is incorrect! 6
  • 7. FlexUnit is a Mystical Beast? Possibly… A poorly named testing framework that supports unit and integration testing for ActionScript or Flex projects A pluggable testing architecture which facilitates the use of multiple test runners and multiple test listeners Resulting in FlexUnit 4 being able to: Be used with a Flash Professional CS5 Project Be used with a Flash Builder 4: Flash Professional Project 7
  • 8. Brief List of FlexUnit 4.x Features Used with ActionScript 3 and Flex projects Use of Metadata tags: [Test], [Suite], etc. Test environment support [Before], [After], [BeforeClass], [AfterClass] Exception Handling Async testing: per test & timeout support Hamcrest assertions Suites & Parameterized Testing Theories, Datapoints and Assumptions And more! 8
  • 9. Why Should We Be Unit Testing? Developer responsibility to ensure the code written works 100% of the time, all the time. Responsibility to the client Responsibility to fellow developers Responsibility to the budget Responsibility to the brand Flash brand is under increased scrutiny over stability of the platform and the quality of the developers “Flash crashes … ( insert random browser or operation system ) ” 9
  • 10. Strive To Be Better Programmers 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 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 10
  • 11. ActionScript Development Workflows For CS5 When writing a Flash application there are two main workflows available to us within the Adobe software when working with ActionScript Native development in Flash Professional CS New workflow using Flash Builder 4 for ActionScript development 11
  • 12. Workflow Considerations Native Flash Professional CS5 Development No dependency on other programs ActionScript editor is lacking in many areas Hybrid Development using Flash Builder 4 Possibly better ActionScript editor and code generation tools Constantly having to switch between tools 12
  • 13. Multiple Workflows Allows For Multiple Implementations There are multiple ways to use FlexUnit 4: Native Approach in Flash Professional CS5 Building a FlexUnit 4 application in CS5 to test your application Requires manual setup and additional work No dependency on having Flash Builder Hybrid Approach using Flash Builder 4 Using existing FlexUnit 4 functionality in Flash Builder to test the Flash Professional project Arguably the easiest solution Dependency on having Flash Builder 13
  • 14. Limitations of Flash Professional CS5 No built in support for FlexUnit 4 No panels No visual feedback for tests run Unable to support additional compiler arguments Required for custom MetaData tags No templates for Tests and Theories 14
  • 15. Limitations of Flash Builder 4 Flash Builder does not know how to compile FLA’s Flash Builder needs to modify the application to: Support MetaData tags Compile & Run the tests Provide visual feedback regarding success / failures 15
  • 16. Thinking Small In The Project Writing testable code means writing small pieces of functionality Tests focus on testing small pieces of code “Good Lego’s make strong Lego castles” Many tests result in the testing of the project framework Build an ActionScript framework for your project Building corresponding tests to ensure the framework is bulletproof 16
  • 17. Walkthrough: Creating the Circle Class In this walkthrough: Using Flash Professional CS5 Create a class that will have rules about a Circle Create a property for diameter Create a property for radius Make sure the class can be compiled into the swf 17
  • 18. Option 1: Using an ActionScript Library in FB4 In Flash Professional CS5: Go to: “File > Publish Settings…” On the “Flash” Options Tab, Select “Export SWC” Publish the project In Flash Builder 4: Create a ActionScript 3 project Add the SWC built by Flash Professional to Flex Build Path Write tests 18
  • 19. FlexUnit 4 Terminology Assert A piece of code that asserts something meets the expected results. Test Method The smallest unit of the testing framework Executes code and checks an outcome Test Case Collection of Test Methods that share a common test environment Test Suite Collection of Test Cases, and possibly other Test Suite’s 19
  • 20. Closer Look: What is a Test? A test is a piece of code that determines if a small portion of your project is working as intended In the example below, the test verifies the rules of a Circle by checking if (radius * 2) is equal to the diameter property on a circle object. [Test] public function testDiameter():void { assertEquals( (circle_r2.radius * 2), circle_r2.diameter ); } 20
  • 21. Walkthrough 2: Write a Test for the Circle Class Export & Add the Flash Project SWC Create a Test Case Class Write a Test Method for the radius property Run the test Review the results Look at a more complete example 21
  • 22. Notes on Hybrid Testing Workflow & Issues Have to publish the project to generate the SWC when changes are made to the FLA project. Classes and Assets Linkage: Classes must be referenced at least once in the project Assets & Fonts should be linked in via “Export for ActionScript” 22
  • 23. Option 2: Using FlexUnit 4 in Flash CS5 Required to include FlexUnit4 SWC as a External Library Download latest build from FlexUnit.org ActionScript only version Optionally include additional libraries that work with FlexUnit4 Hamcrest Library CI Library for use with Hudson or other Continuous Integration Systems 23
  • 24. Option 2: Using FlexUnit 4 in Flash CS5 Setup Setup FlexUnit 4 FLA project to run tests for Flash CS5 project Check “Export SWC” on Flash publish settings Required to use MetaData tags in FlexUnit 4 Add FlexUnit SWC to ActionScript 3 Library Path Add Flash CS5 Project SWC to Library Path Write code to use FlexUnit core & attach a listener to report the outcome of the FlexUnit tests Write code for what FlexUnit tests, suites, etc. to run 24
  • 25. Walkthrough 3: FlexUnit 4 in Flash CS5 Setup Create FlexUnit CS5 Project Include required SWC’s Setup core & attach TraceListener Include tests used in previous examples Run FlexUnit Application application, review results 25
  • 26. Option 2: Pros and Cons The Pros: Can do all development and testing from Flash Professional No use of Flash Builder 4 No use of the Flex Framework The Cons: Manual process of setting everything up Use TraceListener or create a UI for FlexUnit Results No templates or panels for assistance 26
  • 27. Two Problems For Available Workflows Option 1: Importing Project SWC into Flash Builder Dependency on Flash Builder 4 to use FlexUnit 4 FlexUnit does not require Flash Builder Option 2: Bringing FlexUnit 4 into Flash CS5 Requires a lot of manual work! Get/build the AS version of FlexUnit Build a FlexUnit Runner application Etc. 27
  • 28. Coming Soon: FlexUnit 4 Panel for CS5 Automated process for using FlexUnit 4 in the authoring environment FlexUnit Project Panel Similar to another workspace project for FlexUnit in Flash Builder Easy creation of FlexUnit files Templates for: Tests & Suites Built in UI runner when executing tests 28
  • 29. A Look at the FlexUnit 4 Panel Overview of the project panel Target SWC’s to test Ability to separate the tests from the Flash Project Easy user interface for developing and managing tests Walkthrough 29
  • 30. How Does It Work? 30
  • 31. Future Development Flash CS5 Panel Support Support Results Panel Provide visual feedback about the results Detailed information for failed tests Ability to upgrade and add new FlexUnit supported SWC’s as new libraries are supported. 31
  • 32. Honorable Mention ActionScript editors supporting FlexUnit 4 FDT 4 Support for FlexUnit 4 Intellij Numerous community projects integrating with FlexUnit we can leverage: AS3Signals, Hamcrest, Mockolate, FlexMojos, FlexCover, PMD, JavaNCSS, FlexCPD, FlexMentrics And many more For more information: http://docs.flexunit.org/index.php?title=Community_Projects 32
  • 33. Resources FlexUnit.org – Wiki, Tutorials and More http://flexunit.org/ Adobe Open Source Site http://opensource.adobe.com/wiki/display/flexunit/FlexUnit Latest Source http://www.flexunit.org/?page_id=14 Nightly Builds: http://flexunit.digitalprimates.net:8080/ 33
  • 34. Q&A? Questions, comments or clarification? Contact: bschmidtke@digitalprimates.net Blog: http://blogs.digitalprimates.net/excessiveRecursion/ Twitter: http://twitter.com/stunnedgrowth 34