Your SlideShare is downloading. ×
0
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Flex Mock Testing Frameworks: Comparative Analysis

2,139

Published on

The presentation gives a comparative analysis of various mocking frameworks available to help writing unit tests in Actionscript/Flex

The presentation gives a comparative analysis of various mocking frameworks available to help writing unit tests in Actionscript/Flex

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,139
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Mocking in ActionScript 3.0: Comparative Analysis of various mocking frameworks
  • 2. Basic Highlights <ul><li>Importance of Mocking in Unit Testing </li></ul><ul><li>How to Mock? </li></ul><ul><li>Exploring various mocking frameworks </li></ul><ul><li>Hands On some frameworks </li></ul><ul><li>Q & A </li></ul>
  • 3. What is Mocking? What is Mock Object?
  • 4. mock objects  are simulated objects that mimic the behavior of complex, real objects in controlled ways
  • 5. Why to Mock? When to Mock? Mock == Actual Object?
  • 6. If an object has any of the following characteristics, it may be useful to use a mock object in its place: - supplies  non-deterministic results (e.g. the current time or the current temperature); - has states that are difficult to create or reproduce (e.g. a network error ); - is slow (e.g. a complete database, which would have to be initialized before the test); - does not yet exist or may change behavior; - would have to include information and methods exclusively for testing purposes (and not for its actual task).
  • 7. How to mock?
  • 8. Example: The Greeting component says Hello in any language. Greeting uses a Translator component to translate “Hello” from English to the selected language. ITranslator is an interface containing the translate method – parameters from, to and word, which returns the translated word;
  • 9. Traditional Way Vs Mocking Frameworks
  • 10. Traditional Way
  • 11. Evolution of Mocking Frameworks Mock4AS MockAS3 Mockolate
  • 12. Mock4AS <ul><li>Record, Expect & Verify </li></ul><ul><li>Added Mock into Traditional Approach </li></ul><ul><li>More of Traditional touch and posses similar issues </li></ul><ul><li>Less mature </li></ul>
  • 13. MockAS3 <ul><li>Expectation Based </li></ul><ul><li>Similar to Mock4AS in approach </li></ul><ul><li>Enhanced Setting Expectations </li></ul><ul><li>* Receive Count , Property, Ordering Expectations, Calling Functions </li></ul><ul><li>Posses problems similar as in Traditional approach </li></ul>
  • 14. FlexUnit: Runners & Rules Runners are classes that implement IRunner, and have the capability to run specific types of suites, tests, or methods. Rules are an advanced concept whose basic functionality is similar to the [Before] and [After] concepts, allowing for reusable, dynamic classes that will execute functionality before and after each test.
  • 15. <ul><li>Kick started the concept of proxy mock objects </li></ul><ul><li>Purely Record-Replay Based </li></ul><ul><li>Totally bypassed the Traditional Approach </li></ul><ul><li>Difficult & complex to implement </li></ul><ul><li>Enhanced & Advance Features: </li></ul><ul><ul><li>Mock Repository </li></ul></ul><ul><ul><li>Multi-Platform support (Flexunit, Asunit, Fluint..) </li></ul></ul><ul><ul><li>Argument Constraints </li></ul></ul><ul><ul><li>Stub | Dynamic | Strict Mocks </li></ul></ul><ul><ul><li>Event Stubbing … </li></ul></ul>
  • 16. <ul><li>Purely Expectation Based </li></ul><ul><li>Based on Mockito for Java </li></ul><ul><li>Easy to learn & integrate </li></ul><ul><li>Matcher, Hamcrest API integrated </li></ul><ul><li>Employs the concept of Rule & Runner in Flexunit </li></ul><ul><li>Not much advanced & mature features like ASMock </li></ul>
  • 17. Mockolate <ul><li>Include Good aspects of ASMock & Mockito </li></ul><ul><li>Expectation & Record-Replay based </li></ul><ul><li>Nice | Strict | Partial Mocks </li></ul><ul><li>Mocking & Stubbing </li></ul><ul><li>Test Spies </li></ul><ul><li>Decorators like EventDispatcher, HttpService </li></ul><ul><li>Cannot mock classes in default package </li></ul>
  • 18. What Suites You??
  • 19. Questions??

×