Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Strategy Pattern and Unit Testing

Implementation of the Strategy software design pattern how that leads to better testing
by

Daryl Hemeon

on 25 June 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Strategy Pattern and Unit Testing

by Daryl Hemeon
The Strategy Pattern
Why design patterns?
Demo
Jamie's Prezi - http://prezi.com/pw0gdcff-nza/strategy/
The philosophy of the Strategy pattern is to have multiple strategies for doing some operation and let the user choose (or some algorithm based on input data) the appropriate strategy to carry out the operation.
1. They help solve complex problems
2. They are easier to maintain because they
have become a standard way to do things
3. They usually provide a great way to create
a series of tests that document your code,
stabilize your code, and let you deploy more
often.
http://en.wikipedia.org/wiki/Strategy_pattern
https://www.dropbox.com/s/sk0503rztd7u6dh/PaymentGatewaySample.zip
References
Software Design Patterns > unit testing > better code
GoF
GoF defines the Strategy pattern as "Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it."
Code Project - http://www.codeproject.com/Articles/346873/Understanding-and-Implementing-the-Strategy-Patter
The Art of Unit Testing - https://www.dropbox.com/s/cjpwz965yptok4j/The%20Art%20of%20Unit%20Testing%20with%20Examples%20in%20.NET.pdf
Unit Test - Definition
A unit test is a piece of a code (usually a method) that invokes another piece of code and checks the correctness of some assumptions afterward. If the assumptions turn out to be wrong, the unit test has failed.
A “unit” is a method or function.
UML Definition
Questions? Comments?
Twitter - https://twitter.com/darylhemeon @darylhemeon
Why?
We want to do this as a group to
have greater reliability so we can
eventually deploy more often and provide better value more often to our
customers
Full transcript