<?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: Answering Jacopo&#8217;s comment	</title>
	<atom:link href="http://matteo.vaccari.name/blog/archives/411/feed" rel="self" type="application/rss+xml" />
	<link>http://matteo.vaccari.name/blog/archives/411</link>
	<description>Extreme enthusiasm</description>
	<lastBuildDate>
	Mon, 25 Feb 2019 15:18:16 +0000	</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.1.1</generator>
			<item>
				<title>
				By: matteo				</title>
				<link>http://matteo.vaccari.name/blog/archives/411/comment-page-1#comment-93291</link>
		<dc:creator><![CDATA[matteo]]></dc:creator>
		<pubDate>Thu, 17 Jun 2010 19:00:38 +0000</pubDate>
		<guid isPermaLink="false">http://matteo.vaccari.name/blog/?p=411#comment-93291</guid>
					<description><![CDATA[The XPath tests are in my opinion better than the ones with assertContains .  

The original goal for my team was to transmit a datastructure over the wire.  The format of the serialized data structure was not important, as long as it could be parsed reliably.  

What I mean to say is that even if your job is to develop the server side only, the value from your web service comes from being able to deserialize the data structure and do something with it.  This is why I may write a deserializer anyway.

The team I was working with was happy with testing against a literal string, though.  It will take a bit of time until they realize the limitations.  The tests they have, crude as they may be, are still good enough for them to drive development.]]></description>
		<content:encoded><![CDATA[<p>The XPath tests are in my opinion better than the ones with assertContains .  </p>
<p>The original goal for my team was to transmit a datastructure over the wire.  The format of the serialized data structure was not important, as long as it could be parsed reliably.  </p>
<p>What I mean to say is that even if your job is to develop the server side only, the value from your web service comes from being able to deserialize the data structure and do something with it.  This is why I may write a deserializer anyway.</p>
<p>The team I was working with was happy with testing against a literal string, though.  It will take a bit of time until they realize the limitations.  The tests they have, crude as they may be, are still good enough for them to drive development.</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: jacopo				</title>
				<link>http://matteo.vaccari.name/blog/archives/411/comment-page-1#comment-93290</link>
		<dc:creator><![CDATA[jacopo]]></dc:creator>
		<pubDate>Thu, 17 Jun 2010 18:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://matteo.vaccari.name/blog/?p=411#comment-93290</guid>
					<description><![CDATA[hi Matteo,
quoting your original post:

&quot;This sort of tests supports incremental development. If my data structure was, for instance, a list, I could write a nice sequence of tests:
* serializesAndRebuildsEmptyLists
* serializesAndRebuildsSingletonLists
* serializesAndRebuildsListsOfManyElements&quot;

this still stands for syntax-checking tests (sticking with client code), where you&#039;d probably assert, incrementally:

assertDoesNotContain(“&#060;el&#038;gt&#034;, s.serialize(emptyList));
assertContainsTimes(1, “&#060;el&#062;A&#060;el&#062;&#034;, s.serialize(listWith(&#034;A&#034;)));
assertContainsTimes(2, “&#060;el&#062;A&#060;el&#062;&#034;, s.serialize(listWith(&#034;A&#034;, &#034;A&#034;)));

or even better, with XPath:

assertCount(0, “//el&#034;, s.serialize(emptyList));
assertCount(1, “//el[@text=&#039;A&#039;]&#034;, s.serialize(listWith(&#034;A&#034;)));
assertCount(2, “//el[@text=&#039;A&#039;]&#034;, s.serialize(listWith(&#034;A&#034;, &#034;A&#034;)));

I was just stating that serialization/deserialization tests do not focus on intended goal for that piece of code: send XML data to a webservice.

when you say:

&#034;Note that this test is robust, as changes of the intermediate representation will not break it. [...] we could change it to byte array, or anything else, with no need to change this test&#034;

it was not clear to me why would you change such representation, given XML message forwarding was the original scope.

but you&#039;re probably right: I would probably use a subset of coarse-grained (integration) tests for driving development of such piece of code.

anyway, what feedback did you collected from last team you joined as a coach? did they find test-driving XML generation code useful?]]></description>
		<content:encoded><![CDATA[<p>hi Matteo,<br />
quoting your original post:</p>
<p>&#8220;This sort of tests supports incremental development. If my data structure was, for instance, a list, I could write a nice sequence of tests:<br />
* serializesAndRebuildsEmptyLists<br />
* serializesAndRebuildsSingletonLists<br />
* serializesAndRebuildsListsOfManyElements&#8221;</p>
<p>this still stands for syntax-checking tests (sticking with client code), where you&#8217;d probably assert, incrementally:</p>
<p>assertDoesNotContain(“&lt;el&amp;gt&quot;, s.serialize(emptyList));<br />
assertContainsTimes(1, “&lt;el&gt;A&lt;el&gt;&quot;, s.serialize(listWith(&quot;A&quot;)));<br />
assertContainsTimes(2, “&lt;el&gt;A&lt;el&gt;&quot;, s.serialize(listWith(&quot;A&quot;, &quot;A&quot;)));</p>
<p>or even better, with XPath:</p>
<p>assertCount(0, “//el&quot;, s.serialize(emptyList));<br />
assertCount(1, “//el[@text=&#039;A&#039;]&quot;, s.serialize(listWith(&quot;A&quot;)));<br />
assertCount(2, “//el[@text=&#039;A&#039;]&quot;, s.serialize(listWith(&quot;A&quot;, &quot;A&quot;)));</p>
<p>I was just stating that serialization/deserialization tests do not focus on intended goal for that piece of code: send XML data to a webservice.</p>
<p>when you say:</p>
<p>&quot;Note that this test is robust, as changes of the intermediate representation will not break it. [&#8230;] we could change it to byte array, or anything else, with no need to change this test&quot;</p>
<p>it was not clear to me why would you change such representation, given XML message forwarding was the original scope.</p>
<p>but you&#039;re probably right: I would probably use a subset of coarse-grained (integration) tests for driving development of such piece of code.</p>
<p>anyway, what feedback did you collected from last team you joined as a coach? did they find test-driving XML generation code useful?</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: matteo				</title>
				<link>http://matteo.vaccari.name/blog/archives/411/comment-page-1#comment-93288</link>
		<dc:creator><![CDATA[matteo]]></dc:creator>
		<pubDate>Thu, 17 Jun 2010 07:08:01 +0000</pubDate>
		<guid isPermaLink="false">http://matteo.vaccari.name/blog/?p=411#comment-93288</guid>
					<description><![CDATA[Hi Jacopo,

what other tests would help you develop and design your code incrementally, as opposed to simply checking that it works?]]></description>
		<content:encoded><![CDATA[<p>Hi Jacopo,</p>
<p>what other tests would help you develop and design your code incrementally, as opposed to simply checking that it works?</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: jacopo				</title>
				<link>http://matteo.vaccari.name/blog/archives/411/comment-page-1#comment-93285</link>
		<dc:creator><![CDATA[jacopo]]></dc:creator>
		<pubDate>Wed, 16 Jun 2010 19:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://matteo.vaccari.name/blog/?p=411#comment-93285</guid>
					<description><![CDATA[well, snippet has been stripped ;) originally was:

assertContains(&quot;&#060;el&#062;A&#060;el&#062;&#034;, xml);]]></description>
		<content:encoded><![CDATA[<p>well, snippet has been stripped ;) originally was:</p>
<p>assertContains(&#8220;&lt;el&gt;A&lt;el&gt;&quot;, xml);</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: jacopo				</title>
				<link>http://matteo.vaccari.name/blog/archives/411/comment-page-1#comment-93284</link>
		<dc:creator><![CDATA[jacopo]]></dc:creator>
		<pubDate>Wed, 16 Jun 2010 19:22:59 +0000</pubDate>
		<guid isPermaLink="false">http://matteo.vaccari.name/blog/?p=411#comment-93284</guid>
					<description><![CDATA[hi Matteo, thanks for the reply :)

from your previous post I thought your team mates were supposed to test-drive client code, to sent XML to webservice. so, examples I was thinking about were mainly related to that scenario: a (more or less) documented &quot;contract&quot; in terms of
* message syntax
* message data content

testing through a full serialization/deserialization loop would (probably) be too much, and not focused on task at hand: sent data to remote service.

asserting strict xml content would fail, as you noted, being fragile. but testing specific values, such as

assertContains(&quot;A&quot;, xml);

would probably be _good enough_. then, a final integration test, connecting to a remote service (or a fake local one, but through HTTP) would cast behaviour on stone, to be much more confidend.

what do you think?]]></description>
		<content:encoded><![CDATA[<p>hi Matteo, thanks for the reply :)</p>
<p>from your previous post I thought your team mates were supposed to test-drive client code, to sent XML to webservice. so, examples I was thinking about were mainly related to that scenario: a (more or less) documented &#8220;contract&#8221; in terms of<br />
* message syntax<br />
* message data content</p>
<p>testing through a full serialization/deserialization loop would (probably) be too much, and not focused on task at hand: sent data to remote service.</p>
<p>asserting strict xml content would fail, as you noted, being fragile. but testing specific values, such as</p>
<p>assertContains(&#8220;A&#8221;, xml);</p>
<p>would probably be _good enough_. then, a final integration test, connecting to a remote service (or a fake local one, but through HTTP) would cast behaviour on stone, to be much more confidend.</p>
<p>what do you think?</p>
]]></content:encoded>
						</item>
			</channel>
</rss>
