<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Testing UI &#8211; part 1</title>
	<atom:link href="http://misko.hevery.com/2008/07/05/testing-ui-part1/feed/" rel="self" type="application/rss+xml" />
	<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=testing-ui-part1</link>
	<description>Testability Explorer</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:42:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Andrii</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-14275</link>
		<dc:creator>Andrii</dc:creator>
		<pubDate>Thu, 15 Dec 2011 13:40:26 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-14275</guid>
		<description>I think in the test you&#039;re missing :

loginPage.login();

before 

assertEquals(&quot;user/pass&quot;, log);</description>
		<content:encoded><![CDATA[<p>I think in the test you&#8217;re missing :</p>
<p>loginPage.login();</p>
<p>before </p>
<p>assertEquals(&#8220;user/pass&#8221;, log);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-7789</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Tue, 19 Apr 2011 23:10:23 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-7789</guid>
		<description>This is a good presentation of a controller communicating with a view using data binding.   But I have two concerns.   One thing I do not like about data binding is that it can lead to subtle bugs regarding time.    That is, when you have multiple data items that work together, you want to be sure that all of them pertain to the same entity.  For example, that they all belong to the current customer, not a previous customer that the user clicked through.   The other concern I have is with complex user interfaces.   If there is some complex manipulation of the user interface, that requires more that just accessing the text property of a UI component, such as creating additional components on the fly, the programmer would have to decide how to allocate the code between the view and the controller.   That might make for some difficult decisions.   It might also tempt the programmer to have the controller access the View.    In any case, thank you for the presentation.</description>
		<content:encoded><![CDATA[<p>This is a good presentation of a controller communicating with a view using data binding.   But I have two concerns.   One thing I do not like about data binding is that it can lead to subtle bugs regarding time.    That is, when you have multiple data items that work together, you want to be sure that all of them pertain to the same entity.  For example, that they all belong to the current customer, not a previous customer that the user clicked through.   The other concern I have is with complex user interfaces.   If there is some complex manipulation of the user interface, that requires more that just accessing the text property of a UI component, such as creating additional components on the fly, the programmer would have to decide how to allocate the code between the view and the controller.   That might make for some difficult decisions.   It might also tempt the programmer to have the controller access the View.    In any case, thank you for the presentation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sagar</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-902</link>
		<dc:creator>Sagar</dc:creator>
		<pubDate>Thu, 23 Apr 2009 10:00:46 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-902</guid>
		<description>hi misko,can u please suggest any tools where in a tester can identify the color, fonts, fonts size on a UI.</description>
		<content:encoded><![CDATA[<p>hi misko,can u please suggest any tools where in a tester can identify the color, fonts, fonts size on a UI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Constructor Injection vs. Setter Injection</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-702</link>
		<dc:creator>Constructor Injection vs. Setter Injection</dc:creator>
		<pubDate>Thu, 19 Feb 2009 18:24:26 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-702</guid>
		<description>[...] I was building a Flex application and using the Model-View-Controller. Flex XML markup requires that components must have no argument constructors, therefore I was [...]</description>
		<content:encoded><![CDATA[<p>[...] I was building a Flex application and using the Model-View-Controller. Flex XML markup requires that components must have no argument constructors, therefore I was [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-192</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Fri, 19 Sep 2008 17:17:22 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-192</guid>
		<description>@CJ 

I am sure in the bast you have seen the dependencies go all different ways. But I bet you those ones are hard to test.

A View is rendering, that is hard to test. Unlikely that you will be able to assert anything interesting. Not to mention since it is rendering it needs some graphics context and so it will not be a unit test. 

A Controller has lots of interesting code/behavior in it which you want to test. But if controller knows about the  view than Controller is now hard to test since dependencies are transitive.  That is why we need to break that dependency.

Now you are right, we need to be able to communicate data from Controller back to UI. So to do that we use data bindings. (Or events). This way we can easily unit test the controller and don&#039;t have to pay the expensive view set up.

Now many systems have this backwards, or even have circular dependencies. My guess is that those systems are also not easy to test.</description>
		<content:encoded><![CDATA[<p>@CJ </p>
<p>I am sure in the bast you have seen the dependencies go all different ways. But I bet you those ones are hard to test.</p>
<p>A View is rendering, that is hard to test. Unlikely that you will be able to assert anything interesting. Not to mention since it is rendering it needs some graphics context and so it will not be a unit test. </p>
<p>A Controller has lots of interesting code/behavior in it which you want to test. But if controller knows about the  view than Controller is now hard to test since dependencies are transitive.  That is why we need to break that dependency.</p>
<p>Now you are right, we need to be able to communicate data from Controller back to UI. So to do that we use data bindings. (Or events). This way we can easily unit test the controller and don&#8217;t have to pay the expensive view set up.</p>
<p>Now many systems have this backwards, or even have circular dependencies. My guess is that those systems are also not easy to test.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CJ</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-188</link>
		<dc:creator>CJ</dc:creator>
		<pubDate>Fri, 19 Sep 2008 15:04:53 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-188</guid>
		<description>Sorry, my ascii drawing got screwed but html preprocessor or something. I drawed this:

View ← Controller → Model</description>
		<content:encoded><![CDATA[<p>Sorry, my ascii drawing got screwed but html preprocessor or something. I drawed this:</p>
<p>View ← Controller → Model</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CJ</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-187</link>
		<dc:creator>CJ</dc:creator>
		<pubDate>Fri, 19 Sep 2008 15:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-187</guid>
		<description>I did not get it about Model-View-Contoller. You say Controller shouldn&#039;t be dependent on View, but aren&#039;t contollers exist exactly for briding views and data, and interfacing them to rest of the system? Programs I worked with had dependencies like this:

ViewModel

How does view know what visual elements it&#039;s to change when model changes? Via observing model&#039;s events? Or how?</description>
		<content:encoded><![CDATA[<p>I did not get it about Model-View-Contoller. You say Controller shouldn&#8217;t be dependent on View, but aren&#8217;t contollers exist exactly for briding views and data, and interfacing them to rest of the system? Programs I worked with had dependencies like this:</p>
<p>ViewModel</p>
<p>How does view know what visual elements it&#8217;s to change when model changes? Via observing model&#8217;s events? Or how?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-68</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Tue, 19 Aug 2008 04:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-68</guid>
		<description>Power of data bindings. 

Calling login() will change the controller.showError to true. Notice the code below.

&lt;mx:Label text=&quot;Login Failed&quot;
          visible=&quot;{controller.showError}&quot;
          color=&quot;#FF0000&quot; fontWeight=&quot;bold&quot;/&gt;

The visible property is data bound to controller.showError which will result in the error message displayed. 

See the login() method can take a while to decided if the login was successful an so it can not return true or false. The showError field can be changed some time later.

Love those data bindings!</description>
		<content:encoded><![CDATA[<p>Power of data bindings. </p>
<p>Calling login() will change the controller.showError to true. Notice the code below.</p>
<p><mx:label text="Login Failed"<br />
          visible="{controller.showError}"<br />
          color="#FF0000" fontWeight="bold"/></p>
<p>The visible property is data bound to controller.showError which will result in the error message displayed. </p>
<p>See the login() method can take a while to decided if the login was successful an so it can not return true or false. The showError field can be changed some time later.</p>
<p>Love those data bindings!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-54</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Mon, 11 Aug 2008 22:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-54</guid>
		<description>In the LoginPageTest, won&#039;t you need to call the controller&#039;s method: 
    public function login():void 

Without calling void() how will the showError be populated?

Also, would you use a different design in reality for setting the error message?
You have:
       showError = authenticator(username, password);

But instead would you catch an authentication exception, and set the error based on that. If the authenticator returns true when it succeeds, the showError will equal true, which is non-sensical.</description>
		<content:encoded><![CDATA[<p>In the LoginPageTest, won&#8217;t you need to call the controller&#8217;s method:<br />
    public function login():void </p>
<p>Without calling void() how will the showError be populated?</p>
<p>Also, would you use a different design in reality for setting the error message?<br />
You have:<br />
       showError = authenticator(username, password);</p>
<p>But instead would you catch an authentication exception, and set the error based on that. If the authenticator returns true when it succeeds, the showError will equal true, which is non-sensical.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/07/05/testing-ui-part1/comment-page-1/#comment-43</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Sat, 02 Aug 2008 17:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://s90424825.onlinehome.us/blog/?p=36#comment-43</guid>
		<description>Fixed the images. Thanks for pointing it out...</description>
		<content:encoded><![CDATA[<p>Fixed the images. Thanks for pointing it out&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

