<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rpandit</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rpandit"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Rpandit"/>
	<updated>2026-08-12T16:18:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24990</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24990"/>
		<updated>2009-10-10T00:19:51Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Maintenance Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Re-engineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
Design patterns are classified into three types based on purpose.[3]&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns.[3]&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Design patterns can be classified based on the functionality they are intended to achieve.[4]&lt;br /&gt;
*Creation&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
*Communication&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard]&lt;br /&gt;
*Access&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Proxy_pattern Proxy]&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Command_pattern Command]&lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can also be classified based on the architectural principles they rely on.[4]&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
* Encapsulation&lt;br /&gt;
**Example:[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Bridge_pattern Bridge]&lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural patterns]: These are applied to software systems at a very high level&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard System]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Design_patterns Design patterns]: These are applied to components and subsystems&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Programming_idiom Idioms]: These are coding patterns applied at the lowest level&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter Incrementing a Counter]&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Polling_%28computer_science%29 Polling] : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to look up the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”[1]&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a data type are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern [http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html Session-Façade] in J2EE   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Re-engineering Patterns==&lt;br /&gt;
&lt;br /&gt;
To add to the classes of pattern classification, Re-engineering Patterns can be thought of as a good candidate. These patterens facilitate the improvement in maintainability, performance and to accommodate further changes &lt;br /&gt;
to legacy systems.[5]&lt;br /&gt;
&lt;br /&gt;
*For example the ”Split Up God Class”pattern addresses the problem of application functionality being concentrated in only one class, which uses other classes as data structures.&lt;br /&gt;
&lt;br /&gt;
*Suggested solution includes:&lt;br /&gt;
**Incrementally moving some functionality of the god class to other classes.&lt;br /&gt;
**Creation of new classes.&lt;br /&gt;
**Finally the god class remains as a facade or can be removed.&lt;br /&gt;
&lt;br /&gt;
== Performance Patterns ==&lt;br /&gt;
&lt;br /&gt;
This classification aims at identifying patterns that facilitate to improve performance and scalability of software.[6]&lt;br /&gt;
&lt;br /&gt;
* Fast Path pattern &lt;br /&gt;
** aims at improving the response time by reducing processing required to access main functionality.&lt;br /&gt;
&lt;br /&gt;
==Maintenance Patterns==&lt;br /&gt;
&lt;br /&gt;
Also known as [http://www.cs.tut.fi/~kk/webstuff/PatternClassificationKalvot.pdf Evolution Patterns], these patterns aim at describing typical changes during lifetime of a software system. The name given to  these patterns might force reader to get confused with Re-engineering Patterns. However, maintenance patterns are different from Re-engineering patterns. While Re-engineering patterns aims at identifying patterns based on addressing problematic situations during system's evolution, Maintenance patterns aims at finding common general rules how the system evolves&lt;br /&gt;
&lt;br /&gt;
* Maintenance Patterns also document system-specific problems and code points where the system may be maintained.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;br /&gt;
*[5]S. Demeyer, S. Ducasse and O. Nierstrasz. “Object-oriented Reengineering Patterns”, Elsevier Science 2003.&lt;br /&gt;
*[6]C. U. Smith and L. G. Williams. “Performance Solutions –A Practical guide to Creating Responsive, Scalable Software”, Addison-Wesley 2001.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24983</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24983"/>
		<updated>2009-10-10T00:18:36Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Paradigm based Classification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Re-engineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
Design patterns are classified into three types based on purpose.[3]&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns.[3]&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Design patterns can be classified based on the functionality they are intended to achieve.[4]&lt;br /&gt;
*Creation&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
*Communication&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard]&lt;br /&gt;
*Access&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Proxy_pattern Proxy]&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Command_pattern Command]&lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can also be classified based on the architectural principles they rely on.[4]&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
* Encapsulation&lt;br /&gt;
**Example:[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Bridge_pattern Bridge]&lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural patterns]: These are applied to software systems at a very high level&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard System]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Design_patterns Design patterns]: These are applied to components and subsystems&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Programming_idiom Idioms]: These are coding patterns applied at the lowest level&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter Incrementing a Counter]&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Polling_%28computer_science%29 Polling] : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to look up the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”[1]&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a data type are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern [http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html Session-Façade] in J2EE   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Re-engineering Patterns==&lt;br /&gt;
&lt;br /&gt;
To add to the classes of pattern classification, Re-engineering Patterns can be thought of as a good candidate. These patterens facilitate the improvement in maintainability, performance and to accommodate further changes &lt;br /&gt;
to legacy systems.[5]&lt;br /&gt;
&lt;br /&gt;
*For example the ”Split Up God Class”pattern addresses the problem of application functionality being concentrated in only one class, which uses other classes as data structures.&lt;br /&gt;
&lt;br /&gt;
*Suggested solution includes:&lt;br /&gt;
**Incrementally moving some functionality of the god class to other classes.&lt;br /&gt;
**Creation of new classes.&lt;br /&gt;
**Finally the god class remains as a facade or can be removed.&lt;br /&gt;
&lt;br /&gt;
== Performance Patterns ==&lt;br /&gt;
&lt;br /&gt;
This classification aims at identifying patterns that facilitate to improve performance and scalability of software.[6]&lt;br /&gt;
&lt;br /&gt;
* Fast Path pattern &lt;br /&gt;
** aims at improving the response time by reducing processing required to access main functionality.&lt;br /&gt;
&lt;br /&gt;
==Maintenance Patterns==&lt;br /&gt;
&lt;br /&gt;
Also known as Evolution Patterns, these patterns aim at describing typical changes during lifetime of a software system. The name given to  these patterns might force reader to get confused with Re-engineering Patterns. However, maintenance patterns are different from Re-engineering patterns. While Re-engineering patterns aims at identifying patterns based on addressing problematic situations during system's evolution, Maintenance patterns aims at finding common general rules how the system evolves&lt;br /&gt;
&lt;br /&gt;
* Maintenance Patterns also document system-specific problems and code points where the system may be maintained.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;br /&gt;
*[5]S. Demeyer, S. Ducasse and O. Nierstrasz. “Object-oriented Reengineering Patterns”, Elsevier Science 2003.&lt;br /&gt;
*[6]C. U. Smith and L. G. Williams. “Performance Solutions –A Practical guide to Creating Responsive, Scalable Software”, Addison-Wesley 2001.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24963</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24963"/>
		<updated>2009-10-10T00:14:42Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Granularity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Re-engineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
Design patterns are classified into three types based on purpose.[3]&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns.[3]&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Design patterns can be classified based on the functionality they are intended to achieve.[4]&lt;br /&gt;
*Creation&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
*Communication&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard]&lt;br /&gt;
*Access&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Proxy_pattern Proxy]&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Command_pattern Command]&lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can also be classified based on the architectural principles they rely on.[4]&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
* Encapsulation&lt;br /&gt;
**Example:[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Bridge_pattern Bridge]&lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural patterns]: These are applied to software systems at a very high level&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Design_patterns Design patterns]: These are applied to components and subsystems&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Programming_idiom Idioms]: These are coding patterns applied at the lowest level&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Polling_%28computer_science%29 Polling] : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to look up the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a data type are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern [http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html Session-Façade] in J2EE   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Re-engineering Patterns==&lt;br /&gt;
&lt;br /&gt;
To add to the classes of pattern classification, Re-engineering Patterns can be thought of as a good candidate. These patterens facilitate the improvement in maintainability, performance and to accommodate further changes &lt;br /&gt;
to legacy systems.[5]&lt;br /&gt;
&lt;br /&gt;
*For example the ”Split Up God Class”pattern addresses the problem of application functionality being concentrated in only one class, which uses other classes as data structures.&lt;br /&gt;
&lt;br /&gt;
*Suggested solution includes:&lt;br /&gt;
**Incrementally moving some functionality of the god class to other classes.&lt;br /&gt;
**Creation of new classes.&lt;br /&gt;
**Finally the god class remains as a facade or can be removed.&lt;br /&gt;
&lt;br /&gt;
== Performance Patterns ==&lt;br /&gt;
&lt;br /&gt;
This classification aims at identifying patterns that facilitate to improve performance and scalability of software.[6]&lt;br /&gt;
&lt;br /&gt;
* Fast Path pattern &lt;br /&gt;
** aims at improving the response time by reducing processing required to access main functionality.&lt;br /&gt;
&lt;br /&gt;
==Maintenance Patterns==&lt;br /&gt;
&lt;br /&gt;
Also known as Evolution Patterns, these patterns aim at describing typical changes during lifetime of a software system. The name given to  these patterns might force reader to get confused with Re-engineering Patterns. However, maintenance patterns are different from Re-engineering patterns. While Re-engineering patterns aims at identifying patterns based on addressing problematic situations during system's evolution, Maintenance patterns aims at finding common general rules how the system evolves&lt;br /&gt;
&lt;br /&gt;
* Maintenance Patterns also document system-specific problems and code points where the system may be maintained.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;br /&gt;
*[5]S. Demeyer, S. Ducasse and O. Nierstrasz. “Object-oriented Reengineering Patterns”, Elsevier Science 2003.&lt;br /&gt;
*[6]C. U. Smith and L. G. Williams. “Performance Solutions –A Practical guide to Creating Responsive, Scalable Software”, Addison-Wesley 2001.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24941</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24941"/>
		<updated>2009-10-10T00:10:26Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
Design patterns are classified into three types based on purpose.[3]&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns.[3]&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Design patterns can be classified based on the functionality they are intended to achieve.[4]&lt;br /&gt;
*Creation&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
*Communication&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard]&lt;br /&gt;
*Access&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Proxy_pattern Proxy]&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Command_pattern Command]&lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can also be classified based on the architectural principles they rely on.[4]&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
* Encapsulation&lt;br /&gt;
**Example:[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Bridge_pattern Bridge]&lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*Architectural patterns: These are applied to software systems at a very high level&lt;br /&gt;
*Design patterns: These are applied to components and subsystems&lt;br /&gt;
*Idioms: These are coding patterns applied at the lowest level&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Polling_%28computer_science%29 Polling] : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern [http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html Session-Façade] in J2EE   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reengineering Patterns==&lt;br /&gt;
&lt;br /&gt;
To add to the classes of pattern classification, Reengineering Patterns can be thought of as a good candidate. These patterens facilitate the improvement in maintainability, performance and to accomodate further changes &lt;br /&gt;
to legacy systems.[5]&lt;br /&gt;
&lt;br /&gt;
*For example the ”Split Up God Class”pattern addresses the problem of application functionality being concentrated in only one class, which uses other classes as data structures.&lt;br /&gt;
&lt;br /&gt;
*Suggested solution includes:&lt;br /&gt;
**Incrementally moving some functionality of the god class to other classes.&lt;br /&gt;
**Creation of new classes.&lt;br /&gt;
**Finally the god class remains as a facade or can be removed.&lt;br /&gt;
&lt;br /&gt;
== Performance Patterns ==&lt;br /&gt;
&lt;br /&gt;
This classification aims at identifing patterns that facilitate to improve performance and scalability of software.[6]&lt;br /&gt;
&lt;br /&gt;
* Fast Path pattern &lt;br /&gt;
** aims at improving the response time by reducing processing required to access main functionality.&lt;br /&gt;
&lt;br /&gt;
==Maintenance Patterns==&lt;br /&gt;
&lt;br /&gt;
Also known as Evolution Patterns, these patterns aim at describing typical changes during lifetime of a software system. The name given to  these patterns might force reader to get confused with Reengineering Patterns. However, maintainance patterns are different from Reengineering patterns. While Reengineering patterns aims at identifing patterns based on adressing problematic situations during system's evolution, Maintainance patterns aims at finding common general rules how the system evolves&lt;br /&gt;
&lt;br /&gt;
* Maintenance Patterns also document system-specific problems and code points where the system may be maintained.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;br /&gt;
*[5]S. Demeyer, S. Ducasse and O. Nierstrasz. “Object-oriented Reengineering Patterns”, Elsevier Science 2003.&lt;br /&gt;
*[6]C. U. Smith and L. G. Williams. “Performance Solutions –A Practical guide to Creating Responsive, Scalable Software”, Addison-Wesley 2001.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24902</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24902"/>
		<updated>2009-10-10T00:01:33Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Process&lt;br /&gt;
*Analysis&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
In the book  Design Patterns: Elements of Reusable Object-Oriented Software written by Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides design patterns are classified into three types based on purpose.&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns. In the book Design Patterns: Elements of Reusable Object-Oriented Software patterns are classified into the following two categories based on scope&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann classify patterns based on the functionality they are intended to achieve. The following are the categories&lt;br /&gt;
*Creation&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
*Communication&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard]&lt;br /&gt;
*Access&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Proxy_pattern Proxy]&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Command_pattern Command]&lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
In the book &amp;quot;Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects&amp;quot; by Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann patterns are classified based on the architectural principles they rely on. The categories are&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
* Encapsulation&lt;br /&gt;
**Example:[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Bridge_pattern Bridge]&lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*Architectural patterns: These are applied to software systems at a very high level&lt;br /&gt;
*Design patterns: These are applied to components and subsystems&lt;br /&gt;
*Idioms: These are coding patterns applied at the lowest level&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Polling_%28computer_science%29 Polling] : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern “Session-Façade” in J2EE   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reengineering Patterns==&lt;br /&gt;
&lt;br /&gt;
To add to the classes of pattern classification, Reengineering Patterns can be thought of as a good candidate. These patterens facilitate the improvement in maintainability, performance and to accomodate further changes &lt;br /&gt;
to legacy systems.[5]&lt;br /&gt;
&lt;br /&gt;
*For example the ”Split Up God Class”pattern addresses the problem of application functionality being concentrated in only one class, which uses other classes as data structures.&lt;br /&gt;
&lt;br /&gt;
*Suggested solution includes:&lt;br /&gt;
**Incrementally moving some functionality of the god class to other classes.&lt;br /&gt;
**Creation of new classes.&lt;br /&gt;
**Finally the god class remains as a facade or can be removed.&lt;br /&gt;
&lt;br /&gt;
== Performance Patterns ==&lt;br /&gt;
&lt;br /&gt;
This classification aims at identifing patterns that facilitate to improve performance and scalability of software.[6]&lt;br /&gt;
&lt;br /&gt;
* Fast Path pattern &lt;br /&gt;
** aims at improving the response time by reducing processing required to access main functionality.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;br /&gt;
*[5]S. Demeyer, S. Ducasse and O. Nierstrasz. “Object-oriented Reengineering Patterns”, Elsevier Science 2003.&lt;br /&gt;
*[6]C. U. Smith and L. G. Williams. “Performance Solutions –A Practical guide to Creating Responsive, Scalable Software”, Addison-Wesley 2001.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24887</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24887"/>
		<updated>2009-10-09T23:55:33Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Reengineering Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Process&lt;br /&gt;
*Analysis&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
In the book  Design Patterns: Elements of Reusable Object-Oriented Software written by Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides design patterns are classified into three types based on purpose.&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns. In the book Design Patterns: Elements of Reusable Object-Oriented Software patterns are classified into the following two categories based on scope&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann classify patterns based on the functionality they are intended to achieve. The following are the categories&lt;br /&gt;
*Creation&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
*Communication&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard]&lt;br /&gt;
*Access&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Proxy_pattern Proxy]&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Command_pattern Command]&lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
In the book &amp;quot;Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects&amp;quot; by Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann patterns are classified based on the architectural principles they rely on. The categories are&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
* Encapsulation&lt;br /&gt;
**Example:[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Bridge_pattern Bridge]&lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*Architectural patterns: These are applied to software systems at a very high level&lt;br /&gt;
*Design patterns: These are applied to components and subsystems&lt;br /&gt;
*Idioms: These are coding patterns applied at the lowest level&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Polling_%28computer_science%29 Polling] : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern “Session-Façade” in J2EE   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reengineering Patterns==&lt;br /&gt;
&lt;br /&gt;
To add to the classes of pattern classification, Reengineering Patterns can be thought of as a good candidate. These patterens facilitate the improvement in maintainability, performance and to accomodate further changes &lt;br /&gt;
to legacy systems.[5]&lt;br /&gt;
&lt;br /&gt;
*For example the ”Split Up God Class”pattern addresses the problem of application functionality being concentrated in only one class, which uses other classes as data structures.&lt;br /&gt;
&lt;br /&gt;
*Suggested solution includes:&lt;br /&gt;
**Incrementally moving some functionality of the god class to other classes.&lt;br /&gt;
**Creation of new classes.&lt;br /&gt;
**Finally the god class remains as a facade or can be removed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;br /&gt;
*[5]S. Demeyer, S. Ducasse and O. Nierstrasz. “Object-oriented Reengineering Patterns”, Elsevier Science 2003.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24885</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24885"/>
		<updated>2009-10-09T23:55:14Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Process&lt;br /&gt;
*Analysis&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
In the book  Design Patterns: Elements of Reusable Object-Oriented Software written by Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides design patterns are classified into three types based on purpose.&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns. In the book Design Patterns: Elements of Reusable Object-Oriented Software patterns are classified into the following two categories based on scope&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann classify patterns based on the functionality they are intended to achieve. The following are the categories&lt;br /&gt;
*Creation&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
*Communication&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard]&lt;br /&gt;
*Access&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Proxy_pattern Proxy]&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Command_pattern Command]&lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
In the book &amp;quot;Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects&amp;quot; by Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann patterns are classified based on the architectural principles they rely on. The categories are&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
* Encapsulation&lt;br /&gt;
**Example:[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Bridge_pattern Bridge]&lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*Architectural patterns: These are applied to software systems at a very high level&lt;br /&gt;
*Design patterns: These are applied to components and subsystems&lt;br /&gt;
*Idioms: These are coding patterns applied at the lowest level&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Polling_%28computer_science%29 Polling] : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern “Session-Façade” in J2EE   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reengineering Patterns==&lt;br /&gt;
&lt;br /&gt;
To add to the classes of pattern classification, Reengineering Patterns can be thought of as a good candidate. These patterens facilitate the improvement in maintainability, performance and to accomodate further changes &lt;br /&gt;
to legacy systems.[Demeyer03]&lt;br /&gt;
&lt;br /&gt;
*For example the ”Split Up God Class”pattern addresses the problem of application functionality being concentrated in only one class, which uses other classes as data structures.&lt;br /&gt;
&lt;br /&gt;
*Suggested solution includes:&lt;br /&gt;
**Incrementally moving some functionality of the god class to other classes.&lt;br /&gt;
**Creation of new classes.&lt;br /&gt;
**Finally the god class remains as a facade or can be removed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;br /&gt;
*[5]S. Demeyer, S. Ducasse and O. Nierstrasz. “Object-oriented Reengineering Patterns”, Elsevier Science 2003.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24876</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24876"/>
		<updated>2009-10-09T23:54:10Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Process&lt;br /&gt;
*Analysis&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
In the book  Design Patterns: Elements of Reusable Object-Oriented Software written by Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides design patterns are classified into three types based on purpose.&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns. In the book Design Patterns: Elements of Reusable Object-Oriented Software patterns are classified into the following two categories based on scope&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann classify patterns based on the functionality they are intended to achieve. The following are the categories&lt;br /&gt;
*Creation&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
*Communication&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Blackboard_system Blackboard]&lt;br /&gt;
*Access&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Proxy_pattern Proxy]&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Command_pattern Command]&lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
In the book &amp;quot;Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects&amp;quot; by Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann patterns are classified based on the architectural principles they rely on. The categories are&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
* Encapsulation&lt;br /&gt;
**Example:[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
**Example: [http://en.wikipedia.org/wiki/Bridge_pattern Bridge]&lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*Architectural patterns: These are applied to software systems at a very high level&lt;br /&gt;
*Design patterns: These are applied to components and subsystems&lt;br /&gt;
*Idioms: These are coding patterns applied at the lowest level&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*Polling : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern “Session-Façade” in J2EE   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reengineering Patterns==&lt;br /&gt;
&lt;br /&gt;
To add to the classes of pattern classification, Reengineering Patterns can be thought of as a good candidate. These patterens facilitate the improvement in maintainability, performance and to accomodate further changes &lt;br /&gt;
to legacy systems.[Demeyer03]&lt;br /&gt;
&lt;br /&gt;
*For example the ”Split Up God Class”pattern addresses the problem of application functionality being concentrated in only one class, which uses other classes as data structures.&lt;br /&gt;
&lt;br /&gt;
*Suggested solution includes:&lt;br /&gt;
**Incrementally moving some functionality of the god class to other classes.&lt;br /&gt;
**Creation of new classes.&lt;br /&gt;
**Finally the god class remains as a facade or can be removed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24814</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24814"/>
		<updated>2009-10-09T23:36:06Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Process&lt;br /&gt;
*Analysis&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Design patterns can also be classified according to what they are intended to achieve. This is in fact one of the most useful schemes of classification since it meets all the desirability requirements mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
In the book  Design Patterns: Elements of Reusable Object-Oriented Software written by Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides design patterns are classified into three types based on purpose.&lt;br /&gt;
&lt;br /&gt;
*Creational Patterns &lt;br /&gt;
**Examples:  [http://en.wikipedia.org/wiki/Factory_method_pattern Factory Method], [http://en.wikipedia.org/wiki/Singleton_pattern Singleton]&lt;br /&gt;
&lt;br /&gt;
*Structural Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter],[http://en.wikipedia.org/wiki/Facade_pattern Facade]&lt;br /&gt;
*Behavioral Patterns&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern Chain of Responsibility],[http://en.wikipedia.org/wiki/Iterator_pattern Iterator]&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
Design patterns can also be classified based on the features implementing the patterns. In the book Design Patterns: Elements of Reusable Object-Oriented Software patterns are classified into the following two categories based on scope&lt;br /&gt;
&lt;br /&gt;
*Class representation: Uses inheritance&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
*Object representation: Uses composition&lt;br /&gt;
**Examples: [http://en.wikipedia.org/wiki/Singleton_pattern Singleton], [http://en.wikipedia.org/wiki/Adapter_pattern Adapter]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann classify patterns based on the functionality they are intended to achieve. The following are the categories&lt;br /&gt;
*Creation&lt;br /&gt;
*Communication&lt;br /&gt;
*Access&lt;br /&gt;
*Organizing the computation of complex tasks &lt;br /&gt;
&lt;br /&gt;
== Structural Principles ==&lt;br /&gt;
&lt;br /&gt;
In the book &amp;quot;Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects&amp;quot; by Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann patterns are classified based on the architectural principles they rely on. The categories are&lt;br /&gt;
&lt;br /&gt;
* Abstraction&lt;br /&gt;
* Encapsulation&lt;br /&gt;
* Separation of concerns&lt;br /&gt;
* Coupling and cohesion &lt;br /&gt;
&lt;br /&gt;
== Granularity ==&lt;br /&gt;
Patterns can also be classified based on the level of granularity at which they can be applied. However several patterns can be applied at different levels of granularity. Based on this patterns are classified into the following types&lt;br /&gt;
&lt;br /&gt;
*Architectural patterns: These are applied to software systems at a very high level&lt;br /&gt;
*Design patterns: These are applied to components and subsystems&lt;br /&gt;
*Idioms: These are coding patterns applied at the lowest level&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*Polling : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
==Domain Dependent==&lt;br /&gt;
&lt;br /&gt;
This classification is based on the patterns that can only be implemented in a particular domain. However not all of the patterns can be classified strictly into it, as the pattern represent solution to a generalized problem. It is worthwhile to notice that due to inherent reasons in a domain a solution can be generalized over a class of problems in a domain. The generalized solution that are domain specific bring forth the need to classify these patterns. This classification also assists the programmer, if he encounters a problem he can look up if there exists a design pattern available to solve it elegantly.&lt;br /&gt;
&lt;br /&gt;
* The most widely known example for a domain dependent design pattern “Session-Façade” in J2EE   &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;br /&gt;
*[3] [Gamma95] E. Gamma, R. Helm, R. Johnson  and J. Vlissides.  “Design Patterns – Elements of Reusable Object-Oriented  Software”, Addison-Wesley 1995.&lt;br /&gt;
*[4]Schmidt, Douglas C.; Michael Stal, Hans Rohnert, Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. John Wiley &amp;amp; Sons. ISBN 0-471-60695-2.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24442</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24442"/>
		<updated>2009-10-09T21:04:30Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Process&lt;br /&gt;
*Analysis&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*Polling : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
*[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24440</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24440"/>
		<updated>2009-10-09T21:03:58Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Paradigm based Classification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Process&lt;br /&gt;
*Analysis&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*Polling : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] S. Antoy and M. Hanus. “Functional Logic Design Patterns”. In Proc. Of the 6thInternational Symposium on Functional and Logic Programming (FLOPS 2002), Aizu (Japan), Springer LNCS 2441, pp. 67-87, 2002.&lt;br /&gt;
[2] B. P. Douglass. “Doing Hard Time: Developing Real-Time Systems with UML, Objects, Frameworks, and Patterns”, Addison-Wesley, 19.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24439</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24439"/>
		<updated>2009-10-09T21:01:32Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
==== Desirable Properties of Pattern Classification Schemes ====&lt;br /&gt;
&lt;br /&gt;
* The schemes ought to be simple and easy to learn and use&lt;br /&gt;
* The criteria should be few in number &lt;br /&gt;
* The main properties of the patterns should be represented&lt;br /&gt;
* The classification scheme should facilitate easy selection of patterns&lt;br /&gt;
* Using the classification scheme it should be easy to classify new patterns&lt;br /&gt;
* The classification scheme should also capture the relationships between different patterns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent&lt;br /&gt;
*Process&lt;br /&gt;
*Analysis&lt;br /&gt;
*Reengineering&lt;br /&gt;
*Performance&lt;br /&gt;
*Maintenance&lt;br /&gt;
&lt;br /&gt;
== Domain Specific Pattern Classification ==&lt;br /&gt;
Most of the patterns in the software engineering are known, but not restricted to, solving architectural and design problems. Patterns have been identified and proposed to address domain specific problems. Patterns have been applied to domains like Real Time Software System, User Interface, Embedded System and Distributed System etc… It is naturally easier for a Software engineer or Designer to remember the pattern according to domain and apply it on the problem at hand. This also reduces the overhead to looking up patterns that are not remotely related to domain.&lt;br /&gt;
Below are two of the patterns classified for Real-time Systems by B. P. Douglass&lt;br /&gt;
*Latch : Remember that a pre-conditional state has been achieved for later synchronization &lt;br /&gt;
*Polling : Periodically perform an action.&lt;br /&gt;
&lt;br /&gt;
== Paradigm based Classification ==&lt;br /&gt;
Although patterns were initially a hit in object oriented software development, but the notion of patterns can be applied to other paradigms of programming languages. This provides opportunity for the programmers to lookup the patterns available for the paradigm they are using and apply the appropriate pattern suiting the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Following are examples of patterns that have been classified by S. Antoy and M. Hanus for “Functional logic languages”&lt;br /&gt;
&lt;br /&gt;
*Opaque Type : Ensure that values of a datatype are hidden.&lt;br /&gt;
*Locally Defined Global Identifier:Ensure that a local name is globally unique.&lt;br /&gt;
*Incremental Solution : Compute solutions in an incremental manner.&lt;br /&gt;
*Concurrent Distinct Choices : Ensure that a mapping from indexes to values is injective.&lt;br /&gt;
*Constrained Constructor : Prevent invoking a constructor that might create invalid data.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24352</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24352"/>
		<updated>2009-10-09T20:01:31Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Problem Statement&lt;br /&gt;
&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Purpose of Pattern Classification&lt;br /&gt;
* The main goal of pattern classification is to make it easier forsoftware developers to select the right pattern to apply.&lt;br /&gt;
Example: In order to solve a certain designproblem, the right designpattern, if available, should be selected.&lt;br /&gt;
* For selecting a specific pattern, i.e. pattern selection, the nature of the problem should be matched with the right pattern category.&lt;br /&gt;
Hint: Match the description of the problem with the description of the pattern category, then with the description of the individual patterns.&lt;br /&gt;
* Classification schemas can be used to understand and perceive the main propertiesof patterns.&lt;br /&gt;
* It is usually impractical to go through all the details of all the patterns before picking up the right pattern.&lt;br /&gt;
* Classification schemas can be used to structurea pattern system and highlight the relationshipsbetween the constituent patterns.&lt;br /&gt;
&lt;br /&gt;
Properties of Classification Schema&lt;br /&gt;
&lt;br /&gt;
According to [Buschmann96]:&lt;br /&gt;
* Simple and easy to learn: It should be easy to use the classification scheme to classify and select patterns.&lt;br /&gt;
* Few classification criteria: In order to reduce complexity and ambiguity, the classification schema needs to be as compact as possible in terms of the number of criteria.&lt;br /&gt;
* Reflecting pattern properties: Using the classification schema, it should be possible to represent the main properties of the patterns to be classified.&lt;br /&gt;
* Road map to pattern selection: The classification scheme should ease the pattern selection process.&lt;br /&gt;
* Openness to the integrationof new patterns: Using the classification schema, it should be possible to classify new patterns.&lt;br /&gt;
&lt;br /&gt;
Additional Properties:&lt;br /&gt;
* Openness to new classification criteria: It should be possible to extend the classification scheme by either increasing its dimension or by modifying a given dimension.&lt;br /&gt;
* Reflecting the relationship between patterns: In addition to capturing their main properties, the classification schema should be able to highlight the relationships between the patterns.&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;br /&gt;
*Domain&lt;br /&gt;
*Paradigm&lt;br /&gt;
*Domain-Dependent Patterns&lt;br /&gt;
*Process Patterns&lt;br /&gt;
*Analysis Patterns&lt;br /&gt;
*Reengineering Patterns&lt;br /&gt;
*Performance Patterns&lt;br /&gt;
*Maintenance Patterns&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24350</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24350"/>
		<updated>2009-10-09T20:00:53Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Problem Statement&lt;br /&gt;
&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Purpose of Pattern Classification&lt;br /&gt;
* The main goal of pattern classification is to make it easier forsoftware developers to select the right pattern to apply.&lt;br /&gt;
Example: In order to solve a certain designproblem, the right designpattern, if available, should be selected.&lt;br /&gt;
* For selecting a specific pattern, i.e. pattern selection, the nature of the problem should be matched with the right pattern category.&lt;br /&gt;
Hint: Match the description of the problem with the description of the pattern category, then with the description of the individual patterns.&lt;br /&gt;
* Classification schemas can be used to understand and perceive the main propertiesof patterns.&lt;br /&gt;
* It is usually impractical to go through all the details of all the patterns before picking up the right pattern.&lt;br /&gt;
* Classification schemas can be used to structurea pattern system and highlight the relationshipsbetween the constituent patterns.&lt;br /&gt;
&lt;br /&gt;
Properties of Classification Schema&lt;br /&gt;
&lt;br /&gt;
According to [Buschmann96]:&lt;br /&gt;
* Simple and easy to learn: It should be easy to use the classification scheme to classify and select patterns.&lt;br /&gt;
* &amp;amp;#56256;******           Few classification criteria: In order to reduce complexity and ambiguity, the classification schema needs to be as compact as possible in terms of the number of criteria.&lt;br /&gt;
* Reflecting pattern properties: Using the classification schema, it should be possible to represent the main properties of the patterns to be classified.&lt;br /&gt;
* Road map to pattern selection: The classification scheme should ease the pattern selection process.&lt;br /&gt;
* Openness to the integrationof new patterns: Using the classification schema, it should be possible to classify new patterns.&lt;br /&gt;
&lt;br /&gt;
Additional Properties:&lt;br /&gt;
* Openness to new classification criteria: It should be possible to extend the classification scheme by either increasing its dimension or by modifying a given dimension.&lt;br /&gt;
* Reflecting the relationship between patterns: In addition to capturing their main properties, the classification schema should be able to highlight the relationships between the patterns.&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24333</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24333"/>
		<updated>2009-10-09T19:56:03Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Problem Statement&lt;br /&gt;
&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Purpose of Pattern Classification&lt;br /&gt;
* The main goal of pattern classification is to make it easier forsoftware developers to select the right pattern to apply.&lt;br /&gt;
Example: In order to solve a certain designproblem, the right designpattern, if available, should be selected.&lt;br /&gt;
* For selecting a specific pattern, i.e. pattern selection, the nature of the problem should be matched with the right pattern category.&lt;br /&gt;
Hint: Match the description of the problem with the description of the pattern category, then with the description of the individual patterns.&lt;br /&gt;
* Classification schemas can be used to understand and perceive the main propertiesof patterns.&lt;br /&gt;
* It is usually impractical to go through all the details of all the patterns before picking up the right pattern.&lt;br /&gt;
* Classification schemas can be used to structurea pattern system and highlight the relationshipsbetween the constituent patterns.&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24308</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24308"/>
		<updated>2009-10-09T19:49:15Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Problem Statement&lt;br /&gt;
&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Purpose of Pattern Classification&lt;br /&gt;
* The main goal of pattern classification is to make it easier forsoftware developers to select the right pattern to apply.&lt;br /&gt;
Example: In order to solve a certain designproblem, the right designpattern, if available, should be selected.&lt;br /&gt;
* For selecting a specific pattern, i.e. pattern selection, the nature of the problem should be matched with the right pattern category.&lt;br /&gt;
Hint: Match the description of the problem with the description of the pattern category, then with the description of the individual patterns.&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
*Purpose&lt;br /&gt;
*Scope&lt;br /&gt;
*Functionality&lt;br /&gt;
*Structural Principles&lt;br /&gt;
*Granularity&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24261</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 12 01</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_12_01&amp;diff=24261"/>
		<updated>2009-10-09T19:24:28Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Problem Statement&lt;br /&gt;
&lt;br /&gt;
Patterns are often classified into creational, structural, and behavioral categories. However, this leaves a large number of patterns in each group, with no easy way of remembering all of them. What classifications and strategies have been developed to help programmers remember patterns, so that they can apply them at opportune moments?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
A design pattern in software engineering can be described as a reusable solution template to a frequently occurring software design problem.&lt;br /&gt;
&lt;br /&gt;
== Classification of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns can be classified along the following schemes&lt;br /&gt;
&lt;br /&gt;
- Purpose&lt;br /&gt;
- Scope&lt;br /&gt;
- Functionality&lt;br /&gt;
- Structural Principles&lt;br /&gt;
- Granularity&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19622</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19622"/>
		<updated>2009-09-17T04:01:41Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.[[http://www.mockobjects.com 4]],[3]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction captures the essence of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.[[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html 2]], [[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.[[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html 2]], [[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.[[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html 2]], [[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
&lt;br /&gt;
# Who will guard the guard?[[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html 2]]&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?[[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html 2]]&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?[[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html 2]]&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
* [http://code.google.com/p/googlemock/ Homepage of Google C++ Mocking Framework]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 2.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19621</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19621"/>
		<updated>2009-09-17T03:40:08Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /*  See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction captures the essence of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
* [http://code.google.com/p/googlemock/ Homepage of Google C++ Mocking Framework]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19620</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19620"/>
		<updated>2009-09-17T03:38:33Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /*  See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction captures the essence of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
* [[Google C++ Mocking Framework]]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19619</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19619"/>
		<updated>2009-09-17T03:37:09Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction captures the essence of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19617</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19617"/>
		<updated>2009-09-17T03:36:42Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction captures the essence of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19615</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19615"/>
		<updated>2009-09-17T03:36:08Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /*  A comparison of available Mock Object generation frameworks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction captures the essence of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19614</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19614"/>
		<updated>2009-09-17T03:35:56Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* LIMITATIONS (There have to be some ?) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction captures the essence of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19613</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19613"/>
		<updated>2009-09-17T03:35:16Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* INTRODUCTION (What’s the fuss about?) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction captures the essence of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19612</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19612"/>
		<updated>2009-09-17T03:34:41Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* BACKGROUND -(And why do we need it?) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19611</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19611"/>
		<updated>2009-09-17T03:34:22Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /*  See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19610</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19610"/>
		<updated>2009-09-17T03:33:50Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /*  A comparison of available Mock Object generation frameworks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19609</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19609"/>
		<updated>2009-09-17T03:33:28Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* DETAILS (Under the hood.) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19607</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19607"/>
		<updated>2009-09-17T03:32:58Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* INTRODUCTION (What’s the fuss about?) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[[http://en.wikipedia.org/wiki/Mock_object 1]]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19606</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19606"/>
		<updated>2009-09-17T03:27:52Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Under the hood. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[1]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== DETAILS (Under the hood.) ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19605</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19605"/>
		<updated>2009-09-17T03:27:27Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* There have to be some limitations. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[1]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== Under the hood. ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== LIMITATIONS (There have to be some ?) ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19604</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19604"/>
		<updated>2009-09-17T03:25:41Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* What’s the fuss about? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== INTRODUCTION (What’s the fuss about?) ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[1]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== Under the hood. ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== There have to be some limitations. ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19602</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19602"/>
		<updated>2009-09-17T03:23:00Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* BACKGROUND - And why do we need it? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND -(And why do we need it?)===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== What’s the fuss about? ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[1]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== Under the hood. ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== There have to be some limitations. ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19601</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19601"/>
		<updated>2009-09-17T03:21:08Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* And why do we need it? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== BACKGROUND - And why do we need it? ===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== What’s the fuss about? ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[1]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== Under the hood. ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== There have to be some limitations. ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19297</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19297"/>
		<updated>2009-09-16T17:31:04Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /*  See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== And why do we need it? ===&lt;br /&gt;
&amp;amp;nbsp;Mock objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== What’s the fuss about? ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[1]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== Under the hood. ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== There have to be some limitations. ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing: Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_2c_nn&amp;diff=19122</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 2c nn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_2c_nn&amp;diff=19122"/>
		<updated>2009-09-12T21:29:21Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See my contribution at [[http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a2rd]].&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19119</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19119"/>
		<updated>2009-09-12T21:22:13Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* Under the hood. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== And why do we need it? ===&lt;br /&gt;
&amp;amp;nbsp;Mock Objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
=== What’s the fuss about? ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[1]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== Under the hood. ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== There have to be some limitations. ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object/ Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks/ Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing:Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19055</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a2rd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a2rd&amp;diff=19055"/>
		<updated>2009-09-11T19:55:52Z</updated>

		<summary type="html">&lt;p&gt;Rpandit: /* What’s the fuss about? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mock Objects are simulated objects in the object oriented environment to mimic the behavior of real objects in a controlled fashion. This comes in very handy when testing an application which interacts with a complex object. The controlled simulation facilitates the testing process which otherwise would be difficult if the behavior is unpredictable.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== And why do we need it? ===&lt;br /&gt;
&amp;amp;nbsp;Mock Objects mimic the behavior of complex real objects in a controlled (user defined) way and thus are highly useful in unit testing when the real objects are impractical or impossible to be incorporated in the unit tests. If the real object has any of the following characteristic, it may be useful to use mock objects instead:&lt;br /&gt;
&lt;br /&gt;
# Has non deterministic behavior (results, time taken to respond etc..)&lt;br /&gt;
# Has internal states that are difficult to reproduce&lt;br /&gt;
# Is slow as compared to rest of application under test (example Databases)&lt;br /&gt;
# Does not exists (e.g., interfacing module still in development or the object might change behavior)&lt;br /&gt;
# Collaborates with the application under test exclusively for the test-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
=== What’s the fuss about? ===&lt;br /&gt;
Wikipedia provides a good introduction to Mock Objects &lt;br /&gt;
&lt;br /&gt;
&amp;quot;''In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.''&amp;quot;[1]&lt;br /&gt;
&lt;br /&gt;
This introduction summarizes the concept of mock objects in a non-technical but in a complete manner.&lt;br /&gt;
&lt;br /&gt;
=== Under the hood. ===&lt;br /&gt;
The mock object is created to mimic the behavior of a real object. This is achieved by having the interface of the mock objects same as that of the real objects. This causes the application under the test to be ignorant of whether it is interfacing with a real object or a mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Computer Scientists also draw a line of differentiation between mocks and fakes. If an object merely implements the interface and responds with predetermined responses it is considered as fake where as the mock objects which internally takes into the consideration the state of the object that is being mocked is termed as mock. Consider for example if we want to mock a file system. A fake would respond with standard responses, that means it is possible to read a file without opening it (remember the responses are standard), where as a real mock has to ensure that a file is opened first and then read method is invoked. This can be achieved by writing down some assertions in the mock objects.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Similar to assertions Mock objects can have expectations that are set by the unit test to facilitate simulation of a condition in the real objects. Consider testing a online credit card transaction software. The authorization usually is a third party process is mocked. In case the tester intends to test the transaction procedure when the card is not authorized then the mock object can have a field authorization expectation which can be set by the unit test as fail and pass accordingly testing the different scenarios.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== There have to be some limitations. ===&lt;br /&gt;
# Who will guard the guard?&amp;lt;br&amp;gt;Mock Objects are used for unit-testing, but who will ensure that the mock object is correctly mimicking the behavior of a real object. Care needs to be taken while implementing mock objects, if the behavior is improperly implemented then it will cause the test cases to fail even when they should pass or even worse may cause failing test cases to pass.&lt;br /&gt;
# Excess of everything is bad. Isn’t it?&amp;lt;br&amp;gt;The over use of mock objects in a unit test may result in yielding little value to testing. If everything is mocked then there is a high chance that the application under test might not be adequately tested.&lt;br /&gt;
# Poor use of Mock?&amp;lt;br&amp;gt;The close coupling of a mock object with a unit test might result in very high maintenance cost for the mock object itself when the requirement for application under test changes and subsequently test case changes. Ideally mock objects should be concerned with behavioral aspects of real objects and the coupling with test cases should be minimal if not none.&lt;br /&gt;
&lt;br /&gt;
===  A comparison of available Mock Object generation frameworks ===&lt;br /&gt;
&lt;br /&gt;
The table below gives a general comparison of some of the available mock object generating frameworks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Name'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Supporting Language'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Feature'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''License'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://cmock.sourceforge.net/ CMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_%28programming_language%29 C] &lt;br /&gt;
&lt;br /&gt;
| [http://cmock.sourceforge.net/ CMock] is a ruby-based tool and it helps to automate creation of mock functions for unit testing in the C language. This tool requires Ruby's Make-like facility and generate C code automatically [http://cmock.sourceforge.net/ CMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockpp.sf.net/ mockpp]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://mockpp.sf.net/ mockpp] parses the header file of C++ (, which is converted into XML format) and created various user defined C++ code to emulate some functionality of your existing code rely on.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/amop amop]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/amop amop] uses ABI and template techniques and then, simulate a pseudo-&amp;quot;Reflection&amp;quot;. This one does not require the interfaces of the generated mock object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/mockitnow MockItNow]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/mockitnow MockItNow] captures function calls and reorder them to record and replay. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/mit-license.php MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/m0cxx0r/ m0cxx0r]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C%2B%2B C++] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/m0cxx0r/ m0cxx0r] records function calls and compares them to expectation. Then, the tool generates mock objects for C++.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.codeplex.com/attach Attach]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://www.codeplex.com/attach Attach] dynamically generates stub objects with support of the 3A pattern (arrange/act/assert). This tool does not require interfaces.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/ms-pl.html Microsoft Public License ]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/moq/ Moq]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/moq/ Moq] requires setting up common expectations using a fixture setup method and generates .NET mock objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.opensource.org/licenses/bsd-license.php New BSD License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/ NMock and NMock 2]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| This tool is a dynamic [http://www.mockobjects.com/ mock object] library for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://nmock.org/license.html Nmock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;amp;nbsp;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/projects/mocklib NMockLib]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 C#] &lt;br /&gt;
&lt;br /&gt;
| [http://sourceforge.net/projects/mocklib NMockLib] simulates entire APIs of code and interfaces for C#.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=401 Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.easymock.org/ EasyMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.easymock.org/ EasyMock] records expected behavior on given test code and replay them at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.apache.org/licenses/ Apache 2 License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/ JMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://www.jmock.org/ JMock] requires definition of mock objects and generates mock object at runtime.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.jmock.org/license.html jMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/ MockMaker]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java] &lt;br /&gt;
&lt;br /&gt;
| [http://mockmaker.sourceforge.net/ MockMaker] requires user defined interface definitions at compile-time (build time)&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mockmaker.sourceforge.net/license.html MockMaker License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://jsmock.sourceforge.net/ JSMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://jsmock.sourceforge.net/ JSMock] uses expectation recording and matching techniques. The tool generates stub on object method calls. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=16 GNU Library or Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://code.google.com/p/jsmocktool/ JSMockTool]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://code.google.com/p/jsmocktool/ JSMockTool] is a JavaScript Mock Tool is Mock library using [http://rspec.rubyforge.org/ RSpec] style. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mock4js.sourceforge.net/ Mock4JS]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/JavaScript JavaScript] &lt;br /&gt;
&lt;br /&gt;
| [http://mock4js.sourceforge.net/ Mock4JS] is a dynamic-mock library for JavaScript &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/dist/Test-MockObject/lib/Test/MockObject.pm Test::MockObject] helps you to create mock objects that conform to given interfaces for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.ohloh.net/licenses/10 Artistic License] and [http://www.ohloh.net/licenses/3 GNU General Public ][http://www.ohloh.net/licenses/3 License 2.0] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Perl Perl] &lt;br /&gt;
&lt;br /&gt;
| [http://search.cpan.org/perldoc?Test::Mock::Class Test::Mock::Class] creates mock classes based on [http://search.cpan.org/perldoc?Moose Moose] and [http://search.cpan.org/perldoc?Class%3A%3AMOP Class::MOP] for Perl.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://mocha.rubyforge.org/ Mocha]&amp;lt;/center&amp;gt;&lt;br /&gt;
|  [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://mocha.rubyforge.org/ Mocha] is a library to help generates mock and stub objects for Ruby using a similar syntax of [http://www.jmock.org/ JMock]. &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://sourceforge.net/softwaremap/trove_list.php?form_cat=188 MIT License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rspec.rubyforge.org/ RSpec]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://rspec.rubyforge.org/ RSpec] is the original behavior driven development framework and generates mock objects for Ruby &lt;br /&gt;
| &amp;lt;center&amp;gt;[http://rubyforge.org/softwaremap/trove_list.php?form_cat=188 MIT/X Consortium License] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock]&amp;lt;/center&amp;gt;&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby] &lt;br /&gt;
&lt;br /&gt;
| [http://flexmock.rubyforge.org/ FlexMock] uses [http://rspec.rubyforge.org/ RSpec] behavior specification and generates mock objects for Ruby.&lt;br /&gt;
| &amp;lt;center&amp;gt;[http://flexmock.rubyforge.org/ FlexMock License]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  See Also ===&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mock_object/ Wikipedia- Mock Objects]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/List_of_mock_object_frameworks/ Wikipedia- List of Mock Object Generation Frameworks]&lt;br /&gt;
* [http://www.mockobjects.com/ A blog on Mock Objects]&lt;br /&gt;
&lt;br /&gt;
===  References ===&lt;br /&gt;
&lt;br /&gt;
 1.[http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html] Approaches to Mocking | O'Reilly Media.&lt;br /&gt;
 2.[http://en.wikipedia.org/wiki/Mock_object http://en.wikipedia.org/wiki/Mock_object] Wiki Mock Objects.&lt;br /&gt;
 3.T.Mackinnon, S. Freeman, and P.Craig, Endo-testing:Unit Testing with Mock Objects. &lt;br /&gt;
   In proceedings of International Conference on eXtreme programming and flexible processes in Software Engineering(XP), &lt;br /&gt;
   pages 287-301,2000/&lt;br /&gt;
 4.[http://www.mockobjects.com http://www.mockobjects.com] A blog on mock objects.&lt;/div&gt;</summary>
		<author><name>Rpandit</name></author>
	</entry>
</feed>