<?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=Sniper</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=Sniper"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sniper"/>
	<updated>2026-05-09T08:46:27Z</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/wiki3_5_rm&amp;diff=29172</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 5 rm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29172"/>
		<updated>2009-11-19T01:39:11Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependency Inversion policy=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. &lt;br /&gt;
The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions.&lt;br /&gt;
According to this principle the way of designing a class structure is to start from high level modules to the low level modules:&lt;br /&gt;
&lt;br /&gt;
'''High Level Classes → Abstraction Layer → Low Level Classes'''&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Dependency Inversion Principle is defined as follows:&lt;br /&gt;
&lt;br /&gt;
#High-level modules should not depend upon low-level modules. Both should depend upon abstractions.&lt;br /&gt;
#Abstractions should not depend upon details. Details should depend upon abstractions.&lt;br /&gt;
&lt;br /&gt;
The problem with the conventional design architecture is that the higher level components depends on the lower level components. This can be understood from the diagram below.&lt;br /&gt;
[[Image:wiki3_5_rm1.png|450px|thumb|center|Figure 1: Higher-level components depend upon lower-level components]]&lt;br /&gt;
&lt;br /&gt;
From the above diagram we see that the component A depends on component B, which in turn depends on component C. These dependencies make the higher level modules or components more complex and inflexible. This also leads to tight coupling of higher and lower level components. Thus reducing the over all flexibility of the system.&lt;br /&gt;
&lt;br /&gt;
The primary motive of the ''dependency inversion principle'' is to decouple the high level components from their dependency on the low level components of the system. This can be obtained by creating  interfaces as a part of the higher level component package which define the components for the extra functionality required. This protects the component from depending on any specific implementation of the provided interface/functionality. Thus making the given function more portable.&lt;br /&gt;
The above example can be restructured as follows&lt;br /&gt;
&lt;br /&gt;
[[Image:wiki3_5_rm2.png|450px|thumb|center|Figure 2: Relationship diagram]]&lt;br /&gt;
As one can see in the above figure the component B doesn't depend on A but rather depends on the interface that is also used by A. The same relationship is additionally shown between components B and C. Take special note that the interfaces are packaged together with the higher-level components and are defined in terms of the higher-level component’s needs, not the lower-level component’s behavior. It is this association of the interface with the client component which logically inverts the conventional dependency flow.&lt;br /&gt;
&lt;br /&gt;
==Example of Dependency inversion principle==&lt;br /&gt;
 // Dependency Inversion Principle - Bad example&lt;br /&gt;
 class Worker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     Worker m_worker;&lt;br /&gt;
     public void setWorker(Worker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code shown below implements the code above using Dependency Inversion principle.This helps us in solving the following problems.&lt;br /&gt;
#Manager class should not be changed.&lt;br /&gt;
#Minimized risk to affect old funtionallity present in Manager class.&lt;br /&gt;
#No need to redone the unit testing for Manager class.&lt;br /&gt;
&lt;br /&gt;
 // Dependency Inversion Principle - Good example&lt;br /&gt;
 interface IWorker {&lt;br /&gt;
     public void work();&lt;br /&gt;
 }&lt;br /&gt;
 class Worker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     IWorker m_worker;&lt;br /&gt;
     public void setWorker(IWorker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==A design pattern based on dependency inversion policy (Template design pattern)==&lt;br /&gt;
The Template Design pattern implements the Dependency Inversion Principle by setting up the outline or skeleton of an algorithm, leaving the details to be implemented by the classes or modules implementing it. This way, the sub classes will be getting there information from the abstract classes. Further these abstract classes are not dependent on the details while the vice versa is true. The UML diagram below gives you better understanding of the Template design pattern. There are method calls to operation1() and operation2(). The definition of these methods are defined in the subclass which override them.&lt;br /&gt;
[[Image:wiki3_5_rm3.png|450px|thumb|center|Figure 3: Template Design Pattern]]&lt;br /&gt;
&lt;br /&gt;
==Why call it dependency inversion policy?==&lt;br /&gt;
&lt;br /&gt;
The dependency structure of a well designed object oriented application is &amp;quot;inverted&amp;quot; with respect to the dependency structure that normally results from a &amp;quot;traditional&amp;quot; application which is implemented in a more procedural style. In a procedural application high level modules depend upon low level modules and abstractions depend upon details.&lt;br /&gt;
&lt;br /&gt;
Consider the implications of high level modules that depend upon low level modules. It is the high level modules that contain the important policy decisions and business models of an application. It is these models that contain the identity of the application. Yet, when these modules depend upon the lower level modules, then changes to the lower level modules can have direct effects upon them; and can force them to change.&lt;br /&gt;
It is the high level modules that ought to be forcing the low level modules to change. It is the high level modules that should take precedence over the lower level modules. High level modules simply should not depend upon low level modules in any way. Moreover, it is high level modules that we want to be able to reuse. When high level modules depend upon low level modules, it becomes very difficult to reuse those high level modules in different contexts. However, when the high level modules are independent of the low level modules, then the high level modules can be reused quite simply.&lt;br /&gt;
&lt;br /&gt;
==Benefits and Consequences==&lt;br /&gt;
Dependency Inversion Principle proposes a useful mechanism in decoupling the dependencies between the high and low level components of the system. This not only makes sure that the high level components don't directly depend on the low level components, it also makes sure that the  core functionality with n the application can be more easily reused in other contexts.Applying Dependency Inversion Principle makes it easier for reusing the higher level components, but the negative aspect of this is that it prevents the reuse of low level components. Further Dependency Inversion Principle does account for the reuse of lower-level components by maintaining the client interface in a separate package, assigning ownership of this package to one or more consumers of a lower-level component can itself be problematic.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
This principle is applied to make sure that the high level classes are not directly dependent on the low level classes, they are doing that using either by interfaces or abstract classes.In that case the creation of new low level objects inside the high level classes(if necessary) can not be done using the operator new. Instead, some of the Creational design patterns can be used, such as Factory Method, Abstract Factory, Prototype.&lt;br /&gt;
Of course, using this principle implies an increased effort and a more complex code, but more flexible. This principle can not be applied for every class or every module. If we have a class functionality that is more likely to remain unchanged in the future there is not need to apply this principle.When a component does not depend on lower level components directly but only through abstractions this component is mobile that is, the component is reusable in many different contexts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
[1] http://www.objectmentor.com/resources/articles/dip.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://www.ctrl-shift-b.com/2008/12/examining-dependency-inversion.html &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://blogs.imeta.co.uk/jyoung/archive/2008/12/17/540.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://en.wikipedia.org/wiki/Dependency_inversion_principle &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://www.lostechies.com/blogs/gabrielschenker/archive/2009/01/30/the-dependency-inversion-principle.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.oodesign.com/dependency-inversion-principle.html &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.eventhelix.com/realtimemantra/Object_Oriented/dependency_inversion_principle.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://davidhayden.com/blog/dave/archive/2005/06/10/1261.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://doodleproject.sourceforge.net/articles/2001/dependencyInversionPrinciple.html &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.surfscranton.com/architecture/DIPandOCP/img0.html &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://iface.wordpress.com/2006/03/16/dependency-inversion-principle-and-interface/ &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/TemplatePattern.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[14] Martin, R. C. (1996, May). The Dependency Inversion Principle. C++ Report. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29171</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 5 rm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29171"/>
		<updated>2009-11-19T01:38:59Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependency Inversion policy=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. &lt;br /&gt;
The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions.&lt;br /&gt;
According to this principle the way of designing a class structure is to start from high level modules to the low level modules:&lt;br /&gt;
&lt;br /&gt;
'''High Level Classes → Abstraction Layer → Low Level Classes'''&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Dependency Inversion Principle is defined as follows:&lt;br /&gt;
&lt;br /&gt;
#High-level modules should not depend upon low-level modules. Both should depend upon abstractions.&lt;br /&gt;
#Abstractions should not depend upon details. Details should depend upon abstractions.&lt;br /&gt;
&lt;br /&gt;
The problem with the conventional design architecture is that the higher level components depends on the lower level components. This can be understood from the diagram below.&lt;br /&gt;
[[Image:wiki3_5_rm1.png|450px|thumb|center|Figure 1: Higher-level components depend upon lower-level components]]&lt;br /&gt;
&lt;br /&gt;
From the above diagram we see that the component A depends on component B, which in turn depends on component C. These dependencies make the higher level modules or components more complex and inflexible. This also leads to tight coupling of higher and lower level components. Thus reducing the over all flexibility of the system.&lt;br /&gt;
&lt;br /&gt;
The primary motive of the ''dependency inversion principle'' is to decouple the high level components from their dependency on the low level components of the system. This can be obtained by creating  interfaces as a part of the higher level component package which define the components for the extra functionality required. This protects the component from depending on any specific implementation of the provided interface/functionality. Thus making the given function more portable.&lt;br /&gt;
The above example can be restructured as follows&lt;br /&gt;
&lt;br /&gt;
[[Image:wiki3_5_rm2.png|450px|thumb|center|Figure 2: Relationship diagram]]&lt;br /&gt;
As one can see in the above figure the component B doesn't depend on A but rather depends on the interface that is also used by A. The same relationship is additionally shown between components B and C. Take special note that the interfaces are packaged together with the higher-level components and are defined in terms of the higher-level component’s needs, not the lower-level component’s behavior. It is this association of the interface with the client component which logically inverts the conventional dependency flow.&lt;br /&gt;
&lt;br /&gt;
==Example of Dependency inversion principle==&lt;br /&gt;
 // Dependency Inversion Principle - Bad example&lt;br /&gt;
 class Worker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     Worker m_worker;&lt;br /&gt;
     public void setWorker(Worker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code shown below implements the code above using Dependency Inversion principle.This helps us in solving the following problems.&lt;br /&gt;
#Manager class should not be changed.&lt;br /&gt;
#Minimized risk to affect old funtionallity present in Manager class.&lt;br /&gt;
#No need to redone the unit testing for Manager class.&lt;br /&gt;
&lt;br /&gt;
 // Dependency Inversion Principle - Good example&lt;br /&gt;
 interface IWorker {&lt;br /&gt;
     public void work();&lt;br /&gt;
 }&lt;br /&gt;
 class Worker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     IWorker m_worker;&lt;br /&gt;
     public void setWorker(IWorker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==A design pattern based on dependency inversion policy (Template design pattern)==&lt;br /&gt;
The Template Design pattern implements the Dependency Inversion Principle by setting up the outline or skeleton of an algorithm, leaving the details to be implemented by the classes or modules implementing it. This way, the sub classes will be getting there information from the abstract classes. Further these abstract classes are not dependent on the details while the vice versa is true. The UML diagram below gives you better understanding of the Template design pattern. There are method calls to operation1() and operation2(). The definition of these methods are defined in the subclass which override them.&lt;br /&gt;
[[Image:wiki3_5_rm3.png|450px|thumb|center|Figure 3: Template Design Pattern]]&lt;br /&gt;
&lt;br /&gt;
==Why call it dependency inversion policy?==&lt;br /&gt;
&lt;br /&gt;
The dependency structure of a well designed object oriented application is &amp;quot;inverted&amp;quot; with respect to the dependency structure that normally results from a &amp;quot;traditional&amp;quot; application which is implemented in a more procedural style. In a procedural application high level modules depend upon low level modules and abstractions depend upon details.&lt;br /&gt;
&lt;br /&gt;
Consider the implications of high level modules that depend upon low level modules. It is the high level modules that contain the important policy decisions and business models of an application. It is these models that contain the identity of the application. Yet, when these modules depend upon the lower level modules, then changes to the lower level modules can have direct effects upon them; and can force them to change.&lt;br /&gt;
It is the high level modules that ought to be forcing the low level modules to change. It is the high level modules that should take precedence over the lower level modules. High level modules simply should not depend upon low level modules in any way. Moreover, it is high level modules that we want to be able to reuse. When high level modules depend upon low level modules, it becomes very difficult to reuse those high level modules in different contexts. However, when the high level modules are independent of the low level modules, then the high level modules can be reused quite simply.&lt;br /&gt;
&lt;br /&gt;
==Benefits and Consequences==&lt;br /&gt;
Dependency Inversion Principle proposes a useful mechanism in decoupling the dependencies between the high and low level components of the system. This not only makes sure that the high level components don't directly depend on the low level components, it also makes sure that the  core functionality with n the application can be more easily reused in other contexts.Applying Dependency Inversion Principle makes it easier for reusing the higher level components, but the negative aspect of this is that it prevents the reuse of low level components. Further Dependency Inversion Principle does account for the reuse of lower-level components by maintaining the client interface in a separate package, assigning ownership of this package to one or more consumers of a lower-level component can itself be problematic.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
This principle is applied to make sure that the high level classes are not directly dependent on the low level classes, they are doing that using either by interfaces or abstract classes.In that case the creation of new low level objects inside the high level classes(if necessary) can not be done using the operator new. Instead, some of the Creational design patterns can be used, such as Factory Method, Abstract Factory, Prototype.&lt;br /&gt;
Of course, using this principle implies an increased effort and a more complex code, but more flexible. This principle can not be applied for every class or every module. If we have a class functionality that is more likely to remain unchanged in the future there is not need to apply this principle.When a component does not depend on lower level components directly but only through abstractions this component is mobile that is, the component is reusable in many different contexts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
[1] http://www.objectmentor.com/resources/articles/dip.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://www.ctrl-shift-b.com/2008/12/examining-dependency-inversion.html &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://blogs.imeta.co.uk/jyoung/archive/2008/12/17/540.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://en.wikipedia.org/wiki/Dependency_inversion_principle &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://www.lostechies.com/blogs/gabrielschenker/archive/2009/01/30/the-dependency-inversion-principle.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.oodesign.com/dependency-inversion-principle.html &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.eventhelix.com/realtimemantra/Object_Oriented/dependency_inversion_principle.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://davidhayden.com/blog/dave/archive/2005/06/10/1261.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://doodleproject.sourceforge.net/articles/2001/dependencyInversionPrinciple.html &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.surfscranton.com/architecture/DIPandOCP/img0.html &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://iface.wordpress.com/2006/03/16/dependency-inversion-principle-and-interface/ &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/TemplatePattern.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[14] Martin, R. C. (1996, May). The Dependency Inversion Principle. C++ Report. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are so many references&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29168</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 5 rm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29168"/>
		<updated>2009-11-19T01:38:22Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependency Inversion policy=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. &lt;br /&gt;
The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions.&lt;br /&gt;
According to this principle the way of designing a class structure is to start from high level modules to the low level modules:&lt;br /&gt;
&lt;br /&gt;
'''High Level Classes → Abstraction Layer → Low Level Classes'''&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Dependency Inversion Principle is defined as follows:&lt;br /&gt;
&lt;br /&gt;
#High-level modules should not depend upon low-level modules. Both should depend upon abstractions.&lt;br /&gt;
#Abstractions should not depend upon details. Details should depend upon abstractions.&lt;br /&gt;
&lt;br /&gt;
The problem with the conventional design architecture is that the higher level components depends on the lower level components. This can be understood from the diagram below.&lt;br /&gt;
[[Image:wiki3_5_rm1.png|450px|thumb|center|Figure 1: Higher-level components depend upon lower-level components]]&lt;br /&gt;
&lt;br /&gt;
From the above diagram we see that the component A depends on component B, which in turn depends on component C. These dependencies make the higher level modules or components more complex and inflexible. This also leads to tight coupling of higher and lower level components. Thus reducing the over all flexibility of the system.&lt;br /&gt;
&lt;br /&gt;
The primary motive of the ''dependency inversion principle'' is to decouple the high level components from their dependency on the low level components of the system. This can be obtained by creating  interfaces as a part of the higher level component package which define the components for the extra functionality required. This protects the component from depending on any specific implementation of the provided interface/functionality. Thus making the given function more portable.&lt;br /&gt;
The above example can be restructured as follows&lt;br /&gt;
&lt;br /&gt;
[[Image:wiki3_5_rm2.png|450px|thumb|center|Figure 2: Relationship diagram]]&lt;br /&gt;
As one can see in the above figure the component B doesn't depend on A but rather depends on the interface that is also used by A. The same relationship is additionally shown between components B and C. Take special note that the interfaces are packaged together with the higher-level components and are defined in terms of the higher-level component’s needs, not the lower-level component’s behavior. It is this association of the interface with the client component which logically inverts the conventional dependency flow.&lt;br /&gt;
&lt;br /&gt;
==Example of Dependency inversion principle==&lt;br /&gt;
 // Dependency Inversion Principle - Bad example&lt;br /&gt;
 class Worker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     Worker m_worker;&lt;br /&gt;
     public void setWorker(Worker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code shown below implements the code above using Dependency Inversion principle.This helps us in solving the following problems.&lt;br /&gt;
#Manager class should not be changed.&lt;br /&gt;
#Minimized risk to affect old funtionallity present in Manager class.&lt;br /&gt;
#No need to redone the unit testing for Manager class.&lt;br /&gt;
&lt;br /&gt;
 // Dependency Inversion Principle - Good example&lt;br /&gt;
 interface IWorker {&lt;br /&gt;
     public void work();&lt;br /&gt;
 }&lt;br /&gt;
 class Worker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     IWorker m_worker;&lt;br /&gt;
     public void setWorker(IWorker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==A design pattern based on dependency inversion policy (Template design pattern)==&lt;br /&gt;
The Template Design pattern implements the Dependency Inversion Principle by setting up the outline or skeleton of an algorithm, leaving the details to be implemented by the classes or modules implementing it. This way, the sub classes will be getting there information from the abstract classes. Further these abstract classes are not dependent on the details while the vice versa is true. The UML diagram below gives you better understanding of the Template design pattern. There are method calls to operation1() and operation2(). The definition of these methods are defined in the subclass which override them.&lt;br /&gt;
[[Image:wiki3_5_rm3.png|450px|thumb|center|Figure 3: Template Design Pattern]]&lt;br /&gt;
&lt;br /&gt;
==Why call it dependency inversion policy?==&lt;br /&gt;
&lt;br /&gt;
The dependency structure of a well designed object oriented application is &amp;quot;inverted&amp;quot; with respect to the dependency structure that normally results from a &amp;quot;traditional&amp;quot; application which is implemented in a more procedural style. In a procedural application high level modules depend upon low level modules and abstractions depend upon details.&lt;br /&gt;
&lt;br /&gt;
Consider the implications of high level modules that depend upon low level modules. It is the high level modules that contain the important policy decisions and business models of an application. It is these models that contain the identity of the application. Yet, when these modules depend upon the lower level modules, then changes to the lower level modules can have direct effects upon them; and can force them to change.&lt;br /&gt;
It is the high level modules that ought to be forcing the low level modules to change. It is the high level modules that should take precedence over the lower level modules. High level modules simply should not depend upon low level modules in any way. Moreover, it is high level modules that we want to be able to reuse. When high level modules depend upon low level modules, it becomes very difficult to reuse those high level modules in different contexts. However, when the high level modules are independent of the low level modules, then the high level modules can be reused quite simply.&lt;br /&gt;
&lt;br /&gt;
==Benefits and Consequences==&lt;br /&gt;
Dependency Inversion Principle proposes a useful mechanism in decoupling the dependencies between the high and low level components of the system. This not only makes sure that the high level components don't directly depend on the low level components, it also makes sure that the  core functionality with n the application can be more easily reused in other contexts.Applying Dependency Inversion Principle makes it easier for reusing the higher level components, but the negative aspect of this is that it prevents the reuse of low level components. Further Dependency Inversion Principle does account for the reuse of lower-level components by maintaining the client interface in a separate package, assigning ownership of this package to one or more consumers of a lower-level component can itself be problematic.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
This principle is applied to make sure that the high level classes are not directly dependent on the low level classes, they are doing that using either by interfaces or abstract classes.In that case the creation of new low level objects inside the high level classes(if necessary) can not be done using the operator new. Instead, some of the Creational design patterns can be used, such as Factory Method, Abstract Factory, Prototype.&lt;br /&gt;
Of course, using this principle implies an increased effort and a more complex code, but more flexible. This principle can not be applied for every class or every module. If we have a class functionality that is more likely to remain unchanged in the future there is not need to apply this principle.When a component does not depend on lower level components directly but only through abstractions this component is mobile that is, the component is reusable in many different contexts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
[1] http://www.objectmentor.com/resources/articles/dip.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://www.ctrl-shift-b.com/2008/12/examining-dependency-inversion.html &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://blogs.imeta.co.uk/jyoung/archive/2008/12/17/540.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://en.wikipedia.org/wiki/Dependency_inversion_principle &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://www.lostechies.com/blogs/gabrielschenker/archive/2009/01/30/the-dependency-inversion-principle.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.oodesign.com/dependency-inversion-principle.html &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.eventhelix.com/realtimemantra/Object_Oriented/dependency_inversion_principle.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://davidhayden.com/blog/dave/archive/2005/06/10/1261.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://doodleproject.sourceforge.net/articles/2001/dependencyInversionPrinciple.html &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.surfscranton.com/architecture/DIPandOCP/img0.html &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://iface.wordpress.com/2006/03/16/dependency-inversion-principle-and-interface/ &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/TemplatePattern.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[14] Martin, R. C. (1996, May). The Dependency Inversion Principle. C++ Report. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29166</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 5 rm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29166"/>
		<updated>2009-11-19T01:38:09Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependency Inversion policy=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. &lt;br /&gt;
The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions.&lt;br /&gt;
According to this principle the way of designing a class structure is to start from high level modules to the low level modules:&lt;br /&gt;
&lt;br /&gt;
'''High Level Classes → Abstraction Layer → Low Level Classes'''&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Dependency Inversion Principle is defined as follows:&lt;br /&gt;
&lt;br /&gt;
#High-level modules should not depend upon low-level modules. Both should depend upon abstractions.&lt;br /&gt;
#Abstractions should not depend upon details. Details should depend upon abstractions.&lt;br /&gt;
&lt;br /&gt;
The problem with the conventional design architecture is that the higher level components depends on the lower level components. This can be understood from the diagram below.&lt;br /&gt;
[[Image:wiki3_5_rm1.png|450px|thumb|center|Figure 1: Higher-level components depend upon lower-level components]]&lt;br /&gt;
&lt;br /&gt;
From the above diagram we see that the component A depends on component B, which in turn depends on component C. These dependencies make the higher level modules or components more complex and inflexible. This also leads to tight coupling of higher and lower level components. Thus reducing the over all flexibility of the system.&lt;br /&gt;
&lt;br /&gt;
The primary motive of the ''dependency inversion principle'' is to decouple the high level components from their dependency on the low level components of the system. This can be obtained by creating  interfaces as a part of the higher level component package which define the components for the extra functionality required. This protects the component from depending on any specific implementation of the provided interface/functionality. Thus making the given function more portable.&lt;br /&gt;
The above example can be restructured as follows&lt;br /&gt;
&lt;br /&gt;
[[Image:wiki3_5_rm2.png|450px|thumb|center|Figure 2: Relationship diagram]]&lt;br /&gt;
As one can see in the above figure the component B doesn't depend on A but rather depends on the interface that is also used by A. The same relationship is additionally shown between components B and C. Take special note that the interfaces are packaged together with the higher-level components and are defined in terms of the higher-level component’s needs, not the lower-level component’s behavior. It is this association of the interface with the client component which logically inverts the conventional dependency flow.&lt;br /&gt;
&lt;br /&gt;
==Example of Dependency inversion principle==&lt;br /&gt;
 // Dependency Inversion Principle - Bad example&lt;br /&gt;
 class Worker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     Worker m_worker;&lt;br /&gt;
     public void setWorker(Worker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code shown below implements the code above using Dependency Inversion principle.This helps us in solving the following problems.&lt;br /&gt;
#Manager class should not be changed.&lt;br /&gt;
#Minimized risk to affect old funtionallity present in Manager class.&lt;br /&gt;
#No need to redone the unit testing for Manager class.&lt;br /&gt;
&lt;br /&gt;
 // Dependency Inversion Principle - Good example&lt;br /&gt;
 interface IWorker {&lt;br /&gt;
     public void work();&lt;br /&gt;
 }&lt;br /&gt;
 class Worker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     IWorker m_worker;&lt;br /&gt;
     public void setWorker(IWorker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==A design pattern based on dependency inversion policy (Template design pattern)==&lt;br /&gt;
The Template Design pattern implements the Dependency Inversion Principle by setting up the outline or skeleton of an algorithm, leaving the details to be implemented by the classes or modules implementing it. This way, the sub classes will be getting there information from the abstract classes. Further these abstract classes are not dependent on the details while the vice versa is true. The UML diagram below gives you better understanding of the Template design pattern. There are method calls to operation1() and operation2(). The definition of these methods are defined in the subclass which override them.&lt;br /&gt;
[[Image:wiki3_5_rm3.png|450px|thumb|center|Figure 3: Template Design Pattern]]&lt;br /&gt;
&lt;br /&gt;
==Why call it dependency inversion policy?==&lt;br /&gt;
&lt;br /&gt;
The dependency structure of a well designed object oriented application is &amp;quot;inverted&amp;quot; with respect to the dependency structure that normally results from a &amp;quot;traditional&amp;quot; application which is implemented in a more procedural style. In a procedural application high level modules depend upon low level modules and abstractions depend upon details.&lt;br /&gt;
&lt;br /&gt;
Consider the implications of high level modules that depend upon low level modules. It is the high level modules that contain the important policy decisions and business models of an application. It is these models that contain the identity of the application. Yet, when these modules depend upon the lower level modules, then changes to the lower level modules can have direct effects upon them; and can force them to change.&lt;br /&gt;
It is the high level modules that ought to be forcing the low level modules to change. It is the high level modules that should take precedence over the lower level modules. High level modules simply should not depend upon low level modules in any way. Moreover, it is high level modules that we want to be able to reuse. When high level modules depend upon low level modules, it becomes very difficult to reuse those high level modules in different contexts. However, when the high level modules are independent of the low level modules, then the high level modules can be reused quite simply.&lt;br /&gt;
&lt;br /&gt;
==Benefits and Consequences==&lt;br /&gt;
Dependency Inversion Principle proposes a useful mechanism in decoupling the dependencies between the high and low level components of the system. This not only makes sure that the high level components don't directly depend on the low level components, it also makes sure that the  core functionality with n the application can be more easily reused in other contexts.Applying Dependency Inversion Principle makes it easier for reusing the higher level components, but the negative aspect of this is that it prevents the reuse of low level components. Further Dependency Inversion Principle does account for the reuse of lower-level components by maintaining the client interface in a separate package, assigning ownership of this package to one or more consumers of a lower-level component can itself be problematic.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
This principle is applied to make sure that the high level classes are not directly dependent on the low level classes, they are doing that using either by interfaces or abstract classes.In that case the creation of new low level objects inside the high level classes(if necessary) can not be done using the operator new. Instead, some of the Creational design patterns can be used, such as Factory Method, Abstract Factory, Prototype.&lt;br /&gt;
Of course, using this principle implies an increased effort and a more complex code, but more flexible. This principle can not be applied for every class or every module. If we have a class functionality that is more likely to remain unchanged in the future there is not need to apply this principle.When a component does not depend on lower level components directly but only through abstractions this component is mobile that is, the component is reusable in many different contexts.&lt;br /&gt;
&lt;br /&gt;
This is the conclusion&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
[1] http://www.objectmentor.com/resources/articles/dip.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://www.ctrl-shift-b.com/2008/12/examining-dependency-inversion.html &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://blogs.imeta.co.uk/jyoung/archive/2008/12/17/540.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://en.wikipedia.org/wiki/Dependency_inversion_principle &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://www.lostechies.com/blogs/gabrielschenker/archive/2009/01/30/the-dependency-inversion-principle.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.oodesign.com/dependency-inversion-principle.html &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.eventhelix.com/realtimemantra/Object_Oriented/dependency_inversion_principle.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://davidhayden.com/blog/dave/archive/2005/06/10/1261.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://doodleproject.sourceforge.net/articles/2001/dependencyInversionPrinciple.html &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.surfscranton.com/architecture/DIPandOCP/img0.html &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://iface.wordpress.com/2006/03/16/dependency-inversion-principle-and-interface/ &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/TemplatePattern.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[14] Martin, R. C. (1996, May). The Dependency Inversion Principle. C++ Report. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29165</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 5 rm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29165"/>
		<updated>2009-11-19T01:37:53Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Why call it dependency inversion policy? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependency Inversion policy=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. &lt;br /&gt;
The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions.&lt;br /&gt;
According to this principle the way of designing a class structure is to start from high level modules to the low level modules:&lt;br /&gt;
&lt;br /&gt;
'''High Level Classes → Abstraction Layer → Low Level Classes'''&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Dependency Inversion Principle is defined as follows:&lt;br /&gt;
&lt;br /&gt;
#High-level modules should not depend upon low-level modules. Both should depend upon abstractions.&lt;br /&gt;
#Abstractions should not depend upon details. Details should depend upon abstractions.&lt;br /&gt;
&lt;br /&gt;
The problem with the conventional design architecture is that the higher level components depends on the lower level components. This can be understood from the diagram below.&lt;br /&gt;
[[Image:wiki3_5_rm1.png|450px|thumb|center|Figure 1: Higher-level components depend upon lower-level components]]&lt;br /&gt;
&lt;br /&gt;
From the above diagram we see that the component A depends on component B, which in turn depends on component C. These dependencies make the higher level modules or components more complex and inflexible. This also leads to tight coupling of higher and lower level components. Thus reducing the over all flexibility of the system.&lt;br /&gt;
&lt;br /&gt;
The primary motive of the ''dependency inversion principle'' is to decouple the high level components from their dependency on the low level components of the system. This can be obtained by creating  interfaces as a part of the higher level component package which define the components for the extra functionality required. This protects the component from depending on any specific implementation of the provided interface/functionality. Thus making the given function more portable.&lt;br /&gt;
The above example can be restructured as follows&lt;br /&gt;
&lt;br /&gt;
[[Image:wiki3_5_rm2.png|450px|thumb|center|Figure 2: Relationship diagram]]&lt;br /&gt;
As one can see in the above figure the component B doesn't depend on A but rather depends on the interface that is also used by A. The same relationship is additionally shown between components B and C. Take special note that the interfaces are packaged together with the higher-level components and are defined in terms of the higher-level component’s needs, not the lower-level component’s behavior. It is this association of the interface with the client component which logically inverts the conventional dependency flow.&lt;br /&gt;
&lt;br /&gt;
==Example of Dependency inversion principle==&lt;br /&gt;
 // Dependency Inversion Principle - Bad example&lt;br /&gt;
 class Worker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     Worker m_worker;&lt;br /&gt;
     public void setWorker(Worker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code shown below implements the code above using Dependency Inversion principle.This helps us in solving the following problems.&lt;br /&gt;
#Manager class should not be changed.&lt;br /&gt;
#Minimized risk to affect old funtionallity present in Manager class.&lt;br /&gt;
#No need to redone the unit testing for Manager class.&lt;br /&gt;
&lt;br /&gt;
 // Dependency Inversion Principle - Good example&lt;br /&gt;
 interface IWorker {&lt;br /&gt;
     public void work();&lt;br /&gt;
 }&lt;br /&gt;
 class Worker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     IWorker m_worker;&lt;br /&gt;
     public void setWorker(IWorker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==A design pattern based on dependency inversion policy (Template design pattern)==&lt;br /&gt;
The Template Design pattern implements the Dependency Inversion Principle by setting up the outline or skeleton of an algorithm, leaving the details to be implemented by the classes or modules implementing it. This way, the sub classes will be getting there information from the abstract classes. Further these abstract classes are not dependent on the details while the vice versa is true. The UML diagram below gives you better understanding of the Template design pattern. There are method calls to operation1() and operation2(). The definition of these methods are defined in the subclass which override them.&lt;br /&gt;
[[Image:wiki3_5_rm3.png|450px|thumb|center|Figure 3: Template Design Pattern]]&lt;br /&gt;
&lt;br /&gt;
==Why call it dependency inversion policy?==&lt;br /&gt;
&lt;br /&gt;
The dependency structure of a well designed object oriented application is &amp;quot;inverted&amp;quot; with respect to the dependency structure that normally results from a &amp;quot;traditional&amp;quot; application which is implemented in a more procedural style. In a procedural application high level modules depend upon low level modules and abstractions depend upon details.&lt;br /&gt;
&lt;br /&gt;
Consider the implications of high level modules that depend upon low level modules. It is the high level modules that contain the important policy decisions and business models of an application. It is these models that contain the identity of the application. Yet, when these modules depend upon the lower level modules, then changes to the lower level modules can have direct effects upon them; and can force them to change.&lt;br /&gt;
It is the high level modules that ought to be forcing the low level modules to change. It is the high level modules that should take precedence over the lower level modules. High level modules simply should not depend upon low level modules in any way. Moreover, it is high level modules that we want to be able to reuse. When high level modules depend upon low level modules, it becomes very difficult to reuse those high level modules in different contexts. However, when the high level modules are independent of the low level modules, then the high level modules can be reused quite simply.&lt;br /&gt;
&lt;br /&gt;
==Benefits and Consequences==&lt;br /&gt;
Dependency Inversion Principle proposes a useful mechanism in decoupling the dependencies between the high and low level components of the system. This not only makes sure that the high level components don't directly depend on the low level components, it also makes sure that the  core functionality with n the application can be more easily reused in other contexts.Applying Dependency Inversion Principle makes it easier for reusing the higher level components, but the negative aspect of this is that it prevents the reuse of low level components. Further Dependency Inversion Principle does account for the reuse of lower-level components by maintaining the client interface in a separate package, assigning ownership of this package to one or more consumers of a lower-level component can itself be problematic.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
This principle is applied to make sure that the high level classes are not directly dependent on the low level classes, they are doing that using either by interfaces or abstract classes.In that case the creation of new low level objects inside the high level classes(if necessary) can not be done using the operator new. Instead, some of the Creational design patterns can be used, such as Factory Method, Abstract Factory, Prototype.&lt;br /&gt;
Of course, using this principle implies an increased effort and a more complex code, but more flexible. This principle can not be applied for every class or every module. If we have a class functionality that is more likely to remain unchanged in the future there is not need to apply this principle.When a component does not depend on lower level components directly but only through abstractions this component is mobile that is, the component is reusable in many different contexts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
[1] http://www.objectmentor.com/resources/articles/dip.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://www.ctrl-shift-b.com/2008/12/examining-dependency-inversion.html &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://blogs.imeta.co.uk/jyoung/archive/2008/12/17/540.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://en.wikipedia.org/wiki/Dependency_inversion_principle &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://www.lostechies.com/blogs/gabrielschenker/archive/2009/01/30/the-dependency-inversion-principle.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.oodesign.com/dependency-inversion-principle.html &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.eventhelix.com/realtimemantra/Object_Oriented/dependency_inversion_principle.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://davidhayden.com/blog/dave/archive/2005/06/10/1261.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://doodleproject.sourceforge.net/articles/2001/dependencyInversionPrinciple.html &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.surfscranton.com/architecture/DIPandOCP/img0.html &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://iface.wordpress.com/2006/03/16/dependency-inversion-principle-and-interface/ &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/TemplatePattern.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[14] Martin, R. C. (1996, May). The Dependency Inversion Principle. C++ Report. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29164</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 5 rm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29164"/>
		<updated>2009-11-19T01:37:39Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Why call it dependency inversion policy? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependency Inversion policy=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. &lt;br /&gt;
The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions.&lt;br /&gt;
According to this principle the way of designing a class structure is to start from high level modules to the low level modules:&lt;br /&gt;
&lt;br /&gt;
'''High Level Classes → Abstraction Layer → Low Level Classes'''&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Dependency Inversion Principle is defined as follows:&lt;br /&gt;
&lt;br /&gt;
#High-level modules should not depend upon low-level modules. Both should depend upon abstractions.&lt;br /&gt;
#Abstractions should not depend upon details. Details should depend upon abstractions.&lt;br /&gt;
&lt;br /&gt;
The problem with the conventional design architecture is that the higher level components depends on the lower level components. This can be understood from the diagram below.&lt;br /&gt;
[[Image:wiki3_5_rm1.png|450px|thumb|center|Figure 1: Higher-level components depend upon lower-level components]]&lt;br /&gt;
&lt;br /&gt;
From the above diagram we see that the component A depends on component B, which in turn depends on component C. These dependencies make the higher level modules or components more complex and inflexible. This also leads to tight coupling of higher and lower level components. Thus reducing the over all flexibility of the system.&lt;br /&gt;
&lt;br /&gt;
The primary motive of the ''dependency inversion principle'' is to decouple the high level components from their dependency on the low level components of the system. This can be obtained by creating  interfaces as a part of the higher level component package which define the components for the extra functionality required. This protects the component from depending on any specific implementation of the provided interface/functionality. Thus making the given function more portable.&lt;br /&gt;
The above example can be restructured as follows&lt;br /&gt;
&lt;br /&gt;
[[Image:wiki3_5_rm2.png|450px|thumb|center|Figure 2: Relationship diagram]]&lt;br /&gt;
As one can see in the above figure the component B doesn't depend on A but rather depends on the interface that is also used by A. The same relationship is additionally shown between components B and C. Take special note that the interfaces are packaged together with the higher-level components and are defined in terms of the higher-level component’s needs, not the lower-level component’s behavior. It is this association of the interface with the client component which logically inverts the conventional dependency flow.&lt;br /&gt;
&lt;br /&gt;
==Example of Dependency inversion principle==&lt;br /&gt;
 // Dependency Inversion Principle - Bad example&lt;br /&gt;
 class Worker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     Worker m_worker;&lt;br /&gt;
     public void setWorker(Worker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code shown below implements the code above using Dependency Inversion principle.This helps us in solving the following problems.&lt;br /&gt;
#Manager class should not be changed.&lt;br /&gt;
#Minimized risk to affect old funtionallity present in Manager class.&lt;br /&gt;
#No need to redone the unit testing for Manager class.&lt;br /&gt;
&lt;br /&gt;
 // Dependency Inversion Principle - Good example&lt;br /&gt;
 interface IWorker {&lt;br /&gt;
     public void work();&lt;br /&gt;
 }&lt;br /&gt;
 class Worker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     IWorker m_worker;&lt;br /&gt;
     public void setWorker(IWorker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==A design pattern based on dependency inversion policy (Template design pattern)==&lt;br /&gt;
The Template Design pattern implements the Dependency Inversion Principle by setting up the outline or skeleton of an algorithm, leaving the details to be implemented by the classes or modules implementing it. This way, the sub classes will be getting there information from the abstract classes. Further these abstract classes are not dependent on the details while the vice versa is true. The UML diagram below gives you better understanding of the Template design pattern. There are method calls to operation1() and operation2(). The definition of these methods are defined in the subclass which override them.&lt;br /&gt;
[[Image:wiki3_5_rm3.png|450px|thumb|center|Figure 3: Template Design Pattern]]&lt;br /&gt;
&lt;br /&gt;
==Why call it dependency inversion policy?==&lt;br /&gt;
&lt;br /&gt;
The dependency structure of a well designed object oriented application is &amp;quot;inverted&amp;quot; with respect to the dependency structure that normally results from a &amp;quot;traditional&amp;quot; application which is implemented in a more procedural style. In a procedural application high level modules depend upon low level modules and abstractions depend upon details.&lt;br /&gt;
&lt;br /&gt;
Consider the implications of high level modules that depend upon low level modules. It is the high level modules that contain the important policy decisions and business models of an application. It is these models that contain the identity of the application. Yet, when these modules depend upon the lower level modules, then changes to the lower level modules can have direct effects upon them; and can force them to change.&lt;br /&gt;
It is the high level modules that ought to be forcing the low level modules to change. It is the high level modules that should take precedence over the lower level modules. High level modules simply should not depend upon low level modules in any way. Moreover, it is high level modules that we want to be able to reuse. When high level modules depend upon low level modules, it becomes very difficult to reuse those high level modules in different contexts. However, when the high level modules are independent of the low level modules, then the high level modules can be reused quite simply.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OMG OMG&lt;br /&gt;
&lt;br /&gt;
==Benefits and Consequences==&lt;br /&gt;
Dependency Inversion Principle proposes a useful mechanism in decoupling the dependencies between the high and low level components of the system. This not only makes sure that the high level components don't directly depend on the low level components, it also makes sure that the  core functionality with n the application can be more easily reused in other contexts.Applying Dependency Inversion Principle makes it easier for reusing the higher level components, but the negative aspect of this is that it prevents the reuse of low level components. Further Dependency Inversion Principle does account for the reuse of lower-level components by maintaining the client interface in a separate package, assigning ownership of this package to one or more consumers of a lower-level component can itself be problematic.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
This principle is applied to make sure that the high level classes are not directly dependent on the low level classes, they are doing that using either by interfaces or abstract classes.In that case the creation of new low level objects inside the high level classes(if necessary) can not be done using the operator new. Instead, some of the Creational design patterns can be used, such as Factory Method, Abstract Factory, Prototype.&lt;br /&gt;
Of course, using this principle implies an increased effort and a more complex code, but more flexible. This principle can not be applied for every class or every module. If we have a class functionality that is more likely to remain unchanged in the future there is not need to apply this principle.When a component does not depend on lower level components directly but only through abstractions this component is mobile that is, the component is reusable in many different contexts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
[1] http://www.objectmentor.com/resources/articles/dip.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://www.ctrl-shift-b.com/2008/12/examining-dependency-inversion.html &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://blogs.imeta.co.uk/jyoung/archive/2008/12/17/540.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://en.wikipedia.org/wiki/Dependency_inversion_principle &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://www.lostechies.com/blogs/gabrielschenker/archive/2009/01/30/the-dependency-inversion-principle.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.oodesign.com/dependency-inversion-principle.html &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.eventhelix.com/realtimemantra/Object_Oriented/dependency_inversion_principle.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://davidhayden.com/blog/dave/archive/2005/06/10/1261.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://doodleproject.sourceforge.net/articles/2001/dependencyInversionPrinciple.html &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.surfscranton.com/architecture/DIPandOCP/img0.html &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://iface.wordpress.com/2006/03/16/dependency-inversion-principle-and-interface/ &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/TemplatePattern.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[14] Martin, R. C. (1996, May). The Dependency Inversion Principle. C++ Report. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29162</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 5 rm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29162"/>
		<updated>2009-11-19T01:37:18Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependency Inversion policy=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. &lt;br /&gt;
The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions.&lt;br /&gt;
According to this principle the way of designing a class structure is to start from high level modules to the low level modules:&lt;br /&gt;
&lt;br /&gt;
'''High Level Classes → Abstraction Layer → Low Level Classes'''&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Dependency Inversion Principle is defined as follows:&lt;br /&gt;
&lt;br /&gt;
#High-level modules should not depend upon low-level modules. Both should depend upon abstractions.&lt;br /&gt;
#Abstractions should not depend upon details. Details should depend upon abstractions.&lt;br /&gt;
&lt;br /&gt;
The problem with the conventional design architecture is that the higher level components depends on the lower level components. This can be understood from the diagram below.&lt;br /&gt;
[[Image:wiki3_5_rm1.png|450px|thumb|center|Figure 1: Higher-level components depend upon lower-level components]]&lt;br /&gt;
&lt;br /&gt;
From the above diagram we see that the component A depends on component B, which in turn depends on component C. These dependencies make the higher level modules or components more complex and inflexible. This also leads to tight coupling of higher and lower level components. Thus reducing the over all flexibility of the system.&lt;br /&gt;
&lt;br /&gt;
The primary motive of the ''dependency inversion principle'' is to decouple the high level components from their dependency on the low level components of the system. This can be obtained by creating  interfaces as a part of the higher level component package which define the components for the extra functionality required. This protects the component from depending on any specific implementation of the provided interface/functionality. Thus making the given function more portable.&lt;br /&gt;
The above example can be restructured as follows&lt;br /&gt;
&lt;br /&gt;
[[Image:wiki3_5_rm2.png|450px|thumb|center|Figure 2: Relationship diagram]]&lt;br /&gt;
As one can see in the above figure the component B doesn't depend on A but rather depends on the interface that is also used by A. The same relationship is additionally shown between components B and C. Take special note that the interfaces are packaged together with the higher-level components and are defined in terms of the higher-level component’s needs, not the lower-level component’s behavior. It is this association of the interface with the client component which logically inverts the conventional dependency flow.&lt;br /&gt;
&lt;br /&gt;
==Example of Dependency inversion principle==&lt;br /&gt;
 // Dependency Inversion Principle - Bad example&lt;br /&gt;
 class Worker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     Worker m_worker;&lt;br /&gt;
     public void setWorker(Worker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code shown below implements the code above using Dependency Inversion principle.This helps us in solving the following problems.&lt;br /&gt;
#Manager class should not be changed.&lt;br /&gt;
#Minimized risk to affect old funtionallity present in Manager class.&lt;br /&gt;
#No need to redone the unit testing for Manager class.&lt;br /&gt;
&lt;br /&gt;
 // Dependency Inversion Principle - Good example&lt;br /&gt;
 interface IWorker {&lt;br /&gt;
     public void work();&lt;br /&gt;
 }&lt;br /&gt;
 class Worker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     IWorker m_worker;&lt;br /&gt;
     public void setWorker(IWorker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==A design pattern based on dependency inversion policy (Template design pattern)==&lt;br /&gt;
The Template Design pattern implements the Dependency Inversion Principle by setting up the outline or skeleton of an algorithm, leaving the details to be implemented by the classes or modules implementing it. This way, the sub classes will be getting there information from the abstract classes. Further these abstract classes are not dependent on the details while the vice versa is true. The UML diagram below gives you better understanding of the Template design pattern. There are method calls to operation1() and operation2(). The definition of these methods are defined in the subclass which override them.&lt;br /&gt;
[[Image:wiki3_5_rm3.png|450px|thumb|center|Figure 3: Template Design Pattern]]&lt;br /&gt;
&lt;br /&gt;
==Why call it dependency inversion policy?==&lt;br /&gt;
&lt;br /&gt;
The dependency structure of a well designed object oriented application is &amp;quot;inverted&amp;quot; with respect to the dependency structure that normally results from a &amp;quot;traditional&amp;quot; application which is implemented in a more procedural style. In a procedural application high level modules depend upon low level modules and abstractions depend upon details.&lt;br /&gt;
&lt;br /&gt;
Consider the implications of high level modules that depend upon low level modules. It is the high level modules that contain the important policy decisions and business models of an application. It is these models that contain the identity of the application. Yet, when these modules depend upon the lower level modules, then changes to the lower level modules can have direct effects upon them; and can force them to change.&lt;br /&gt;
It is the high level modules that ought to be forcing the low level modules to change. It is the high level modules that should take precedence over the lower level modules. High level modules simply should not depend upon low level modules in any way. Moreover, it is high level modules that we want to be able to reuse. When high level modules depend upon low level modules, it becomes very difficult to reuse those high level modules in different contexts. However, when the high level modules are independent of the low level modules, then the high level modules can be reused quite simply.&lt;br /&gt;
&lt;br /&gt;
==Benefits and Consequences==&lt;br /&gt;
Dependency Inversion Principle proposes a useful mechanism in decoupling the dependencies between the high and low level components of the system. This not only makes sure that the high level components don't directly depend on the low level components, it also makes sure that the  core functionality with n the application can be more easily reused in other contexts.Applying Dependency Inversion Principle makes it easier for reusing the higher level components, but the negative aspect of this is that it prevents the reuse of low level components. Further Dependency Inversion Principle does account for the reuse of lower-level components by maintaining the client interface in a separate package, assigning ownership of this package to one or more consumers of a lower-level component can itself be problematic.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
This principle is applied to make sure that the high level classes are not directly dependent on the low level classes, they are doing that using either by interfaces or abstract classes.In that case the creation of new low level objects inside the high level classes(if necessary) can not be done using the operator new. Instead, some of the Creational design patterns can be used, such as Factory Method, Abstract Factory, Prototype.&lt;br /&gt;
Of course, using this principle implies an increased effort and a more complex code, but more flexible. This principle can not be applied for every class or every module. If we have a class functionality that is more likely to remain unchanged in the future there is not need to apply this principle.When a component does not depend on lower level components directly but only through abstractions this component is mobile that is, the component is reusable in many different contexts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
[1] http://www.objectmentor.com/resources/articles/dip.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://www.ctrl-shift-b.com/2008/12/examining-dependency-inversion.html &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://blogs.imeta.co.uk/jyoung/archive/2008/12/17/540.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://en.wikipedia.org/wiki/Dependency_inversion_principle &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://www.lostechies.com/blogs/gabrielschenker/archive/2009/01/30/the-dependency-inversion-principle.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.oodesign.com/dependency-inversion-principle.html &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.eventhelix.com/realtimemantra/Object_Oriented/dependency_inversion_principle.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://davidhayden.com/blog/dave/archive/2005/06/10/1261.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://doodleproject.sourceforge.net/articles/2001/dependencyInversionPrinciple.html &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.surfscranton.com/architecture/DIPandOCP/img0.html &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://iface.wordpress.com/2006/03/16/dependency-inversion-principle-and-interface/ &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/TemplatePattern.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[14] Martin, R. C. (1996, May). The Dependency Inversion Principle. C++ Report. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29158</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 5 rm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_5_rm&amp;diff=29158"/>
		<updated>2009-11-19T01:37:03Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Dependency Inversion policy=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. &lt;br /&gt;
The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions.&lt;br /&gt;
According to this principle the way of designing a class structure is to start from high level modules to the low level modules:&lt;br /&gt;
&lt;br /&gt;
'''High Level Classes → Abstraction Layer → Low Level Classes'''&lt;br /&gt;
This  is my article&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Dependency Inversion Principle is defined as follows:&lt;br /&gt;
&lt;br /&gt;
#High-level modules should not depend upon low-level modules. Both should depend upon abstractions.&lt;br /&gt;
#Abstractions should not depend upon details. Details should depend upon abstractions.&lt;br /&gt;
&lt;br /&gt;
The problem with the conventional design architecture is that the higher level components depends on the lower level components. This can be understood from the diagram below.&lt;br /&gt;
[[Image:wiki3_5_rm1.png|450px|thumb|center|Figure 1: Higher-level components depend upon lower-level components]]&lt;br /&gt;
&lt;br /&gt;
From the above diagram we see that the component A depends on component B, which in turn depends on component C. These dependencies make the higher level modules or components more complex and inflexible. This also leads to tight coupling of higher and lower level components. Thus reducing the over all flexibility of the system.&lt;br /&gt;
&lt;br /&gt;
The primary motive of the ''dependency inversion principle'' is to decouple the high level components from their dependency on the low level components of the system. This can be obtained by creating  interfaces as a part of the higher level component package which define the components for the extra functionality required. This protects the component from depending on any specific implementation of the provided interface/functionality. Thus making the given function more portable.&lt;br /&gt;
The above example can be restructured as follows&lt;br /&gt;
&lt;br /&gt;
[[Image:wiki3_5_rm2.png|450px|thumb|center|Figure 2: Relationship diagram]]&lt;br /&gt;
As one can see in the above figure the component B doesn't depend on A but rather depends on the interface that is also used by A. The same relationship is additionally shown between components B and C. Take special note that the interfaces are packaged together with the higher-level components and are defined in terms of the higher-level component’s needs, not the lower-level component’s behavior. It is this association of the interface with the client component which logically inverts the conventional dependency flow.&lt;br /&gt;
&lt;br /&gt;
==Example of Dependency inversion principle==&lt;br /&gt;
 // Dependency Inversion Principle - Bad example&lt;br /&gt;
 class Worker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     Worker m_worker;&lt;br /&gt;
     public void setWorker(Worker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker {&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code shown below implements the code above using Dependency Inversion principle.This helps us in solving the following problems.&lt;br /&gt;
#Manager class should not be changed.&lt;br /&gt;
#Minimized risk to affect old funtionallity present in Manager class.&lt;br /&gt;
#No need to redone the unit testing for Manager class.&lt;br /&gt;
&lt;br /&gt;
 // Dependency Inversion Principle - Good example&lt;br /&gt;
 interface IWorker {&lt;br /&gt;
     public void work();&lt;br /&gt;
 }&lt;br /&gt;
 class Worker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     // ....working&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class SuperWorker implements IWorker{&lt;br /&gt;
     public void work() {&lt;br /&gt;
     //.... working much more&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 class Manager {&lt;br /&gt;
     IWorker m_worker;&lt;br /&gt;
     public void setWorker(IWorker w) {&lt;br /&gt;
         m_worker=w;&lt;br /&gt;
     }&lt;br /&gt;
     public void manage() {&lt;br /&gt;
         m_worker.work();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==A design pattern based on dependency inversion policy (Template design pattern)==&lt;br /&gt;
The Template Design pattern implements the Dependency Inversion Principle by setting up the outline or skeleton of an algorithm, leaving the details to be implemented by the classes or modules implementing it. This way, the sub classes will be getting there information from the abstract classes. Further these abstract classes are not dependent on the details while the vice versa is true. The UML diagram below gives you better understanding of the Template design pattern. There are method calls to operation1() and operation2(). The definition of these methods are defined in the subclass which override them.&lt;br /&gt;
[[Image:wiki3_5_rm3.png|450px|thumb|center|Figure 3: Template Design Pattern]]&lt;br /&gt;
&lt;br /&gt;
==Why call it dependency inversion policy?==&lt;br /&gt;
&lt;br /&gt;
The dependency structure of a well designed object oriented application is &amp;quot;inverted&amp;quot; with respect to the dependency structure that normally results from a &amp;quot;traditional&amp;quot; application which is implemented in a more procedural style. In a procedural application high level modules depend upon low level modules and abstractions depend upon details.&lt;br /&gt;
&lt;br /&gt;
Consider the implications of high level modules that depend upon low level modules. It is the high level modules that contain the important policy decisions and business models of an application. It is these models that contain the identity of the application. Yet, when these modules depend upon the lower level modules, then changes to the lower level modules can have direct effects upon them; and can force them to change.&lt;br /&gt;
It is the high level modules that ought to be forcing the low level modules to change. It is the high level modules that should take precedence over the lower level modules. High level modules simply should not depend upon low level modules in any way. Moreover, it is high level modules that we want to be able to reuse. When high level modules depend upon low level modules, it becomes very difficult to reuse those high level modules in different contexts. However, when the high level modules are independent of the low level modules, then the high level modules can be reused quite simply.&lt;br /&gt;
&lt;br /&gt;
==Benefits and Consequences==&lt;br /&gt;
Dependency Inversion Principle proposes a useful mechanism in decoupling the dependencies between the high and low level components of the system. This not only makes sure that the high level components don't directly depend on the low level components, it also makes sure that the  core functionality with n the application can be more easily reused in other contexts.Applying Dependency Inversion Principle makes it easier for reusing the higher level components, but the negative aspect of this is that it prevents the reuse of low level components. Further Dependency Inversion Principle does account for the reuse of lower-level components by maintaining the client interface in a separate package, assigning ownership of this package to one or more consumers of a lower-level component can itself be problematic.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
This principle is applied to make sure that the high level classes are not directly dependent on the low level classes, they are doing that using either by interfaces or abstract classes.In that case the creation of new low level objects inside the high level classes(if necessary) can not be done using the operator new. Instead, some of the Creational design patterns can be used, such as Factory Method, Abstract Factory, Prototype.&lt;br /&gt;
Of course, using this principle implies an increased effort and a more complex code, but more flexible. This principle can not be applied for every class or every module. If we have a class functionality that is more likely to remain unchanged in the future there is not need to apply this principle.When a component does not depend on lower level components directly but only through abstractions this component is mobile that is, the component is reusable in many different contexts.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
[1] http://www.objectmentor.com/resources/articles/dip.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://www.ctrl-shift-b.com/2008/12/examining-dependency-inversion.html &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://blogs.imeta.co.uk/jyoung/archive/2008/12/17/540.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://en.wikipedia.org/wiki/Dependency_inversion_principle &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://www.lostechies.com/blogs/gabrielschenker/archive/2009/01/30/the-dependency-inversion-principle.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.oodesign.com/dependency-inversion-principle.html &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.eventhelix.com/realtimemantra/Object_Oriented/dependency_inversion_principle.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://davidhayden.com/blog/dave/archive/2005/06/10/1261.aspx &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://doodleproject.sourceforge.net/articles/2001/dependencyInversionPrinciple.html &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.surfscranton.com/architecture/DIPandOCP/img0.html &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://iface.wordpress.com/2006/03/16/dependency-inversion-principle-and-interface/ &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/TemplatePattern.htm &amp;lt;br&amp;gt;&lt;br /&gt;
[14] Martin, R. C. (1996, May). The Dependency Inversion Principle. C++ Report. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:JRapture.jpg&amp;diff=26314</id>
		<title>File:JRapture.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:JRapture.jpg&amp;diff=26314"/>
		<updated>2009-10-15T03:29:56Z</updated>

		<summary type="html">&lt;p&gt;Sniper: jRapture&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;jRapture&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=26308</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 10 mk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=26308"/>
		<updated>2009-10-15T03:25:17Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* 7. jRapture: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=GUI Testing Frameworks=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Most software developed in recent years has a graphical user interface (GUI). The only way for the end-user to interact with the software application is through the GUI. Hence, acceptance and system testing of the software requires GUI testing.  In this wiki we aim at covering the different approaches, including patterns and tools for GUI testing.&lt;br /&gt;
&lt;br /&gt;
==Some problems of GUI testing==&lt;br /&gt;
*GUIs are tested manually, often by the developers themselves. This is very unreliable and expensive. For new GUIs or those being significantly changed, quality is low, and failures at integration time or during user acceptance tests are common. &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Data_scraping#Screen_scraping ScreenScrapper] based GUI test does a nice job but to a certain extent. Even though they are cheap, the problem with these tests is that if you change the screen layout all existing tests become useless, which means you have no [http://en.wikipedia.org/wiki/Regression_testing regression tests]. Another problem here is that test creators can't start writing tests till the GUIs are finished. Example: [http://en.wikipedia.org/wiki/Test_harness test harnesses], [http://www.citeulike.org/user/V/article/2682599 capture/replay tools](Example provided in the appendix), and [http://en.wikipedia.org/wiki/Model-based_testing model-based methods]&lt;br /&gt;
*The user has an extremely wide choice of actions. The user could click on any pixel on the screen. Using manual tools to mimic the   usage of the GUI only provides limited testing.&lt;br /&gt;
*There are tools which try to capture [http://en.wikipedia.org/wiki/GUI_widget GUI widgets] rather than mouse coordinates. These tools, however, require a significant amount of manual effort to be effective, including developing test scripts and manually detecting failures.Modifications to the GUI require changes to the scripts as well. Example: [http://en.wikipedia.org/wiki/HP_WinRunner Winrunner], [http://www.testingfaqs.org/t-gui.html#Abbot Abbot], and [http://www-01.ibm.com/software/awdtools/tester/robot/index.html Rational Robot]&lt;br /&gt;
&lt;br /&gt;
==Approaches for GUI testing==&lt;br /&gt;
&lt;br /&gt;
===1. An Ontology-Based Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2009.92]===&lt;br /&gt;
&lt;br /&gt;
In the approach an GUI testing [http://en.wikipedia.org/wiki/Ontology ontology] is established by analyzing the source code with [http://en.wikipedia.org/wiki/Reverse_engineering reverse engineering] techniques. Then from the user experience the generation rules are extracted to create test cases. GUI testing is proposed for the purpose of making use of the knowledge provided by GUI systems and testers’ experience. GUI ontology is used to store potential&lt;br /&gt;
information in a GUI system, while test case generation rules extract useful information from testers’ experience. In a word, ontology based GUI testing is a new branch of software testing, which not only takes the knowledge intensive features of GUI testing into account, but also sufficiently make use of them.&lt;br /&gt;
&lt;br /&gt;
===2. Automation of GUI testing using a model-driven approach [http://portal.acm.org/citation.cfm?id=1138932]===&lt;br /&gt;
In this approach the generated test cases are based on [http://en.wikipedia.org/wiki/Unified_Modeling_Language Unified Modelling Language]. This introduces data into the UML model via the [http://portal.acm.org/citation.cfm?id=62964 Category-Partition method]. The functions that have to be tested are specified using the [http://en.wikipedia.org/wiki/Use_case use cases] and [http://en.wikipedia.org/wiki/Activity_diagram activity diagrams]. This also specifies how they have to be tested. A combination like this has the potential to generate large number of test cases.The test can be managed in two ways.Firstly the Category-partitioned data which allows the designer full control over the possible and impossible paths for the system to run.Secondly automation allows different configuration for both data and graph coverage.Using all this we can generate test scripts which can be used for GUI testing.&lt;br /&gt;
&lt;br /&gt;
[[Image:usecase.png|450px|thumb|center|Figure 1:Example Use Case Diagram]]&lt;br /&gt;
&lt;br /&gt;
===3. Plan Generation GUI testing [http://www.cs.virginia.edu/~soffa/research/SE/AIPS00.pdf]===&lt;br /&gt;
This is based on the AI techniques, for partially automating GUI testing.In this method of testing the tester specifies the initial and the final goal states for the users of the system.The automated system produces a set of sequences or plans which will start with the initial state and end with the final state specified by the user. Each of the plans generated will represent a test case of a user of the system.&lt;br /&gt;
&lt;br /&gt;
===4. A practical approach to testing GUI systems [http://www.springerlink.com/content/d08681k5081553r7/]===&lt;br /&gt;
In this approach, GUI is divided into two tires. One the component and other the system. [http://en.wikipedia.org/wiki/Control_flow_graph Flow graphs] will be created for each GUI component. The flow graph represents a set of preconditions, event sequences and post conditions of the corresponding component. On the system tire we build a viewpoint by integrating the components of the system. This will ensure that the components are working fine and are interacting as required. This is a simple, effective and practical method of performing GUI testing.&lt;br /&gt;
&lt;br /&gt;
===5. A Dynamic Partitioning Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94]===&lt;br /&gt;
The above approaches specify how to generate the test cases without actually specifying how to run them. This approach specifies how the test cases have to run in order to make GUI testing effective and useful. Th GUI primitive actions are partitioned into two classes. They are prioritized primitive actions and non-prioritized primitive actions.  This further divides the testing into two stages which contains two feed back loops.The first stage prioritizes primitive actions and the second stage selects and performs prioritized primitive actions. The first feedback loop is local and occurs in the second stage, which adjusts the memberships of primitive actions after they are performed. The second feedback loop is global and occurs between the first and second stages. It switches GUI testing from the second stage to the first stage when no prioritized primitive actions are available. The two testing experiments with real GUI applications show that the proposed dynamic partitioning approach can really work in practice and may significantly outperform the random testing approach.&lt;br /&gt;
&lt;br /&gt;
==Tools for GUI testing==&lt;br /&gt;
===1. GUITAR===&lt;br /&gt;
The [http://guitar.sourceforge.net/ GUITAR] (GUI Testing frAmewoRk) project helps in simplifying GUI testing by automatically creating test cases that intelligently challenge a GUI's functionality. It currently contains a rich collection of plug-ins that may be used to test an application through its graphical user interface. For example, the “test case generator” plug-in, a tester can automatically generate various types of test cases for the Application Under Test (AUT);  the “replayer” plug-in may be used to execute these test cases on the AUT automatically; during the various development phases of the AUT, the “regression tester” plug-in can be used to efficiently perform regression testing on the AUT.&lt;br /&gt;
&lt;br /&gt;
[[Image:guitar.jpg|650px|thumb|center|figure 1:[http://guitar.sourceforge.net/ Guitar Framework]]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to test the GUI of the AUT, the tester has to perform a certain set of steps. These steps are detailed below&lt;br /&gt;
*Initialize configurations in GUITAR for the AUT. This can be done using the below window&lt;br /&gt;
[[Image:guitar1.jpg|650px|thumb|center|figure 2:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Initialise Preferences window for initializing the application type]]]&lt;br /&gt;
&lt;br /&gt;
*Rip the GUI structure of the AUT : To begin testing an application, the tester first needs to determine the GUI structure of the AUT. Running the Ripper applications on the AUT automatically does this. Types of rippers are available for analyzing the AUT. For analyzing an AUT developed using&lt;br /&gt;
**Java use the [http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/JavaGUIRipper.htm JavaGUIRipper]&lt;br /&gt;
**Native Win32 use [http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/GUIRipper.htm Windows GUI Ripper]&lt;br /&gt;
&lt;br /&gt;
*Generate the Event Flow Graph : The Event Flow Graph is generated from the GUI structure, ripped in the above step. The EFGGenerator generates the event-flow graph for an AUT’s GUI. To see how to analyzes a window-based application and understand its GUI integration tree. This is explained in detail [http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/EFGGenerator.htm here]&lt;br /&gt;
&lt;br /&gt;
*Generate Test cases : To generate testcases from the event flow graphs use the [http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/TCGenerator.htm TCGenerator]&lt;br /&gt;
&lt;br /&gt;
*Replay the Testcases : &lt;br /&gt;
&lt;br /&gt;
[[Image:guitar2.jpg|650px|thumb|center|figure 3:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Replayer Testcase execution]]]&lt;br /&gt;
&lt;br /&gt;
*Coverage Evaluation&lt;br /&gt;
Execute the coverage evaluator to analyze the coverage generated when the testcases were executed on the instrumented AUT. A coverage report is generated by the instrumented code, when the testcases are replayed on it. The coverage evaluator analyzes this report and a summary report is generated.&lt;br /&gt;
&lt;br /&gt;
[[Image:guitar3.jpg|650px|thumb|center|figure 4:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Coverager Running the coverage evaluator]]]&lt;br /&gt;
&lt;br /&gt;
===2. Planning Assisted Tester for grapHical user interface Systems (PATHS)===&lt;br /&gt;
This is based on the event interaction sequences. This tests the GUI software using interactions which are mostly likely to be used in actual scenarios. This accepts an operator, initial state and a final state, with which the planning sequence produces a series of sequences which transforms the system form the initial state to the final state. The GUI tester can use this to generate interactions sequences by specifying the final state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===3. GUIdancer===&lt;br /&gt;
[http://www.bredex.de/en/guidancer/first.html GUIdancer] is an [http://en.wikipedia.org/wiki/Eclipse_(software) Eclipse]-based automated GUI test-tool which runs as a standalone application or as an Eclipse Plugin.  &lt;br /&gt;
&lt;br /&gt;
GUIdancer is different from other GUI test-tools because automated tests can be written before the Application Under Test (AUT) is ready. This means that GUIdancer is not a tool which tests an application by recording user actions and replaying them. Tests can be created from the requirements without access to the AUT, and involve no programming, script or code. GUIdancer tests can be created, run and maintained without support from automation experts.&lt;br /&gt;
&lt;br /&gt;
Each Test Step (the smallest unit in GUIdancer) consists of three pieces of information chosen from interactive dialogs: the GUI-component to be tested, the action to execute on this component, and the parameters (or data) the action requires. A Test Step to enter “hello” into a text field would look like this:&lt;br /&gt;
&lt;br /&gt;
 * GUI-component: Text field&lt;br /&gt;
 * Action: Enter Text&lt;br /&gt;
 * Parameter: Hello&lt;br /&gt;
&lt;br /&gt;
===4. SeliniumHQ===&lt;br /&gt;
[http://seleniumhq.org/ Selenium] is a robust set of tools that supports rapid development of test automation for web-based applications. Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.&lt;br /&gt;
'''How Selenium Works'''&lt;br /&gt;
&lt;br /&gt;
[[Image:selenium.png|650px|thumb|center|Figure 1:[http://seleniumhq.org/about/how.html How Selenium Works]]]&lt;br /&gt;
&lt;br /&gt;
===6. Cucumber:===&lt;br /&gt;
Cucumber is a tool that can execute plain-text functional descriptions as automated tests. The language that Cucumber understands is called [http://wiki.github.com/aslakhellesoy/cucumber/gherkin Gherkin]. Here is an example [http://wiki.github.com/aslakhellesoy/cucumber source]:&lt;br /&gt;
 Feature: Search courses&lt;br /&gt;
  In order to ensure better utilization of courses&lt;br /&gt;
  Potential students should be able to search for courses&lt;br /&gt;
&lt;br /&gt;
  Scenario: Search by topic&lt;br /&gt;
    Given there are 240 courses which do not have the topic &amp;quot;biology&amp;quot;&lt;br /&gt;
    And there are 2 courses A001, B205 that each have &amp;quot;biology&amp;quot; as one of the topics&lt;br /&gt;
    When I search for &amp;quot;biology&amp;quot;&lt;br /&gt;
    Then I should see the following courses:&lt;br /&gt;
      | Course code |&lt;br /&gt;
      | A001        |&lt;br /&gt;
      | B205        |&lt;br /&gt;
&lt;br /&gt;
Cucumber itself is written in Ruby, but it can be used to “test” code written in Ruby or other languages including but not limited to Java, C# and Python. Cucumber only requires minimal use of Ruby programming and Ruby is easy, so don’t be afraid even if the code you’re developing in is not Ruby.&lt;br /&gt;
&lt;br /&gt;
===7. jRapture:===&lt;br /&gt;
jRapture is a tool for capturing and replying Java program execution in the field.This works with the Java binaries and the Java virtual machine. It employs a lightweight , transparent capture process that permits unobtrusive of a Java programs executions. jRapture captures the interactions between a Java program and the system, which includes GUI.It has a profiling interface that permits a Java program to be instrumented for profiling after its executions have been captured.Using an XML-based profiling specification language a tester can specify various forms of profiling to be carried out during replay.&lt;br /&gt;
&lt;br /&gt;
[[Image:selenium.png|650px|thumb|center|Figure 1:[http://seleniumhq.org/about/how.html How Selenium Works]]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In summary, GUI testing is a complicated task. Systematic test design helps us to focus on the important tests and gives us an objective way of addressing risks. Tools are appropriate for many but not all tests and a staged approach to testing enables us to identify which tests to automate much more easily. Tools can therefore be used to detect errors pro-actively as well as to execute regression tests. &lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[1] http://c2.com/cgi/wiki?GuiTesting &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://chandlerproject.org/Journal/AutomatedGuiTestingProject &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://en.wikipedia.org/wiki/GUI_software_testing &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://www.open-xchange.com/wiki/index.php?title=Automated_GUI_Tests &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://agilistas.org/presentations/codecamp06/ &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.ranorex.com/?gclid=CNvA_YnesJ0CFchW2godpT5YrQ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.gerrardconsulting.com/GUI/TestGui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://www.slideshare.net/rpires/GUI-Test-Patterns &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://en.wikipedia.org/wiki/List_of_GUI_testing_tools &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://www.junit.org/taxonomy/term/6 &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.cs.umd.edu/~atif/papers/MemonSQW2000.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://www.testingfaqs.org/t-gui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.springerlink.com/content/d08681k5081553r7/ &amp;lt;br&amp;gt;&lt;br /&gt;
[14] http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Rip &amp;lt;br&amp;gt;&lt;br /&gt;
[15] http://seleniumhq.org/ &amp;lt;br&amp;gt;&lt;br /&gt;
[16] http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=26306</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 10 mk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=26306"/>
		<updated>2009-10-15T03:22:43Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Tools for GUI testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=GUI Testing Frameworks=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Most software developed in recent years has a graphical user interface (GUI). The only way for the end-user to interact with the software application is through the GUI. Hence, acceptance and system testing of the software requires GUI testing.  In this wiki we aim at covering the different approaches, including patterns and tools for GUI testing.&lt;br /&gt;
&lt;br /&gt;
==Some problems of GUI testing==&lt;br /&gt;
*GUIs are tested manually, often by the developers themselves. This is very unreliable and expensive. For new GUIs or those being significantly changed, quality is low, and failures at integration time or during user acceptance tests are common. &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Data_scraping#Screen_scraping ScreenScrapper] based GUI test does a nice job but to a certain extent. Even though they are cheap, the problem with these tests is that if you change the screen layout all existing tests become useless, which means you have no [http://en.wikipedia.org/wiki/Regression_testing regression tests]. Another problem here is that test creators can't start writing tests till the GUIs are finished. Example: [http://en.wikipedia.org/wiki/Test_harness test harnesses], [http://www.citeulike.org/user/V/article/2682599 capture/replay tools](Example provided in the appendix), and [http://en.wikipedia.org/wiki/Model-based_testing model-based methods]&lt;br /&gt;
*The user has an extremely wide choice of actions. The user could click on any pixel on the screen. Using manual tools to mimic the   usage of the GUI only provides limited testing.&lt;br /&gt;
*There are tools which try to capture [http://en.wikipedia.org/wiki/GUI_widget GUI widgets] rather than mouse coordinates. These tools, however, require a significant amount of manual effort to be effective, including developing test scripts and manually detecting failures.Modifications to the GUI require changes to the scripts as well. Example: [http://en.wikipedia.org/wiki/HP_WinRunner Winrunner], [http://www.testingfaqs.org/t-gui.html#Abbot Abbot], and [http://www-01.ibm.com/software/awdtools/tester/robot/index.html Rational Robot]&lt;br /&gt;
&lt;br /&gt;
==Approaches for GUI testing==&lt;br /&gt;
&lt;br /&gt;
===1. An Ontology-Based Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2009.92]===&lt;br /&gt;
&lt;br /&gt;
In the approach an GUI testing [http://en.wikipedia.org/wiki/Ontology ontology] is established by analyzing the source code with [http://en.wikipedia.org/wiki/Reverse_engineering reverse engineering] techniques. Then from the user experience the generation rules are extracted to create test cases. GUI testing is proposed for the purpose of making use of the knowledge provided by GUI systems and testers’ experience. GUI ontology is used to store potential&lt;br /&gt;
information in a GUI system, while test case generation rules extract useful information from testers’ experience. In a word, ontology based GUI testing is a new branch of software testing, which not only takes the knowledge intensive features of GUI testing into account, but also sufficiently make use of them.&lt;br /&gt;
&lt;br /&gt;
===2. Automation of GUI testing using a model-driven approach [http://portal.acm.org/citation.cfm?id=1138932]===&lt;br /&gt;
In this approach the generated test cases are based on [http://en.wikipedia.org/wiki/Unified_Modeling_Language Unified Modelling Language]. This introduces data into the UML model via the [http://portal.acm.org/citation.cfm?id=62964 Category-Partition method]. The functions that have to be tested are specified using the [http://en.wikipedia.org/wiki/Use_case use cases] and [http://en.wikipedia.org/wiki/Activity_diagram activity diagrams]. This also specifies how they have to be tested. A combination like this has the potential to generate large number of test cases.The test can be managed in two ways.Firstly the Category-partitioned data which allows the designer full control over the possible and impossible paths for the system to run.Secondly automation allows different configuration for both data and graph coverage.Using all this we can generate test scripts which can be used for GUI testing.&lt;br /&gt;
&lt;br /&gt;
[[Image:usecase.png|450px|thumb|center|Figure 1:Example Use Case Diagram]]&lt;br /&gt;
&lt;br /&gt;
===3. Plan Generation GUI testing [http://www.cs.virginia.edu/~soffa/research/SE/AIPS00.pdf]===&lt;br /&gt;
This is based on the AI techniques, for partially automating GUI testing.In this method of testing the tester specifies the initial and the final goal states for the users of the system.The automated system produces a set of sequences or plans which will start with the initial state and end with the final state specified by the user. Each of the plans generated will represent a test case of a user of the system.&lt;br /&gt;
&lt;br /&gt;
===4. A practical approach to testing GUI systems [http://www.springerlink.com/content/d08681k5081553r7/]===&lt;br /&gt;
In this approach, GUI is divided into two tires. One the component and other the system. [http://en.wikipedia.org/wiki/Control_flow_graph Flow graphs] will be created for each GUI component. The flow graph represents a set of preconditions, event sequences and post conditions of the corresponding component. On the system tire we build a viewpoint by integrating the components of the system. This will ensure that the components are working fine and are interacting as required. This is a simple, effective and practical method of performing GUI testing.&lt;br /&gt;
&lt;br /&gt;
===5. A Dynamic Partitioning Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94]===&lt;br /&gt;
The above approaches specify how to generate the test cases without actually specifying how to run them. This approach specifies how the test cases have to run in order to make GUI testing effective and useful. Th GUI primitive actions are partitioned into two classes. They are prioritized primitive actions and non-prioritized primitive actions.  This further divides the testing into two stages which contains two feed back loops.The first stage prioritizes primitive actions and the second stage selects and performs prioritized primitive actions. The first feedback loop is local and occurs in the second stage, which adjusts the memberships of primitive actions after they are performed. The second feedback loop is global and occurs between the first and second stages. It switches GUI testing from the second stage to the first stage when no prioritized primitive actions are available. The two testing experiments with real GUI applications show that the proposed dynamic partitioning approach can really work in practice and may significantly outperform the random testing approach.&lt;br /&gt;
&lt;br /&gt;
==Tools for GUI testing==&lt;br /&gt;
===1. GUITAR===&lt;br /&gt;
The [http://guitar.sourceforge.net/ GUITAR] (GUI Testing frAmewoRk) project helps in simplifying GUI testing by automatically creating test cases that intelligently challenge a GUI's functionality. It currently contains a rich collection of plug-ins that may be used to test an application through its graphical user interface. For example, the “test case generator” plug-in, a tester can automatically generate various types of test cases for the Application Under Test (AUT);  the “replayer” plug-in may be used to execute these test cases on the AUT automatically; during the various development phases of the AUT, the “regression tester” plug-in can be used to efficiently perform regression testing on the AUT.&lt;br /&gt;
&lt;br /&gt;
[[Image:guitar.jpg|650px|thumb|center|figure 1:[http://guitar.sourceforge.net/ Guitar Framework]]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to test the GUI of the AUT, the tester has to perform a certain set of steps. These steps are detailed below&lt;br /&gt;
*Initialize configurations in GUITAR for the AUT. This can be done using the below window&lt;br /&gt;
[[Image:guitar1.jpg|650px|thumb|center|figure 2:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Initialise Preferences window for initializing the application type]]]&lt;br /&gt;
&lt;br /&gt;
*Rip the GUI structure of the AUT : To begin testing an application, the tester first needs to determine the GUI structure of the AUT. Running the Ripper applications on the AUT automatically does this. Types of rippers are available for analyzing the AUT. For analyzing an AUT developed using&lt;br /&gt;
**Java use the [http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/JavaGUIRipper.htm JavaGUIRipper]&lt;br /&gt;
**Native Win32 use [http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/GUIRipper.htm Windows GUI Ripper]&lt;br /&gt;
&lt;br /&gt;
*Generate the Event Flow Graph : The Event Flow Graph is generated from the GUI structure, ripped in the above step. The EFGGenerator generates the event-flow graph for an AUT’s GUI. To see how to analyzes a window-based application and understand its GUI integration tree. This is explained in detail [http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/EFGGenerator.htm here]&lt;br /&gt;
&lt;br /&gt;
*Generate Test cases : To generate testcases from the event flow graphs use the [http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/TCGenerator.htm TCGenerator]&lt;br /&gt;
&lt;br /&gt;
*Replay the Testcases : &lt;br /&gt;
&lt;br /&gt;
[[Image:guitar2.jpg|650px|thumb|center|figure 3:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Replayer Testcase execution]]]&lt;br /&gt;
&lt;br /&gt;
*Coverage Evaluation&lt;br /&gt;
Execute the coverage evaluator to analyze the coverage generated when the testcases were executed on the instrumented AUT. A coverage report is generated by the instrumented code, when the testcases are replayed on it. The coverage evaluator analyzes this report and a summary report is generated.&lt;br /&gt;
&lt;br /&gt;
[[Image:guitar3.jpg|650px|thumb|center|figure 4:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Coverager Running the coverage evaluator]]]&lt;br /&gt;
&lt;br /&gt;
===2. Planning Assisted Tester for grapHical user interface Systems (PATHS)===&lt;br /&gt;
This is based on the event interaction sequences. This tests the GUI software using interactions which are mostly likely to be used in actual scenarios. This accepts an operator, initial state and a final state, with which the planning sequence produces a series of sequences which transforms the system form the initial state to the final state. The GUI tester can use this to generate interactions sequences by specifying the final state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===3. GUIdancer===&lt;br /&gt;
[http://www.bredex.de/en/guidancer/first.html GUIdancer] is an [http://en.wikipedia.org/wiki/Eclipse_(software) Eclipse]-based automated GUI test-tool which runs as a standalone application or as an Eclipse Plugin.  &lt;br /&gt;
&lt;br /&gt;
GUIdancer is different from other GUI test-tools because automated tests can be written before the Application Under Test (AUT) is ready. This means that GUIdancer is not a tool which tests an application by recording user actions and replaying them. Tests can be created from the requirements without access to the AUT, and involve no programming, script or code. GUIdancer tests can be created, run and maintained without support from automation experts.&lt;br /&gt;
&lt;br /&gt;
Each Test Step (the smallest unit in GUIdancer) consists of three pieces of information chosen from interactive dialogs: the GUI-component to be tested, the action to execute on this component, and the parameters (or data) the action requires. A Test Step to enter “hello” into a text field would look like this:&lt;br /&gt;
&lt;br /&gt;
 * GUI-component: Text field&lt;br /&gt;
 * Action: Enter Text&lt;br /&gt;
 * Parameter: Hello&lt;br /&gt;
&lt;br /&gt;
===4. SeliniumHQ===&lt;br /&gt;
[http://seleniumhq.org/ Selenium] is a robust set of tools that supports rapid development of test automation for web-based applications. Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.&lt;br /&gt;
'''How Selenium Works'''&lt;br /&gt;
&lt;br /&gt;
[[Image:selenium.png|650px|thumb|center|Figure 1:[http://seleniumhq.org/about/how.html How Selenium Works]]]&lt;br /&gt;
&lt;br /&gt;
===6. Cucumber:===&lt;br /&gt;
Cucumber is a tool that can execute plain-text functional descriptions as automated tests. The language that Cucumber understands is called [http://wiki.github.com/aslakhellesoy/cucumber/gherkin Gherkin]. Here is an example [http://wiki.github.com/aslakhellesoy/cucumber source]:&lt;br /&gt;
 Feature: Search courses&lt;br /&gt;
  In order to ensure better utilization of courses&lt;br /&gt;
  Potential students should be able to search for courses&lt;br /&gt;
&lt;br /&gt;
  Scenario: Search by topic&lt;br /&gt;
    Given there are 240 courses which do not have the topic &amp;quot;biology&amp;quot;&lt;br /&gt;
    And there are 2 courses A001, B205 that each have &amp;quot;biology&amp;quot; as one of the topics&lt;br /&gt;
    When I search for &amp;quot;biology&amp;quot;&lt;br /&gt;
    Then I should see the following courses:&lt;br /&gt;
      | Course code |&lt;br /&gt;
      | A001        |&lt;br /&gt;
      | B205        |&lt;br /&gt;
&lt;br /&gt;
Cucumber itself is written in Ruby, but it can be used to “test” code written in Ruby or other languages including but not limited to Java, C# and Python. Cucumber only requires minimal use of Ruby programming and Ruby is easy, so don’t be afraid even if the code you’re developing in is not Ruby.&lt;br /&gt;
&lt;br /&gt;
===7. jRapture:===&lt;br /&gt;
jRapture is a tool for capturing and replying Java program execution in the field.This works with the Java binaries and the Java virtual machine. It employs a lightweight , transparent capture process that permits unobtrusive of a Java programs executions. jRapture captures the interactions between a Java program and the system, which includes GUI.It has a profiling interface that permits a Java program to be instrumented for profiling after its executions have been captured.Using an XML-based profiling specification language a tester can specify various forms of profiling to be carried out during replay.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In summary, GUI testing is a complicated task. Systematic test design helps us to focus on the important tests and gives us an objective way of addressing risks. Tools are appropriate for many but not all tests and a staged approach to testing enables us to identify which tests to automate much more easily. Tools can therefore be used to detect errors pro-actively as well as to execute regression tests. &lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[1] http://c2.com/cgi/wiki?GuiTesting &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://chandlerproject.org/Journal/AutomatedGuiTestingProject &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://en.wikipedia.org/wiki/GUI_software_testing &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://www.open-xchange.com/wiki/index.php?title=Automated_GUI_Tests &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://agilistas.org/presentations/codecamp06/ &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.ranorex.com/?gclid=CNvA_YnesJ0CFchW2godpT5YrQ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.gerrardconsulting.com/GUI/TestGui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://www.slideshare.net/rpires/GUI-Test-Patterns &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://en.wikipedia.org/wiki/List_of_GUI_testing_tools &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://www.junit.org/taxonomy/term/6 &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.cs.umd.edu/~atif/papers/MemonSQW2000.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://www.testingfaqs.org/t-gui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.springerlink.com/content/d08681k5081553r7/ &amp;lt;br&amp;gt;&lt;br /&gt;
[14] http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Rip &amp;lt;br&amp;gt;&lt;br /&gt;
[15] http://seleniumhq.org/ &amp;lt;br&amp;gt;&lt;br /&gt;
[16] http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=25609</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 10 mk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=25609"/>
		<updated>2009-10-11T00:29:01Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* 1. An Ontology-Based Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2009.92] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=GUI Testing Frameworks=&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Most software developed in recent years has a graphical user interface (GUI). The only way for the end-user to interact with the software application is through the GUI. Hence, acceptance and system testing of the software requires GUI testing.  In this wiki we aim at covering the different approaches, including patterns and tools for GUI testing.&lt;br /&gt;
&lt;br /&gt;
==Some problems of GUI testing==&lt;br /&gt;
*GUIs are tested manually, often by the developers themselves. This is very unreliable and expensive. For new GUIs or those being significantly changed, quality is low, and failures at integration time or during user acceptance tests are common. &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Data_scraping#Screen_scraping ScreenScrapper] based GUI test does a nice job but to a certain extent. Even though they are cheap, the problem with these tests is that if you change the screen layout all existing tests become useless, which means you have no [http://en.wikipedia.org/wiki/Regression_testing regression tests]. Another problem here is that test creators can't start writing tests till the GUIs are finished. Example: [http://en.wikipedia.org/wiki/Test_harness test harnesses], [http://www.citeulike.org/user/V/article/2682599 capture/replay tools], and [http://en.wikipedia.org/wiki/Model-based_testing model-based methods]&lt;br /&gt;
*The user has an extremely wide choice of actions. The user could click on any pixel on the screen. Using manual tools to mimic the   usage of the GUI only provides limited testing.&lt;br /&gt;
*There are tools which try to capture [http://en.wikipedia.org/wiki/GUI_widget GUI widgets] rather than mouse coordinates. These tools, however, require a significant amount of manual effort to be effective, including developing test scripts and manually detecting failures.Modifications to the GUI require changes to the scripts as well. Example: [http://en.wikipedia.org/wiki/HP_WinRunner Winrunner], [http://www.testingfaqs.org/t-gui.html#Abbot Abbot], and [http://www-01.ibm.com/software/awdtools/tester/robot/index.html Rational Robot]&lt;br /&gt;
&lt;br /&gt;
==Approaches for GUI testing==&lt;br /&gt;
&lt;br /&gt;
===1. An Ontology-Based Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2009.92]===&lt;br /&gt;
&lt;br /&gt;
In the approach an GUI testing [http://en.wikipedia.org/wiki/Ontology ontology] is established by analyzing the source code with [http://en.wikipedia.org/wiki/Reverse_engineering reverse engineering] techniques. Then from the user experience the generation rules are extracted to create test cases. GUI testing is proposed for the purpose of making use of the knowledge provided by GUI systems and testers’ experience. GUI ontology is used to store potential&lt;br /&gt;
information in a GUI system, while test case generation rules extract useful information from testers’ experience. In a word, ontology based GUI testing is a new branch of software testing, which not only takes the knowledge intensive features of GUI testing into account, but also sufficiently make use of them.&lt;br /&gt;
&lt;br /&gt;
===2. Automation of GUI testing using a model-driven approach [http://portal.acm.org/citation.cfm?id=1138932]===&lt;br /&gt;
In this approach the generated test cases are based on [http://en.wikipedia.org/wiki/Unified_Modeling_Language Unified Modelling Language]. This introduces data into the UML model via the [http://portal.acm.org/citation.cfm?id=62964 Category-Partition method]. The functions that have to be tested are specified using the [http://en.wikipedia.org/wiki/Use_case use cases] and [http://en.wikipedia.org/wiki/Activity_diagram activity diagrams]. This also specifies how they have to be tested. A combination like this has the potential to generate large number of test cases.The test can be managed in two ways.Firstly the Category-partitioned data which allows the designer full control over the possible and impossible paths for the system to run.Secondly automation allows different configuration for both data and graph coverage.Using all this we can generate test scripts which can be used for GUI testing.&lt;br /&gt;
&lt;br /&gt;
[[Image:usecase.png|450px|thumb|center|Figure 1:Example Use Case Diagram]]&lt;br /&gt;
&lt;br /&gt;
===3. Plan Generation GUI testing [http://www.cs.virginia.edu/~soffa/research/SE/AIPS00.pdf]===&lt;br /&gt;
This is based on the AI techniques, for partially automating GUI testing.In this method of testing the tester specifies the initial and the final goal states for the users of the system.The automated system produces a set of sequences or plans which will start with the initial state and end with the final state specified by the user. Each of the plans generated will represent a test case of a user of the system.&lt;br /&gt;
&lt;br /&gt;
===4. A practical approach to testing GUI systems [http://www.springerlink.com/content/d08681k5081553r7/]===&lt;br /&gt;
In this approach, GUI is divided into two tires. One the component and other the system. [http://en.wikipedia.org/wiki/Control_flow_graph Flow graphs] will be created for each GUI component. The flow graph represents a set of preconditions, event sequences and post conditions of the corresponding component. On the system tire we build a viewpoint by integrating the components of the system. This will ensure that the components are working fine and are interacting as required. This is a simple, effective and practical method of performing GUI testing.&lt;br /&gt;
&lt;br /&gt;
===5. A Dynamic Partitioning Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94]===&lt;br /&gt;
The above approaches specify how to generate the test cases without actually specifying how to run them. This approach specifies how the test cases have to run in order to make GUI testing effective and useful. Th GUI primitive actions are partitioned into two classes. They are prioritized primitive actions and non-prioritized primitive actions.  This further divides the testing into two stages which contains two feed back loops.The first stage prioritizes primitive actions and the second stage selects and performs prioritized primitive actions. The first feedback loop is local and occurs in the second stage, which adjusts the memberships of primitive actions after they are performed. The second feedback loop is global and occurs between the first and second stages. It switches GUI testing from the second stage to the first stage when no prioritized primitive actions are available. The two testing experiments with real GUI applications show that the proposed dynamic partitioning approach can really work in practice and may significantly outperform the random testing approach.&lt;br /&gt;
&lt;br /&gt;
==Tools for GUI testing==&lt;br /&gt;
===1. GUITAR===&lt;br /&gt;
The [http://guitar.sourceforge.net/ GUITAR] (GUI Testing frAmewoRk) project helps in simplifying GUI testing by automatically creating test cases that intelligently challenge a GUI's functionality. It currently contains a rich collection of plug-ins that may be used to test an application through its graphical user interface. For example, the “test case generator” plug-in, a tester can automatically generate various types of test cases for the Application Under Test (AUT);  the “replayer” plug-in may be used to execute these test cases on the AUT automatically; during the various development phases of the AUT, the “regression tester” plug-in can be used to efficiently perform regression testing on the AUT.&lt;br /&gt;
&lt;br /&gt;
[[Image:guitar.jpg|650px|thumb|center|figure 1:[http://guitar.sourceforge.net/ Guitar Framework]]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to test the GUI of the AUT, the tester has to perform a certain set of steps. These steps are detailed below&lt;br /&gt;
*Initialize configurations in GUITAR for the AUT. This can be done using the below window&lt;br /&gt;
[[Image:guitar1.jpg|650px|thumb|center|figure 2:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Initialise Preferences window for initializing the application type]]]&lt;br /&gt;
&lt;br /&gt;
*Replay the Testcases&lt;br /&gt;
[[Image:guitar2.jpg|650px|thumb|center|figure 3:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Replayer Testcase execution]]]&lt;br /&gt;
&lt;br /&gt;
*Coverage Evaluation&lt;br /&gt;
Execute the coverage evaluator to analyze the coverage generated when the testcases were executed on the instrumented AUT. A coverage report is generated by the instrumented code, when the testcases are replayed on it. The coverage evaluator analyzes this report and a summary report is generated.&lt;br /&gt;
[[Image:guitar3.jpg|650px|thumb|center|figure 4:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Coverager Running the coverage evaluator]]]&lt;br /&gt;
&lt;br /&gt;
===2. Planning Assisted Tester for grapHical user interface Systems (PATHS)===&lt;br /&gt;
This is based on the event interaction sequences. This tests the GUI software using interactions which are mostly likely to be used in actual scenarios. This accepts an operator, initial state and a final state, with which the planning sequence produces a series of sequences which transforms the system form the initial state to the final state. The GUI tester can use this to generate interactions sequences by specifying the final state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===3. GUIdancer===&lt;br /&gt;
[http://www.bredex.de/en/guidancer/first.html GUIdancer] is an [http://en.wikipedia.org/wiki/Eclipse_(software) Eclipse]-based automated GUI test-tool which runs as a standalone application or as an Eclipse Plugin.  &lt;br /&gt;
&lt;br /&gt;
GUIdancer is different from other GUI test-tools because automated tests can be written before the Application Under Test (AUT) is ready. This means that GUIdancer is not a tool which tests an application by recording user actions and replaying them. Tests can be created from the requirements without access to the AUT, and involve no programming, script or code. GUIdancer tests can be created, run and maintained without support from automation experts.&lt;br /&gt;
&lt;br /&gt;
Each Test Step (the smallest unit in GUIdancer) consists of three pieces of information chosen from interactive dialogs: the GUI-component to be tested, the action to execute on this component, and the parameters (or data) the action requires. A Test Step to enter “hello” into a text field would look like this:&lt;br /&gt;
&lt;br /&gt;
 * GUI-component: Text field&lt;br /&gt;
 * Action: Enter Text&lt;br /&gt;
 * Parameter: Hello&lt;br /&gt;
&lt;br /&gt;
===4. SeliniumHQ===&lt;br /&gt;
[http://seleniumhq.org/ Selenium] is a robust set of tools that supports rapid development of test automation for web-based applications. Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.&lt;br /&gt;
'''How Selenium Works'''&lt;br /&gt;
&lt;br /&gt;
[[Image:selenium.png|650px|thumb|center|Figure 1:[http://seleniumhq.org/about/how.html How Selenium Works]]]&lt;br /&gt;
&lt;br /&gt;
===6. Cucumber:===&lt;br /&gt;
Cucumber is a tool that can execute plain-text functional descriptions as automated tests. The language that Cucumber understands is called [http://wiki.github.com/aslakhellesoy/cucumber/gherkin Gherkin]. Here is an example:&lt;br /&gt;
 Feature: Search courses&lt;br /&gt;
  In order to ensure better utilization of courses&lt;br /&gt;
  Potential students should be able to search for courses&lt;br /&gt;
&lt;br /&gt;
  Scenario: Search by topic&lt;br /&gt;
    Given there are 240 courses which do not have the topic &amp;quot;biology&amp;quot;&lt;br /&gt;
    And there are 2 courses A001, B205 that each have &amp;quot;biology&amp;quot; as one of the topics&lt;br /&gt;
    When I search for &amp;quot;biology&amp;quot;&lt;br /&gt;
    Then I should see the following courses:&lt;br /&gt;
      | Course code |&lt;br /&gt;
      | A001        |&lt;br /&gt;
      | B205        |&lt;br /&gt;
&lt;br /&gt;
Cucumber itself is written in Ruby, but it can be used to “test” code written in Ruby or other languages including but not limited to Java, C# and Python. Cucumber only requires minimal use of Ruby programming and Ruby is easy, so don’t be afraid even if the code you’re developing in is not Ruby.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In summary, GUI testing is a complicated task. Systematic test design helps us to focus on the important tests and gives us an objective way of addressing risks. Tools are appropriate for many but not all tests and a staged approach to testing enables us to identify which tests to automate much more easily. Tools can therefore be used to detect errors pro-actively as well as to execute regression tests. &lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[1] http://c2.com/cgi/wiki?GuiTesting &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://chandlerproject.org/Journal/AutomatedGuiTestingProject &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://en.wikipedia.org/wiki/GUI_software_testing &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://www.open-xchange.com/wiki/index.php?title=Automated_GUI_Tests &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://agilistas.org/presentations/codecamp06/ &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.ranorex.com/?gclid=CNvA_YnesJ0CFchW2godpT5YrQ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.gerrardconsulting.com/GUI/TestGui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://www.slideshare.net/rpires/GUI-Test-Patterns &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://en.wikipedia.org/wiki/List_of_GUI_testing_tools &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://www.junit.org/taxonomy/term/6 &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.cs.umd.edu/~atif/papers/MemonSQW2000.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://www.testingfaqs.org/t-gui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.springerlink.com/content/d08681k5081553r7/ &amp;lt;br&amp;gt;&lt;br /&gt;
[14] http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Rip &amp;lt;br&amp;gt;&lt;br /&gt;
[15] http://seleniumhq.org/ &amp;lt;br&amp;gt;&lt;br /&gt;
[16] http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=25608</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 10 mk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=25608"/>
		<updated>2009-10-11T00:28:30Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* 1. An Ontology-Based Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2009.92] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=GUI Testing Frameworks=&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Most software developed in recent years has a graphical user interface (GUI). The only way for the end-user to interact with the software application is through the GUI. Hence, acceptance and system testing of the software requires GUI testing.  In this wiki we aim at covering the different approaches, including patterns and tools for GUI testing.&lt;br /&gt;
&lt;br /&gt;
==Some problems of GUI testing==&lt;br /&gt;
*GUIs are tested manually, often by the developers themselves. This is very unreliable and expensive. For new GUIs or those being significantly changed, quality is low, and failures at integration time or during user acceptance tests are common. &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Data_scraping#Screen_scraping ScreenScrapper] based GUI test does a nice job but to a certain extent. Even though they are cheap, the problem with these tests is that if you change the screen layout all existing tests become useless, which means you have no [http://en.wikipedia.org/wiki/Regression_testing regression tests]. Another problem here is that test creators can't start writing tests till the GUIs are finished. Example: [http://en.wikipedia.org/wiki/Test_harness test harnesses], [http://www.citeulike.org/user/V/article/2682599 capture/replay tools], and [http://en.wikipedia.org/wiki/Model-based_testing model-based methods]&lt;br /&gt;
*The user has an extremely wide choice of actions. The user could click on any pixel on the screen. Using manual tools to mimic the   usage of the GUI only provides limited testing.&lt;br /&gt;
*There are tools which try to capture [http://en.wikipedia.org/wiki/GUI_widget GUI widgets] rather than mouse coordinates. These tools, however, require a significant amount of manual effort to be effective, including developing test scripts and manually detecting failures.Modifications to the GUI require changes to the scripts as well. Example: [http://en.wikipedia.org/wiki/HP_WinRunner Winrunner], [http://www.testingfaqs.org/t-gui.html#Abbot Abbot], and [http://www-01.ibm.com/software/awdtools/tester/robot/index.html Rational Robot]&lt;br /&gt;
&lt;br /&gt;
==Approaches for GUI testing==&lt;br /&gt;
&lt;br /&gt;
===1. An Ontology-Based Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2009.92]===&lt;br /&gt;
&lt;br /&gt;
In the approach an GUI testing [http://en.wikipedia.org/wiki/Ontology ontology] is established by analyzing the source code with [http://en.wikipedia.org/wiki/Reverse_engineering reverse engineering] techniques. Then from the user experience the generation rules are extracted to create test cases. GUI testing is proposed for the purpose of making use of the knowledge provided by GUI systems and testers’ experience. GUI ontology is used to store potential&lt;br /&gt;
information in a GUI system, while test case generation rules extract useful information from testers’ experience. In a word, ontology based GUI testing is a new branch of software testing, which not only takes the knowledge intensive features of GUI testing into account, but also sufficiently make use of them.&lt;br /&gt;
thi&lt;br /&gt;
&lt;br /&gt;
===2. Automation of GUI testing using a model-driven approach [http://portal.acm.org/citation.cfm?id=1138932]===&lt;br /&gt;
In this approach the generated test cases are based on [http://en.wikipedia.org/wiki/Unified_Modeling_Language Unified Modelling Language]. This introduces data into the UML model via the [http://portal.acm.org/citation.cfm?id=62964 Category-Partition method]. The functions that have to be tested are specified using the [http://en.wikipedia.org/wiki/Use_case use cases] and [http://en.wikipedia.org/wiki/Activity_diagram activity diagrams]. This also specifies how they have to be tested. A combination like this has the potential to generate large number of test cases.The test can be managed in two ways.Firstly the Category-partitioned data which allows the designer full control over the possible and impossible paths for the system to run.Secondly automation allows different configuration for both data and graph coverage.Using all this we can generate test scripts which can be used for GUI testing.&lt;br /&gt;
&lt;br /&gt;
[[Image:usecase.png|450px|thumb|center|Figure 1:Example Use Case Diagram]]&lt;br /&gt;
&lt;br /&gt;
===3. Plan Generation GUI testing [http://www.cs.virginia.edu/~soffa/research/SE/AIPS00.pdf]===&lt;br /&gt;
This is based on the AI techniques, for partially automating GUI testing.In this method of testing the tester specifies the initial and the final goal states for the users of the system.The automated system produces a set of sequences or plans which will start with the initial state and end with the final state specified by the user. Each of the plans generated will represent a test case of a user of the system.&lt;br /&gt;
&lt;br /&gt;
===4. A practical approach to testing GUI systems [http://www.springerlink.com/content/d08681k5081553r7/]===&lt;br /&gt;
In this approach, GUI is divided into two tires. One the component and other the system. [http://en.wikipedia.org/wiki/Control_flow_graph Flow graphs] will be created for each GUI component. The flow graph represents a set of preconditions, event sequences and post conditions of the corresponding component. On the system tire we build a viewpoint by integrating the components of the system. This will ensure that the components are working fine and are interacting as required. This is a simple, effective and practical method of performing GUI testing.&lt;br /&gt;
&lt;br /&gt;
===5. A Dynamic Partitioning Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94]===&lt;br /&gt;
The above approaches specify how to generate the test cases without actually specifying how to run them. This approach specifies how the test cases have to run in order to make GUI testing effective and useful. Th GUI primitive actions are partitioned into two classes. They are prioritized primitive actions and non-prioritized primitive actions.  This further divides the testing into two stages which contains two feed back loops.The first stage prioritizes primitive actions and the second stage selects and performs prioritized primitive actions. The first feedback loop is local and occurs in the second stage, which adjusts the memberships of primitive actions after they are performed. The second feedback loop is global and occurs between the first and second stages. It switches GUI testing from the second stage to the first stage when no prioritized primitive actions are available. The two testing experiments with real GUI applications show that the proposed dynamic partitioning approach can really work in practice and may significantly outperform the random testing approach.&lt;br /&gt;
&lt;br /&gt;
==Tools for GUI testing==&lt;br /&gt;
===1. GUITAR===&lt;br /&gt;
The [http://guitar.sourceforge.net/ GUITAR] (GUI Testing frAmewoRk) project helps in simplifying GUI testing by automatically creating test cases that intelligently challenge a GUI's functionality. It currently contains a rich collection of plug-ins that may be used to test an application through its graphical user interface. For example, the “test case generator” plug-in, a tester can automatically generate various types of test cases for the Application Under Test (AUT);  the “replayer” plug-in may be used to execute these test cases on the AUT automatically; during the various development phases of the AUT, the “regression tester” plug-in can be used to efficiently perform regression testing on the AUT.&lt;br /&gt;
&lt;br /&gt;
[[Image:guitar.jpg|650px|thumb|center|figure 1:[http://guitar.sourceforge.net/ Guitar Framework]]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to test the GUI of the AUT, the tester has to perform a certain set of steps. These steps are detailed below&lt;br /&gt;
*Initialize configurations in GUITAR for the AUT. This can be done using the below window&lt;br /&gt;
[[Image:guitar1.jpg|650px|thumb|center|figure 2:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Initialise Preferences window for initializing the application type]]]&lt;br /&gt;
&lt;br /&gt;
*Replay the Testcases&lt;br /&gt;
[[Image:guitar2.jpg|650px|thumb|center|figure 3:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Replayer Testcase execution]]]&lt;br /&gt;
&lt;br /&gt;
*Coverage Evaluation&lt;br /&gt;
Execute the coverage evaluator to analyze the coverage generated when the testcases were executed on the instrumented AUT. A coverage report is generated by the instrumented code, when the testcases are replayed on it. The coverage evaluator analyzes this report and a summary report is generated.&lt;br /&gt;
[[Image:guitar3.jpg|650px|thumb|center|figure 4:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Coverager Running the coverage evaluator]]]&lt;br /&gt;
&lt;br /&gt;
===2. Planning Assisted Tester for grapHical user interface Systems (PATHS)===&lt;br /&gt;
This is based on the event interaction sequences. This tests the GUI software using interactions which are mostly likely to be used in actual scenarios. This accepts an operator, initial state and a final state, with which the planning sequence produces a series of sequences which transforms the system form the initial state to the final state. The GUI tester can use this to generate interactions sequences by specifying the final state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===3. GUIdancer===&lt;br /&gt;
[http://www.bredex.de/en/guidancer/first.html GUIdancer] is an [http://en.wikipedia.org/wiki/Eclipse_(software) Eclipse]-based automated GUI test-tool which runs as a standalone application or as an Eclipse Plugin.  &lt;br /&gt;
&lt;br /&gt;
GUIdancer is different from other GUI test-tools because automated tests can be written before the Application Under Test (AUT) is ready. This means that GUIdancer is not a tool which tests an application by recording user actions and replaying them. Tests can be created from the requirements without access to the AUT, and involve no programming, script or code. GUIdancer tests can be created, run and maintained without support from automation experts.&lt;br /&gt;
&lt;br /&gt;
Each Test Step (the smallest unit in GUIdancer) consists of three pieces of information chosen from interactive dialogs: the GUI-component to be tested, the action to execute on this component, and the parameters (or data) the action requires. A Test Step to enter “hello” into a text field would look like this:&lt;br /&gt;
&lt;br /&gt;
 * GUI-component: Text field&lt;br /&gt;
 * Action: Enter Text&lt;br /&gt;
 * Parameter: Hello&lt;br /&gt;
&lt;br /&gt;
===4. SeliniumHQ===&lt;br /&gt;
[http://seleniumhq.org/ Selenium] is a robust set of tools that supports rapid development of test automation for web-based applications. Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.&lt;br /&gt;
'''How Selenium Works'''&lt;br /&gt;
&lt;br /&gt;
[[Image:selenium.png|650px|thumb|center|Figure 1:[http://seleniumhq.org/about/how.html How Selenium Works]]]&lt;br /&gt;
&lt;br /&gt;
===6. Cucumber:===&lt;br /&gt;
Cucumber is a tool that can execute plain-text functional descriptions as automated tests. The language that Cucumber understands is called [http://wiki.github.com/aslakhellesoy/cucumber/gherkin Gherkin]. Here is an example:&lt;br /&gt;
 Feature: Search courses&lt;br /&gt;
  In order to ensure better utilization of courses&lt;br /&gt;
  Potential students should be able to search for courses&lt;br /&gt;
&lt;br /&gt;
  Scenario: Search by topic&lt;br /&gt;
    Given there are 240 courses which do not have the topic &amp;quot;biology&amp;quot;&lt;br /&gt;
    And there are 2 courses A001, B205 that each have &amp;quot;biology&amp;quot; as one of the topics&lt;br /&gt;
    When I search for &amp;quot;biology&amp;quot;&lt;br /&gt;
    Then I should see the following courses:&lt;br /&gt;
      | Course code |&lt;br /&gt;
      | A001        |&lt;br /&gt;
      | B205        |&lt;br /&gt;
&lt;br /&gt;
Cucumber itself is written in Ruby, but it can be used to “test” code written in Ruby or other languages including but not limited to Java, C# and Python. Cucumber only requires minimal use of Ruby programming and Ruby is easy, so don’t be afraid even if the code you’re developing in is not Ruby.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In summary, GUI testing is a complicated task. Systematic test design helps us to focus on the important tests and gives us an objective way of addressing risks. Tools are appropriate for many but not all tests and a staged approach to testing enables us to identify which tests to automate much more easily. Tools can therefore be used to detect errors pro-actively as well as to execute regression tests. &lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[1] http://c2.com/cgi/wiki?GuiTesting &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://chandlerproject.org/Journal/AutomatedGuiTestingProject &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://en.wikipedia.org/wiki/GUI_software_testing &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://www.open-xchange.com/wiki/index.php?title=Automated_GUI_Tests &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://agilistas.org/presentations/codecamp06/ &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.ranorex.com/?gclid=CNvA_YnesJ0CFchW2godpT5YrQ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.gerrardconsulting.com/GUI/TestGui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://www.slideshare.net/rpires/GUI-Test-Patterns &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://en.wikipedia.org/wiki/List_of_GUI_testing_tools &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://www.junit.org/taxonomy/term/6 &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.cs.umd.edu/~atif/papers/MemonSQW2000.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://www.testingfaqs.org/t-gui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.springerlink.com/content/d08681k5081553r7/ &amp;lt;br&amp;gt;&lt;br /&gt;
[14] http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Rip &amp;lt;br&amp;gt;&lt;br /&gt;
[15] http://seleniumhq.org/ &amp;lt;br&amp;gt;&lt;br /&gt;
[16] http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=25451</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 10 mk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=25451"/>
		<updated>2009-10-10T02:44:18Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Some problems of GUI testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=GUI Testing Frameworks=&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Most software developed in recent years has a graphical user interface (GUI). The only way for the end-user to interact with the software application is through the GUI. Hence, acceptance and system testing of the software requires GUI testing.  In this wiki we aim at covering the different approaches, including patterns and tools for GUI testing.&lt;br /&gt;
&lt;br /&gt;
==Some problems of GUI testing==&lt;br /&gt;
*GUIs are tested manually, often by the developers themselves. This is very unreliable and expensive. For new GUIs or those being significantly changed, quality is low, and failures at integration time or during user acceptance tests are common. &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Data_scraping#Screen_scraping ScreenScrapper] based GUI test does a nice job but to a certain extent. Even though they are cheap, the problem with these tests are that if you change the screen layout all existing tests become useless, which means you have no [http://en.wikipedia.org/wiki/Regression_testing regression tests]. Another problem here is that test creators can't start writing tests ill the GUIs are finished. Example: [http://en.wikipedia.org/wiki/Test_harness test harnesses], [http://www.citeulike.org/user/V/article/2682599 capture/replay tools], and [http://en.wikipedia.org/wiki/Model-based_testing model-based methods]&lt;br /&gt;
*The user has an extremely wide choice of actions. The user could click on any pixel on the screen using manual tools to mimic the   usage of the GUI, only provides limited testing.&lt;br /&gt;
*There are tools which try to capture [http://en.wikipedia.org/wiki/GUI_widget GUI widgets] rather than mouse coordinates. These tools, however, require a significant amount of manual effort to be effective, including developing test scripts and manually detecting failures.Modifications to the GUI require changes to the scripts as well. Example: [http://en.wikipedia.org/wiki/HP_WinRunner Winrunner], [http://www.testingfaqs.org/t-gui.html#Abbot Abbot], and [http://www-01.ibm.com/software/awdtools/tester/robot/index.html Rational Robot]&lt;br /&gt;
&lt;br /&gt;
==Approaches for GUI testing==&lt;br /&gt;
&lt;br /&gt;
===1. An Ontology-Based Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2009.92]===&lt;br /&gt;
&lt;br /&gt;
In the approach an GUI testing [http://en.wikipedia.org/wiki/Ontology ontology] is is established by analyzing the source code with [http://en.wikipedia.org/wiki/Reverse_engineering reverse engineering] techniques. Then from the user experience the generation rules are extracted to create test cases. GUI testing is proposed for the purpose of making use of the knowledge provided by GUI systems and testers’ experience. GUI ontology is used to store potential&lt;br /&gt;
information in a GUI system, while test case generation rules extract useful information from testers’ experience. In a word, ontology based GUI testing is a new branch of software testing, which not only takes the knowledge intensive features of GUI testing into account, but also sufficiently make use of them.&lt;br /&gt;
&lt;br /&gt;
===2. Automation of GUI testing using a model-driven approach [http://portal.acm.org/citation.cfm?id=1138932]===&lt;br /&gt;
In this approach the generates test cases based on [http://en.wikipedia.org/wiki/Unified_Modeling_Language Unified Modelling Language]. This introduces data into the UML model via the [http://portal.acm.org/citation.cfm?id=62964 Category-Partition method]. The functions that have to be tested are specified using the [http://en.wikipedia.org/wiki/Use_case use cases] and [http://en.wikipedia.org/wiki/Activity_diagram activity diagrams]. This also specifies how they have to be tested. A combination like this has the potential to generate large number of test cases.The test can be managed in two ways.Firstly the Category-partitioned data which allows the designer full control over the possible and impossible paths for the system to run.Secondly automation allows different configuration for both data and graph coverage.Using all this we can generate test scripts which can be used for GUI testing.&lt;br /&gt;
&lt;br /&gt;
[[Image:usecase.png|450px|thumb|center|Figure 1:Example Use Case Diagram]]&lt;br /&gt;
&lt;br /&gt;
===3. Plan Generation GUI testing [http://www.cs.virginia.edu/~soffa/research/SE/AIPS00.pdf]===&lt;br /&gt;
This is based on the AI techniques, for partially automating GUI testing.In this method of the testing the tester specifies the initial and the final goal states for the users of the system.The automated system produces a set of sequences or plans which will start with the initial state and end with the final state specified by the user. Each of the plans generated will represent a test case of a user of the system&lt;br /&gt;
&lt;br /&gt;
===4. A practical approach to testing GUI systems [http://www.springerlink.com/content/d08681k5081553r7/]===&lt;br /&gt;
In this approach, GUI is divided into two tires. One the component and other the system. [http://en.wikipedia.org/wiki/Control_flow_graph Flow graphs] will be created for each GUI component. The flow graph represents a set of preconditions, event sequences and post conditions of the corresponding component. On the system tire we build a viewpoint by integrating the components of the system. This will ensure that the components are working fine and are interacting as required. This is a simple, effective and practical method of performing GUI testing.&lt;br /&gt;
&lt;br /&gt;
===5. A Dynamic Partitioning Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94]===&lt;br /&gt;
The above approaches specify how to generate the test cases without actually specifying how to run them. This approach specifies how the test cases have to run in order to make GUI testing effective and useful. Th GUI primitive actions are partitioned into two classes. They are prioritized primitive actions and non-prioritized primitive actions.  This further divides the testing into two stages which contains two feed back loops.The first stage prioritizes primitive actions and the second stage selects and performs prioritized primitive actions. The first feedback loop is local and occurs in the second stage, which adjusts the memberships of primitive actions after they are performed. The second feedback loop is global and occurs between the first and second stages. It switches GUI testing from the second stage to the first stage upon no prioritized primitive actions are available. The two testing experiments with real GUI applications show that the proposed dynamic partitioning approach can really work in practice and may significantly outperform the random testing approach.&lt;br /&gt;
&lt;br /&gt;
==Tools for GUI testing==&lt;br /&gt;
===1. GUITAR===&lt;br /&gt;
The [http://guitar.sourceforge.net/ GUITAR] (GUI Testing frAmewoRk) project which helps in simplifying GUI testing by automatically creating test cases that intelligently challenge a GUI's functionality. It currently contains a rich collection of plug-ins that may be used to test an application through its graphical user interface. For example, the “test case generator” plug-in, a tester can automatically generate various types of test cases for the Application Under Test (AUT);  the “replayer” plug-in may be used to execute these test cases on the AUT automatically; during the various development phases of the AUT, the “regression tester” plug-in can be used to efficiently perform regression testing on the AUT.&lt;br /&gt;
&lt;br /&gt;
[[Image:guitar.jpg|650px|thumb|center|figure 1:[http://guitar.sourceforge.net/ Guitar Framework]]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to test the GUI of the AUT, the tester has to perform a certain set of steps. These steps are detailed below&lt;br /&gt;
*Initialize configurations in GUITAR for the AUT. This can be done using the below window&lt;br /&gt;
[[Image:guitar1.jpg|650px|thumb|center|figure 2:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Initialise Preferences window for initializing the application type]]]&lt;br /&gt;
&lt;br /&gt;
*Replay the Testcases&lt;br /&gt;
[[Image:guitar2.jpg|650px|thumb|center|figure 3:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Replayer Testcase execution]]]&lt;br /&gt;
&lt;br /&gt;
*Coverage Evaluation&lt;br /&gt;
Execute the coverage evaluator to analyze the coverage generated when the testcases were executed on the instrumented AUT. A coverage report is generated by the instrumented code, when the testcases are replayed on it. The coverage evaluator analyzes this report and a summary report is generated.&lt;br /&gt;
[[Image:guitar3.jpg|650px|thumb|center|figure 4:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Coverager Running the coverage evaluator]]]&lt;br /&gt;
&lt;br /&gt;
===2. Planning Assisted Tester for grapHical user interface Systems (PATHS)===&lt;br /&gt;
This is based on the event interaction sequences. This tests the GUI software using interactions which are mostly likely to be used in actual scenarios. This accepts an operator, initial state and a final state, with which the planning sequence produces a series of sequences which transforms the system form the initial state to the final state. The GUI tester can use this to generate interactions sequences by specifying the final state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===3. GUIdancer===&lt;br /&gt;
[http://www.bredex.de/en/guidancer/first.html GUIdancer] is an [http://en.wikipedia.org/wiki/Eclipse_(software) Eclipse]-based automated GUI test-tool which runs as a standalone application or as an Eclipse Plugin.  &lt;br /&gt;
&lt;br /&gt;
GUIdancer is different from other GUI test-tools because automated tests can be written before the Application Under Test (AUT) is ready. This means that GUIdancer is not a tool which tests an application by recording user actions and replaying them. Tests can be created from the requirements without access to the AUT, and involve no programming, script or code. GUIdancer tests can be created, run and maintained without support from automation experts.&lt;br /&gt;
&lt;br /&gt;
Each Test Step (the smallest unit in GUIdancer) consists of three pieces of information chosen from interactive dialogs: the GUI-component to be tested, the action to execute on this component, and the parameters (or data) the action requires. A Test Step to enter “hello” into a text field would look like this:&lt;br /&gt;
&lt;br /&gt;
 * GUI-component: Text field&lt;br /&gt;
 * Action: Enter Text&lt;br /&gt;
 * Parameter: Hello&lt;br /&gt;
&lt;br /&gt;
===4. SeliniumHQ===&lt;br /&gt;
[http://seleniumhq.org/ Selenium] is a robust set of tools that supports rapid development of test automation for web-based applications. Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.&lt;br /&gt;
'''How Selenium Works'''&lt;br /&gt;
&lt;br /&gt;
[[Image:selenium.png|650px|thumb|center|Figure 1:[http://seleniumhq.org/about/how.html How Selenium Works]]]&lt;br /&gt;
&lt;br /&gt;
===6. Cucumber:===&lt;br /&gt;
Cucumber is a tool that can execute plain-text functional descriptions as automated tests. The language that Cucumber understands is called [http://wiki.github.com/aslakhellesoy/cucumber/gherkin Gherkin]. Here is an example:&lt;br /&gt;
 Feature: Search courses&lt;br /&gt;
  In order to ensure better utilization of courses&lt;br /&gt;
  Potential students should be able to search for courses&lt;br /&gt;
&lt;br /&gt;
  Scenario: Search by topic&lt;br /&gt;
    Given there are 240 courses which do not have the topic &amp;quot;biology&amp;quot;&lt;br /&gt;
    And there are 2 courses A001, B205 that each have &amp;quot;biology&amp;quot; as one of the topics&lt;br /&gt;
    When I search for &amp;quot;biology&amp;quot;&lt;br /&gt;
    Then I should see the following courses:&lt;br /&gt;
      | Course code |&lt;br /&gt;
      | A001        |&lt;br /&gt;
      | B205        |&lt;br /&gt;
&lt;br /&gt;
Cucumber itself is written in Ruby, but it can be used to “test” code written in Ruby or other languages including but not limited to Java, C# and Python. Cucumber only requires minimal use of Ruby programming and Ruby is easy, so don’t be afraid even if the code you’re developing in is not Ruby.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In summary, GUI testing is a complicated task. Systematic test design helps us to focus on the important tests and gives us an objective way of addressing risks. Tools are appropriate for many but not all tests and a staged approach to testing enables us to identify which tests to automate much more easily. Tools can therefore be used to detect errors pro-actively as well as to execute regression tests. &lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[1] http://c2.com/cgi/wiki?GuiTesting &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://chandlerproject.org/Journal/AutomatedGuiTestingProject &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://en.wikipedia.org/wiki/GUI_software_testing &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://www.open-xchange.com/wiki/index.php?title=Automated_GUI_Tests &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://agilistas.org/presentations/codecamp06/ &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.ranorex.com/?gclid=CNvA_YnesJ0CFchW2godpT5YrQ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.gerrardconsulting.com/GUI/TestGui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://www.slideshare.net/rpires/GUI-Test-Patterns &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://en.wikipedia.org/wiki/List_of_GUI_testing_tools &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://www.junit.org/taxonomy/term/6 &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.cs.umd.edu/~atif/papers/MemonSQW2000.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://www.testingfaqs.org/t-gui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.springerlink.com/content/d08681k5081553r7/ &amp;lt;br&amp;gt;&lt;br /&gt;
[14] http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Rip &amp;lt;br&amp;gt;&lt;br /&gt;
[15] http://seleniumhq.org/ &amp;lt;br&amp;gt;&lt;br /&gt;
[16] http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=25449</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 10 mk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_10_mk&amp;diff=25449"/>
		<updated>2009-10-10T02:44:01Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Some problems of GUI testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=GUI Testing Frameworks=&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Most software developed in recent years has a graphical user interface (GUI). The only way for the end-user to interact with the software application is through the GUI. Hence, acceptance and system testing of the software requires GUI testing.  In this wiki we aim at covering the different approaches, including patterns and tools for GUI testing.&lt;br /&gt;
&lt;br /&gt;
==Some problems of GUI testing==&lt;br /&gt;
*GUIs are tested manually, often by the developers themselves. This is very unreliable and expensive. For new GUIs or those being significantly changed, quality is low, and failures at integration time or during user acceptance tests are common. &lt;br /&gt;
*[http://en.wikipedia.org/wiki/Data_scraping#Screen_scraping ScreenScrapper] based GUI test does a nice job but to a certain extent. Even though they are cheap, the problem with these tests are that if you change the screen layout all existing tests become useless, which means you have no [http://en.wikipedia.org/wiki/Regression_testing regression tests]. Another problem here is that test creators can't start writing tests ill the GUIs are finished. Example: [http://en.wikipedia.org/wiki/Test_harness test harnesses], [http://www.citeulike.org/user/V/article/2682599 capture/replay tools], and [http://en.wikipedia.org/wiki/Model-based_testing model-based methods]&lt;br /&gt;
*The user has an extremely wide choice of actions. The user could click on any pixel on the screen using manual tools to mimic the   usage of the GUI, only provides limited testing.&lt;br /&gt;
*There are tools which try to capture [http://en.wikipedia.org/wiki/GUI_widget GUI widgets] rather than mouse coordinates. These tools, however, require a significant amount of manual effort to be effective, including developing test scripts and manually detecting failures.Modifications to the GUI require changes to the scripts as well. Example: [http://en.wikipedia.org/wiki/HP_WinRunner Winrunner], [http://www.testingfaqs.org/t-gui.html#Abbot Abbot], and [http://www-01.ibm.com/software/awdtools/tester/robot/index.html Rational Robot]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
h&lt;br /&gt;
&lt;br /&gt;
==Approaches for GUI testing==&lt;br /&gt;
&lt;br /&gt;
===1. An Ontology-Based Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2009.92]===&lt;br /&gt;
&lt;br /&gt;
In the approach an GUI testing [http://en.wikipedia.org/wiki/Ontology ontology] is is established by analyzing the source code with [http://en.wikipedia.org/wiki/Reverse_engineering reverse engineering] techniques. Then from the user experience the generation rules are extracted to create test cases. GUI testing is proposed for the purpose of making use of the knowledge provided by GUI systems and testers’ experience. GUI ontology is used to store potential&lt;br /&gt;
information in a GUI system, while test case generation rules extract useful information from testers’ experience. In a word, ontology based GUI testing is a new branch of software testing, which not only takes the knowledge intensive features of GUI testing into account, but also sufficiently make use of them.&lt;br /&gt;
&lt;br /&gt;
===2. Automation of GUI testing using a model-driven approach [http://portal.acm.org/citation.cfm?id=1138932]===&lt;br /&gt;
In this approach the generates test cases based on [http://en.wikipedia.org/wiki/Unified_Modeling_Language Unified Modelling Language]. This introduces data into the UML model via the [http://portal.acm.org/citation.cfm?id=62964 Category-Partition method]. The functions that have to be tested are specified using the [http://en.wikipedia.org/wiki/Use_case use cases] and [http://en.wikipedia.org/wiki/Activity_diagram activity diagrams]. This also specifies how they have to be tested. A combination like this has the potential to generate large number of test cases.The test can be managed in two ways.Firstly the Category-partitioned data which allows the designer full control over the possible and impossible paths for the system to run.Secondly automation allows different configuration for both data and graph coverage.Using all this we can generate test scripts which can be used for GUI testing.&lt;br /&gt;
&lt;br /&gt;
[[Image:usecase.png|450px|thumb|center|Figure 1:Example Use Case Diagram]]&lt;br /&gt;
&lt;br /&gt;
===3. Plan Generation GUI testing [http://www.cs.virginia.edu/~soffa/research/SE/AIPS00.pdf]===&lt;br /&gt;
This is based on the AI techniques, for partially automating GUI testing.In this method of the testing the tester specifies the initial and the final goal states for the users of the system.The automated system produces a set of sequences or plans which will start with the initial state and end with the final state specified by the user. Each of the plans generated will represent a test case of a user of the system&lt;br /&gt;
&lt;br /&gt;
===4. A practical approach to testing GUI systems [http://www.springerlink.com/content/d08681k5081553r7/]===&lt;br /&gt;
In this approach, GUI is divided into two tires. One the component and other the system. [http://en.wikipedia.org/wiki/Control_flow_graph Flow graphs] will be created for each GUI component. The flow graph represents a set of preconditions, event sequences and post conditions of the corresponding component. On the system tire we build a viewpoint by integrating the components of the system. This will ensure that the components are working fine and are interacting as required. This is a simple, effective and practical method of performing GUI testing.&lt;br /&gt;
&lt;br /&gt;
===5. A Dynamic Partitioning Approach for GUI Testing [http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94]===&lt;br /&gt;
The above approaches specify how to generate the test cases without actually specifying how to run them. This approach specifies how the test cases have to run in order to make GUI testing effective and useful. Th GUI primitive actions are partitioned into two classes. They are prioritized primitive actions and non-prioritized primitive actions.  This further divides the testing into two stages which contains two feed back loops.The first stage prioritizes primitive actions and the second stage selects and performs prioritized primitive actions. The first feedback loop is local and occurs in the second stage, which adjusts the memberships of primitive actions after they are performed. The second feedback loop is global and occurs between the first and second stages. It switches GUI testing from the second stage to the first stage upon no prioritized primitive actions are available. The two testing experiments with real GUI applications show that the proposed dynamic partitioning approach can really work in practice and may significantly outperform the random testing approach.&lt;br /&gt;
&lt;br /&gt;
==Tools for GUI testing==&lt;br /&gt;
===1. GUITAR===&lt;br /&gt;
The [http://guitar.sourceforge.net/ GUITAR] (GUI Testing frAmewoRk) project which helps in simplifying GUI testing by automatically creating test cases that intelligently challenge a GUI's functionality. It currently contains a rich collection of plug-ins that may be used to test an application through its graphical user interface. For example, the “test case generator” plug-in, a tester can automatically generate various types of test cases for the Application Under Test (AUT);  the “replayer” plug-in may be used to execute these test cases on the AUT automatically; during the various development phases of the AUT, the “regression tester” plug-in can be used to efficiently perform regression testing on the AUT.&lt;br /&gt;
&lt;br /&gt;
[[Image:guitar.jpg|650px|thumb|center|figure 1:[http://guitar.sourceforge.net/ Guitar Framework]]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to test the GUI of the AUT, the tester has to perform a certain set of steps. These steps are detailed below&lt;br /&gt;
*Initialize configurations in GUITAR for the AUT. This can be done using the below window&lt;br /&gt;
[[Image:guitar1.jpg|650px|thumb|center|figure 2:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Initialise Preferences window for initializing the application type]]]&lt;br /&gt;
&lt;br /&gt;
*Replay the Testcases&lt;br /&gt;
[[Image:guitar2.jpg|650px|thumb|center|figure 3:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Replayer Testcase execution]]]&lt;br /&gt;
&lt;br /&gt;
*Coverage Evaluation&lt;br /&gt;
Execute the coverage evaluator to analyze the coverage generated when the testcases were executed on the instrumented AUT. A coverage report is generated by the instrumented code, when the testcases are replayed on it. The coverage evaluator analyzes this report and a summary report is generated.&lt;br /&gt;
[[Image:guitar3.jpg|650px|thumb|center|figure 4:[http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Coverager Running the coverage evaluator]]]&lt;br /&gt;
&lt;br /&gt;
===2. Planning Assisted Tester for grapHical user interface Systems (PATHS)===&lt;br /&gt;
This is based on the event interaction sequences. This tests the GUI software using interactions which are mostly likely to be used in actual scenarios. This accepts an operator, initial state and a final state, with which the planning sequence produces a series of sequences which transforms the system form the initial state to the final state. The GUI tester can use this to generate interactions sequences by specifying the final state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===3. GUIdancer===&lt;br /&gt;
[http://www.bredex.de/en/guidancer/first.html GUIdancer] is an [http://en.wikipedia.org/wiki/Eclipse_(software) Eclipse]-based automated GUI test-tool which runs as a standalone application or as an Eclipse Plugin.  &lt;br /&gt;
&lt;br /&gt;
GUIdancer is different from other GUI test-tools because automated tests can be written before the Application Under Test (AUT) is ready. This means that GUIdancer is not a tool which tests an application by recording user actions and replaying them. Tests can be created from the requirements without access to the AUT, and involve no programming, script or code. GUIdancer tests can be created, run and maintained without support from automation experts.&lt;br /&gt;
&lt;br /&gt;
Each Test Step (the smallest unit in GUIdancer) consists of three pieces of information chosen from interactive dialogs: the GUI-component to be tested, the action to execute on this component, and the parameters (or data) the action requires. A Test Step to enter “hello” into a text field would look like this:&lt;br /&gt;
&lt;br /&gt;
 * GUI-component: Text field&lt;br /&gt;
 * Action: Enter Text&lt;br /&gt;
 * Parameter: Hello&lt;br /&gt;
&lt;br /&gt;
===4. SeliniumHQ===&lt;br /&gt;
[http://seleniumhq.org/ Selenium] is a robust set of tools that supports rapid development of test automation for web-based applications. Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.&lt;br /&gt;
'''How Selenium Works'''&lt;br /&gt;
&lt;br /&gt;
[[Image:selenium.png|650px|thumb|center|Figure 1:[http://seleniumhq.org/about/how.html How Selenium Works]]]&lt;br /&gt;
&lt;br /&gt;
===6. Cucumber:===&lt;br /&gt;
Cucumber is a tool that can execute plain-text functional descriptions as automated tests. The language that Cucumber understands is called [http://wiki.github.com/aslakhellesoy/cucumber/gherkin Gherkin]. Here is an example:&lt;br /&gt;
 Feature: Search courses&lt;br /&gt;
  In order to ensure better utilization of courses&lt;br /&gt;
  Potential students should be able to search for courses&lt;br /&gt;
&lt;br /&gt;
  Scenario: Search by topic&lt;br /&gt;
    Given there are 240 courses which do not have the topic &amp;quot;biology&amp;quot;&lt;br /&gt;
    And there are 2 courses A001, B205 that each have &amp;quot;biology&amp;quot; as one of the topics&lt;br /&gt;
    When I search for &amp;quot;biology&amp;quot;&lt;br /&gt;
    Then I should see the following courses:&lt;br /&gt;
      | Course code |&lt;br /&gt;
      | A001        |&lt;br /&gt;
      | B205        |&lt;br /&gt;
&lt;br /&gt;
Cucumber itself is written in Ruby, but it can be used to “test” code written in Ruby or other languages including but not limited to Java, C# and Python. Cucumber only requires minimal use of Ruby programming and Ruby is easy, so don’t be afraid even if the code you’re developing in is not Ruby.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In summary, GUI testing is a complicated task. Systematic test design helps us to focus on the important tests and gives us an objective way of addressing risks. Tools are appropriate for many but not all tests and a staged approach to testing enables us to identify which tests to automate much more easily. Tools can therefore be used to detect errors pro-actively as well as to execute regression tests. &lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[1] http://c2.com/cgi/wiki?GuiTesting &amp;lt;br&amp;gt;&lt;br /&gt;
[2] http://chandlerproject.org/Journal/AutomatedGuiTestingProject &amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://en.wikipedia.org/wiki/GUI_software_testing &amp;lt;br&amp;gt;&lt;br /&gt;
[4] http://www.open-xchange.com/wiki/index.php?title=Automated_GUI_Tests &amp;lt;br&amp;gt;&lt;br /&gt;
[5] http://agilistas.org/presentations/codecamp06/ &amp;lt;br&amp;gt;&lt;br /&gt;
[6] http://www.ranorex.com/?gclid=CNvA_YnesJ0CFchW2godpT5YrQ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] http://www.gerrardconsulting.com/GUI/TestGui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[8] http://www.slideshare.net/rpires/GUI-Test-Patterns &amp;lt;br&amp;gt;&lt;br /&gt;
[9] http://en.wikipedia.org/wiki/List_of_GUI_testing_tools &amp;lt;br&amp;gt;&lt;br /&gt;
[10] http://www.junit.org/taxonomy/term/6 &amp;lt;br&amp;gt;&lt;br /&gt;
[11] http://www.cs.umd.edu/~atif/papers/MemonSQW2000.pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[12] http://www.testingfaqs.org/t-gui.html &amp;lt;br&amp;gt;&lt;br /&gt;
[13] http://www.springerlink.com/content/d08681k5081553r7/ &amp;lt;br&amp;gt;&lt;br /&gt;
[14] http://www.cs.umd.edu/~atif/GUITAR-distribution/manuals/Perform%20Tests%20on%20the%20AUT.htm#Rip &amp;lt;br&amp;gt;&lt;br /&gt;
[15] http://seleniumhq.org/ &amp;lt;br&amp;gt;&lt;br /&gt;
[16] http://www2.computer.org/portal/web/csdl/doi/10.1109/COMPSAC.2006.94&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_9_mk&amp;diff=19019</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 9 mk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_9_mk&amp;diff=19019"/>
		<updated>2009-09-09T21:37:07Z</updated>

		<summary type="html">&lt;p&gt;Sniper: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Research in Refactoring Tools=&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
Refactoring is the process of modifying existing source codebase in a structured and incremental &lt;br /&gt;
way while preserving its external behavior. This process preserves the functionality of the program  &lt;br /&gt;
without introducing new bugs. Refactoring also promotes reuse of the existing [http://en.wikipedia.org/wiki/Codebase codebase] for other purposes thus increasing code reusability.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
One of the most important aspect of any software meant for real world applications is its ability to evolve.Many surveys conducted by major software organizations have reavealed that, maintenance is the major part of the total [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle Software Development life cycle]. Maintenance of the code would be much less difficult, if the code has the capacity to evolve, where in refactoring comes into picture.&lt;br /&gt;
Refactoring improves the internal structure of the codebase keeping the behaviour/functionality of the program same as before and therefore any program  which meets its specifications before refactoring will &lt;br /&gt;
continue to meet those specifications even afterwards. Refactoring can be done on any codebase and it &lt;br /&gt;
is a general set of operations. Hence, it comes with preconditions which specifies under what circumstances &lt;br /&gt;
refactoring can be performed, also with the conformation that the dependency graphs are unchanged even after the &lt;br /&gt;
refactoring is performed.&lt;br /&gt;
&lt;br /&gt;
Code smell:&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_smell Code smell] is the surface indication that usually corresponds to problem in the code [system]. &lt;br /&gt;
&lt;br /&gt;
So of the common code smell examples are:&lt;br /&gt;
*A class that has grown too large.&lt;br /&gt;
*A class that uses methods of another class excessively.&lt;br /&gt;
*Classes that depend on the implementation details of other classes.&lt;br /&gt;
*Identical or very similar code exists in more than one location.&lt;br /&gt;
*A class that does too little or which can be implemented as a method in some other class.&lt;br /&gt;
*A method, function, or procedure that has grown too large.&lt;br /&gt;
*A method, function, or procedure that is very similar to another.&lt;br /&gt;
*A situation where in a complicated design pattern is chosen over a simple design which would be sufficient.&lt;br /&gt;
&lt;br /&gt;
These are some of the indications that code refactoring needs to be done. Code Refactoring is done to remove the above specified code smells.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Code Smell(Duplicate Code) example&lt;br /&gt;
&lt;br /&gt;
  if (this.o.ChkSum()) {&lt;br /&gt;
    Operation1();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  and in another method you have: &lt;br /&gt;
  &lt;br /&gt;
  if (this.o.ChkSum()) {&lt;br /&gt;
    Operation2();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==Current Automated Refactoring Tools==&lt;br /&gt;
&lt;br /&gt;
Most of Refactoring tool features can be grouped into three broad categories. &lt;br /&gt;
&lt;br /&gt;
1. Changing the name and physical organization of code, including renaming fields, variables, classes, &lt;br /&gt;
and [http://en.wikipedia.org/wiki/Interface_(computer_science) interfaces], and moving [http://en.wikipedia.org/wiki/Software_package_(programming) packages] and classes.&lt;br /&gt;
&lt;br /&gt;
2. Changing the logical organization of code at the class level, including turning [http://en.wikipedia.org/wiki/Class_(computer_science) anonymous classes] &lt;br /&gt;
into nested classes, turning nested classes into top-level classes, creating interfaces from &lt;br /&gt;
concrete classes, and moving methods or fields from a class to a subclass or superclass.&lt;br /&gt;
&lt;br /&gt;
3. Changing the code within a class, including turning local variables into class fields, turning &lt;br /&gt;
selected code in a method into a separate method, and generating getter and setter methods for &lt;br /&gt;
fields.&lt;br /&gt;
&lt;br /&gt;
Given below is an example of Refactoring, demonstrating how it enhances reusability&lt;br /&gt;
&lt;br /&gt;
  void displayValues() {&lt;br /&gt;
    	double averageSalary = 0;&lt;br /&gt;
  	double totalCars = 0;&lt;br /&gt;
  	for (int i = 0; i &amp;lt; people.length; i++) {&lt;br /&gt;
  		averageSalary += people[i].salary;&lt;br /&gt;
  		totalCars += people[i].carCount;&lt;br /&gt;
  	}&lt;br /&gt;
  	averageSalary = averageSalary / people.length;&lt;br /&gt;
  	System.out.println(averageSalary);&lt;br /&gt;
  	System.out.println(totalCars);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
The refactored code:&lt;br /&gt;
  &lt;br /&gt;
  void printValues() {&lt;br /&gt;
  	System.out.println(averageSalary());&lt;br /&gt;
  	System.out.println(totalCars());&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  private double averageSalary() {&lt;br /&gt;
  	double result = 0;&lt;br /&gt;
  	for (int i = 0; i &amp;lt; people.length; i++) {&lt;br /&gt;
  			result += people[i].salary;&lt;br /&gt;
  	}&lt;br /&gt;
  	return result / people.length;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  private double totalCars() {&lt;br /&gt;
  	double result = 0;&lt;br /&gt;
  	for (int i = 0; i &amp;lt; people.length; i++) {&lt;br /&gt;
  			result += people[i].carCount;&lt;br /&gt;
  	}&lt;br /&gt;
  	return result;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
Given below is the list of most used automated refactoring tools&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Aptana Aptana for Ruby](Can be used as a Plug-in for Eclipse)&lt;br /&gt;
* [http://en.wikipedia.org/wiki/IntelliJ_IDEA IntelliJ IDEA]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Eclipse_(software) Eclipse's JDT] &lt;br /&gt;
* [http://en.wikipedia.org/wiki/NetBeans NetBeans] (for Java)&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio 2008] (for .NET)&lt;br /&gt;
* [http://en.wikipedia.org/wiki/ReSharper ReSharper] (An addon for Visual Studio)&lt;br /&gt;
* [http://weblogs.asp.net/bsimser/archive/2006/03/02/439473.aspx Refactor Pro] (An addon for Visual Studio)&lt;br /&gt;
&lt;br /&gt;
==Academic underpinnings behind the refactoring work==&lt;br /&gt;
[http://en.wikipedia.org/wiki/William_Opdyke William F. Opdyke], who is one of the important person behind the success of refactoring, was the first to think in the lines of &amp;quot;why people could be reluctant to refactor their software, given that refactoring improves the software.They found mainly four reasons&lt;br /&gt;
 &lt;br /&gt;
1. &amp;quot;I don't understand how to refactor.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;If the benefits are long-term, why exert the effort now? In the long term, I may no longer be with the project.”&lt;br /&gt;
&lt;br /&gt;
3. &amp;quot;Refactoring code is an overhead activity; I’m paid to write new features.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
4. &amp;quot;Refactoring might break the code.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The first two issues were addressed by defining a taxonomy of refactoring, which helped both in short term as well as in long term. For example, when defining a new feature that is a variant on&lt;br /&gt;
an existing feature, one can define classes (usually [http://en.wikipedia.org/wiki/Abstract_type abstract] classes) that&lt;br /&gt;
capture the common behavior, and use subclassing to capture the feature&lt;br /&gt;
differences.&lt;br /&gt;
The approach for addressing the latter two of these issues was by providing automated assistance, which help to increase the speed of program restructuring.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
William F. Opdyke, in one his other research found that, object-oriented programming makes program components more reusable, but in the long run reusing the design of an application is more important than reusing the implementation of any&lt;br /&gt;
one of its components. An important object-oriented technique to facilitate design-level reuse is an application frame-&lt;br /&gt;
work, which is an abstract design of an application, consisting of an abstract class for each&lt;br /&gt;
major component. The important aspects of the framework are given below, most of which are self explainatory &lt;br /&gt;
&lt;br /&gt;
* Preserving Behavior During Refactoring: Refactoring is likely to violate seven properties: a class is allowed to have no more than one superclass, which cannot be one of its subclasses; class names and memeber names must be distinct; inherited member variables should not be overridden; signatures compatibility between [http://en.wikipedia.org/wiki/Method_overriding overriding] methods and the overridden method; assignments must always be [http://en.wikipedia.org/wiki/Type_safety typesafe]; semantic equivalence between references and operations i.e., the mapping of inputs to outputs must be the same.&lt;br /&gt;
&lt;br /&gt;
* Twenty-six low-level refactorings whose correctness is argued, fall in one of the categories:Creating a Program Entity, Deleting a Program Entity, Changing Program Entity, Moving a member variables.&lt;br /&gt;
&lt;br /&gt;
*  Refactoring To Generalize: Creating An [http://en.wikipedia.org/wiki/Abstract_type Abstract] Super-class involves, identifying and moving common features between classes to an abstract superclass.&lt;br /&gt;
&lt;br /&gt;
*  Refactoring To Specialize: Subclassing and Simplifying Conditionals.&lt;br /&gt;
&lt;br /&gt;
*  Capturing [http://en.wikipedia.org/wiki/Object_composition Aggregations and Components]: Refactorings involving aggregations include moving members between an aggregate and component classes and converting inheritance to aggregation. These require that components be distinguishable from non-component members and that all components be exclusive, i.e., exist in only one aggregate object at any time. &amp;lt;br&amp;gt; We take a Matrix and 2D array example to demonstrate, why refactoring preferably converts inheritance to aggregation. Matrix class inheriting from 2D array, which in turn has an array to store elements and get/set operations to access elements, seems resonable at one glance. Lets take a function of matrix multiply as shown below &lt;br /&gt;
&lt;br /&gt;
  Matrix matrixMultiply(Matrix m){&lt;br /&gt;
     j=get(x,y);&lt;br /&gt;
     put(k,x,y);&lt;br /&gt;
     ...&lt;br /&gt;
     ...&lt;br /&gt;
  }&lt;br /&gt;
There is a problem with this representation because, if a matrix is a special matrix like   [http://en.wikipedia.org/wiki/Sparse_matrix sparse], it can be more efficiently stored than storing in a 2D array. In inheritance, the matrix class is tighlty coupled to the 2D class, so it cannot be changed. A matrix ''has a representation'' and is ''not a representation''. So, the operations on abstraction and representation class need to be separated.So, we introduce a new class Matrix representation and we can create an instance of 2D array class inside the aggregate of Matrix class given as below.&lt;br /&gt;
&lt;br /&gt;
  Matrix matrixMultiply(Matrix m){&lt;br /&gt;
     j=matrixRep-&amp;gt;get(x,y);&lt;br /&gt;
     matrixRep-&amp;gt;put(k,x,y);&lt;br /&gt;
     ...&lt;br /&gt;
     ...&lt;br /&gt;
  } &lt;br /&gt;
&lt;br /&gt;
Now, the get and set are referenced through new component and inheritance link can be modified.&lt;br /&gt;
&lt;br /&gt;
==Improvements Current Refactoring Tools need==&lt;br /&gt;
&lt;br /&gt;
Tools that help the programmers with refactoring should:&lt;br /&gt;
&lt;br /&gt;
* Be lightweight. Users can normally [http://www.acm.org/src/subpages/murphy-hill/acm_src_final.html select code quickly] and efficiently, and any tool to assist selection should not add overhead to slow down the common case.&lt;br /&gt;
&lt;br /&gt;
* Help the programmer overcome unfamiliar or unusual code formatting.&lt;br /&gt;
&lt;br /&gt;
* Allow the programmer to select code in a manner specific to the task they are performing. For example, while bracket matching can be helpful, bracketed statements are not the only meaningful program construct that a programmer needs to select.&lt;br /&gt;
&lt;br /&gt;
* Language Independent, all of the current refactoring tools depend on language-dependent refactoring engines, which prevents a smooth integration with mainstream development environments.They should minimize the language-dependent part of refactoring tools, providing a standard way for programmers and tools to perform refactorings no matter what language they work in.&lt;br /&gt;
** Meta-model Approach &lt;br /&gt;
*:Program Auditing facilities like [http://en.wikipedia.org/wiki/Unified_Modeling_Language UML] diagrams, documentation etc help in understanding the programs better and a tight integration between these auditing facilities and refactory tools will be real good. Most commonly, integration in software development environments is achieved by means of a repository: a shared database accumulating all knowledge about the software system underdevelopment. Thus, for refactoring tools to become part of mainstream software development environments, the most natural way would be to adhere to a repository architecture. Such a repository architecture requires a central data model (the so-called meta-model) which should be highly language independent and contain sufficient information to represent refactorings.&lt;br /&gt;
&lt;br /&gt;
* Capable of performing Security Oriented transformation, which mean automated transformations that change programs to eliminate security threats;they can be source to source or binary to binary transformations. They improve the security of systems, which means that they do not preserve all types of behavior (although this is against the very definition of refactoring). They preserve expected behavior, but should change a system’s response to security attacks.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Refactoring is an integral part of all software development projects and it is very important for refactoring tools to make refactoring fast and functionality preserving. There are many improvements that have been suggested for code refactoring and it is required that it gets implemented to reduce code smell, provide easier understanding of code, as well as re usability of code. These qualities will be adopted by new refactoring tools, making them usable and thus more used, and eventually contribute to the production of more reliable, on-time refactored  software. It is also important that the refactoring tools improve the experience of refactoring, help programmers correctly identify problems with a proposed refactoring, and increase speed of the refactoring process.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [http://books.google.com/books?id=1MsETFPD3I0C&amp;amp;dq=refactoring+fowler&amp;amp;printsec=frontcover&amp;amp;source=bn&amp;amp;hl=en&amp;amp;ei=cMimSqP0J5GCtgeAkb2ZCA&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=4#v=onepage&amp;amp;q=&amp;amp;f=false Refactoring: Improving the Design of Existing Code by Martin Fowler, Kent Beck, John Brant]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Design_pattern_(computer_science) Design pattern (computer science)]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Code_refactoring Code Factoring]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Redesign_(software) Redesign (software)]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
[1] http://www.refactoring.com &amp;lt;br&amp;gt;&lt;br /&gt;
[2] https://netfiles.uiuc.edu/dig/RefactoringInfo/ &amp;lt;br&amp;gt;&lt;br /&gt;
[3] William F. Opdyke. Refactoring Object-Oriented Frameworks. Ph.D.thesis, University of Illinois at Urbana-Champaign, 1992. &amp;lt;br&amp;gt;&lt;br /&gt;
[4] A Meta-model for Language-Independent Refactoring (2000) Sander Tichelaar ,  Stéphane Ducasse ,  Serge Demeyer ,  Oscar Nierstrasz &amp;lt;br&amp;gt;&lt;br /&gt;
[5] Refactoring Object-Oriented Software to Support Evolution and Reuse, William F. Opdyke &amp;lt;br&amp;gt;&lt;br /&gt;
[6] Security Oriented ProgramTransformations (Or How to Add Security on Demand), Munawar Hafiz&lt;/div&gt;</summary>
		<author><name>Sniper</name></author>
	</entry>
</feed>