SlideShare ist ein Scribd-Unternehmen logo
1 von 13
TDD & UNIT TESTING RAIN Internal Training Presented by: Chase Brammer Training Date: 1/14/2009
RIA DEVELOPMENT CYCLE
PHASES OF TESTING Unit: Testing individual bits of ActionScript. Such as individual classes or methods. Integration: Testing how your app is actually wired together. Such as-- do the right events trigger the right commands? Acceptance: Testing the whole app. Including how it behaves in a realistic deployment environment. Usability: Testing the flow of human interactions with the application.
[object Object],[object Object],[object Object],[object Object],[object Object],"It's about figuring out what you are trying to do before you run off to try to do it. You write a specification that nails down a small aspect of behavior in a concise, unambiguous, and executable form. It's that simple. Does that mean you write tests? No. It means you write  specifications  of what your code will have to do. It means you specify the behavior of your code ahead of time. But not far ahead of time. In fact, just before you write the code is best because that's when you have as much information at hand as you will up to that point."  WHO, WHAT AND WHY
Testing is like source control.  You don't know how much you need until you start using it. WHO, WHAT AND WHY
HOW IT CAN HELP US (because we are way better than 2advanced) Faster overall development Less expensive (development and maintenance cycles) Less complicated code bases More independent and reusable code Less time and problems with regression testing Break new ground 1  | 2  | 3  | 4  | 5  | 6  | HOW WILL HURT US/PROBLEMS Developer learning curve Slower initial development speed Problems with a MVC type framework (Nimbus, Cairngorm, PureMVC) Poor Documentation 1  | 2  | 3  | 4  |
Yes I and many others within AC use TDD. I understand your frustration with the lack of information out there. I've talked at the last MAX conference about it and AFAIK this will be on Adobe TV soon. I'll ask when exactly. Also, I plan on publishing a lot more around this area.     Best, Alex   Alex Uhlmann  Senior Consultant (Rich Internet Applications) Adobe Consulting POOR DOCUMENTATION
TEST DRIVEN DEVELOPMENT (TDD) Add a test Run tests, see if new one fails Write some code Run tests, watch them succeed Re-factor Repeat 1  | 2  | 3  | 4  | 5  | 6  | TDD Cycle Test-driven development  (TDD), a concept of Extreme Programming, is a technique that uses short development iterations based on pre-written test cases that define desired improvements or new functions. We all sit down and write a piece of code in context, and even if we can sit down and fix that code, it is very difficult to see the relations of that piece of code with the rest of the application.  Especially when working with large teams and projects.
KEY CONCEPTS Write tests firsts to develop expectations A good unit test exercises a single method Decoupled code Program to interfaces Every bug should have a unit test that exercises it before fixing it. | | | | |
TERMS Assertion: An assertion is a statement of expected outcome. In other words, it is the expected result of your test. Test Fixture: Things that are constant across all of your tests.  setUp() and tearDown() functions. Test Case: A test case is the smallest unit of testing. It checks for a specific response to a particular set of inputs. Extends TestCase. Test Suite: A grouping of test cases.  May contain test cases and other test suites. Test Runner: A test runner is a component that often has a graphical interface and displays the outcome of our tests.
KEY CONCEPTS Lets get into the code!
USEFUL LINKS Unit Testing with FlexUnit - InsideRIA   Adobe - Developer Center : Unit testing and Test Driven Development (TDD) for Flex and ActionScript 3.0   Steven Webster: Unit Testing and Test Coverage with Flex   Flex unit testing and continuous integration: Part 1 of 2   The Flex Show: Flex Show Episode 64: Interview with Michael labriola about Fluint Unit Testing Commands - Part 2 - Mocking Command Dependencies | Allen Manning SettingExpectations - mock-as3 - Google Code - Demonstrates the various expectations that can be set.   Continuous integration - Wikipedia, the free encyclopedia   Leif Wells: RIA Evangelist: 10 Questions About FlexUnit and Cairngorm   Flex cookbook beta - Automated TestSuite Generation Flex cookbook beta - Testing Visual Components with FlexUnit Unit testing - Wikipedia, the free encyclopedia   Google Testing Blog: TotT: Use EasyMock   Daniel R.: Asynchronous Testing with FlexUnit   Cairngorm | Allen Manning   Tom Sugden: EventfulTestCase: a FlexUnit extension for testing event dispatching   Using mock objects for complex unit tests   joeberkovitz.com » Moment of Weakness: Weak Event Listeners Can Be Dangerous
Thank You

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Empfohlen

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

TDD and Unit Testing

  • 1. TDD & UNIT TESTING RAIN Internal Training Presented by: Chase Brammer Training Date: 1/14/2009
  • 3. PHASES OF TESTING Unit: Testing individual bits of ActionScript. Such as individual classes or methods. Integration: Testing how your app is actually wired together. Such as-- do the right events trigger the right commands? Acceptance: Testing the whole app. Including how it behaves in a realistic deployment environment. Usability: Testing the flow of human interactions with the application.
  • 4.
  • 5. Testing is like source control. You don't know how much you need until you start using it. WHO, WHAT AND WHY
  • 6. HOW IT CAN HELP US (because we are way better than 2advanced) Faster overall development Less expensive (development and maintenance cycles) Less complicated code bases More independent and reusable code Less time and problems with regression testing Break new ground 1 | 2 | 3 | 4 | 5 | 6 | HOW WILL HURT US/PROBLEMS Developer learning curve Slower initial development speed Problems with a MVC type framework (Nimbus, Cairngorm, PureMVC) Poor Documentation 1 | 2 | 3 | 4 |
  • 7. Yes I and many others within AC use TDD. I understand your frustration with the lack of information out there. I've talked at the last MAX conference about it and AFAIK this will be on Adobe TV soon. I'll ask when exactly. Also, I plan on publishing a lot more around this area.    Best, Alex   Alex Uhlmann Senior Consultant (Rich Internet Applications) Adobe Consulting POOR DOCUMENTATION
  • 8. TEST DRIVEN DEVELOPMENT (TDD) Add a test Run tests, see if new one fails Write some code Run tests, watch them succeed Re-factor Repeat 1 | 2 | 3 | 4 | 5 | 6 | TDD Cycle Test-driven development (TDD), a concept of Extreme Programming, is a technique that uses short development iterations based on pre-written test cases that define desired improvements or new functions. We all sit down and write a piece of code in context, and even if we can sit down and fix that code, it is very difficult to see the relations of that piece of code with the rest of the application. Especially when working with large teams and projects.
  • 9. KEY CONCEPTS Write tests firsts to develop expectations A good unit test exercises a single method Decoupled code Program to interfaces Every bug should have a unit test that exercises it before fixing it. | | | | |
  • 10. TERMS Assertion: An assertion is a statement of expected outcome. In other words, it is the expected result of your test. Test Fixture: Things that are constant across all of your tests. setUp() and tearDown() functions. Test Case: A test case is the smallest unit of testing. It checks for a specific response to a particular set of inputs. Extends TestCase. Test Suite: A grouping of test cases. May contain test cases and other test suites. Test Runner: A test runner is a component that often has a graphical interface and displays the outcome of our tests.
  • 11. KEY CONCEPTS Lets get into the code!
  • 12. USEFUL LINKS Unit Testing with FlexUnit - InsideRIA Adobe - Developer Center : Unit testing and Test Driven Development (TDD) for Flex and ActionScript 3.0 Steven Webster: Unit Testing and Test Coverage with Flex Flex unit testing and continuous integration: Part 1 of 2 The Flex Show: Flex Show Episode 64: Interview with Michael labriola about Fluint Unit Testing Commands - Part 2 - Mocking Command Dependencies | Allen Manning SettingExpectations - mock-as3 - Google Code - Demonstrates the various expectations that can be set. Continuous integration - Wikipedia, the free encyclopedia Leif Wells: RIA Evangelist: 10 Questions About FlexUnit and Cairngorm Flex cookbook beta - Automated TestSuite Generation Flex cookbook beta - Testing Visual Components with FlexUnit Unit testing - Wikipedia, the free encyclopedia Google Testing Blog: TotT: Use EasyMock Daniel R.: Asynchronous Testing with FlexUnit Cairngorm | Allen Manning Tom Sugden: EventfulTestCase: a FlexUnit extension for testing event dispatching Using mock objects for complex unit tests joeberkovitz.com » Moment of Weakness: Weak Event Listeners Can Be Dangerous