<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ask Steve!</title>
	<atom:link href="http://asksteve.software.ac.uk/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://asksteve.software.ac.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 16 May 2012 12:52:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Giving birth to software &#8211; there&#8217;s so much to know!</title>
		<link>http://asksteve.software.ac.uk/?p=253</link>
		<comments>http://asksteve.software.ac.uk/?p=253#comments</comments>
		<pubDate>Wed, 16 May 2012 12:40:35 +0000</pubDate>
		<dc:creator>SteveCrouch</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Release]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=253</guid>
		<description><![CDATA[It&#8217;s such a joyous time becoming a parent! Your software&#8217;s been conceived and is now going through an exciting and healthy period of development. You&#8217;ve fought your way through bouts of sickness and the odd craving (I&#8217;ll write it in&#8230; Malbolge*!!!), but everything&#8217;s on schedule. But wait&#8230; the delivery date is next week! Stay calm, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s such a joyous time becoming a parent! Your software&#8217;s been conceived and is now going through an exciting and healthy period of development. You&#8217;ve fought your way through bouts of sickness and the odd craving (I&#8217;ll write it in&#8230; <a title="Malbolge. Just don't." href="http://en.wikipedia.org/wiki/Malbolge#.22Hello_world.22_in_Malbolge" target="_blank">Malbolge</a>*!!!), but everything&#8217;s on schedule. But wait&#8230; the delivery date is next week! Stay calm, remember your breathing and follow these top tips for delivering something wonderful into the world.</p>
<p><strong>1 &#8211; Always release software with a licence</strong> &#8211; without a birth certificate, no one will know who the parents are.</p>
<p><strong>2 &#8211; Waiting isn&#8217;t going to make the delivery any better</strong> &#8211; a late delivery can be as difficult as one that is premature. If things are taking too long, it can be best to induce labour.</p>
<p><strong>3 &#8211; Version your software releases</strong> &#8211; things are going to get complicated if you don&#8217;t distinguish between who&#8217;s Sr. and who&#8217;s Jr. (Michael Jackson&#8217;s a bit of a visionary in this field, having included a version number in his son&#8217;s name &#8220;Michael II&#8221;).</p>
<p><strong>4 &#8211; Provide contact information</strong> &#8211; make sure your software has a name tag just in case there&#8217;s a mix up at the repository.</p>
<p><strong>5 &#8211; Download and test your release</strong> &#8211; on the big day, you should make a test run so that you&#8217;re happy that there&#8217;ll be no complications (pack an overnight bag).</p>
<p>For a slightly more, er&#8230; <em>considered&#8230;</em> take on this subject, check out my <a title="'Top 5 Tips for Releasing Software'" href="http://software.ac.uk/blog/2012-04-26-top-5-tips-releasing-software" target="_blank">Top 5 Tips for Releasing Software</a> article on the Institute&#8217;s blog.</p>
<h5>* not recommended if you wish to stay sane. It&#8217;s named after the eighth circle of hell in Dante&#8217;s Inferno for a reason</h5>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=253</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>So what shouldn&#8217;t you do?</title>
		<link>http://asksteve.software.ac.uk/?p=237</link>
		<comments>http://asksteve.software.ac.uk/?p=237#comments</comments>
		<pubDate>Fri, 04 May 2012 08:43:47 +0000</pubDate>
		<dc:creator>SteveCrouch</dc:creator>
				<category><![CDATA[Dependencies]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=237</guid>
		<description><![CDATA[We mention things you should do when developing software quite a bit. But we were asked an interesting question at the Software Sustainability Institute&#8217;s Collaboration Workshop this year: what things shouldn&#8217;t you do when developing software?
Come on, there has to be some. And there are &#8211; many! But let&#8217;s focus on five of the big [...]]]></description>
			<content:encoded><![CDATA[<p><strong>We mention things you <em>should</em> do when developing software quite a bit. But we were asked an interesting question at the Software Sustainability Institute&#8217;s <a title="The Collaboration Workshop 2012" href="http://software.ac.uk/cw12" target="_blank">Collaboration Workshop</a> this year: what things <em>shouldn&#8217;t</em> you do when developing software?</strong></p>
<p>Come on, there has to be some. And there are &#8211; many! But let&#8217;s focus on five of the big ones&#8230;</p>
<p><strong>1. Don&#8217;t develop code you can&#8217;t maintain</strong></p>
<p>This has got to be high on the list. Code can turn into spaghetti from out of nowhere, and it&#8217;s always worth avoiding. Best to get into good habits early on in the project!</p>
<p><strong>2. Don&#8217;t make your software difficult to build and install</strong></p>
<p>We&#8217;ve all experienced this with other people&#8217;s software. If user&#8217;s can&#8217;t install it, they&#8217;ll move on &#8211; perhaps to a piece of software that has inferior capabilities. Why not make it easy, and simplify (or even automate) the build and install processes that are so often fraught with peril?</p>
<p><strong>3. Don&#8217;t keep the source code to yourself</strong></p>
<p>If you hold the source code in only one place &#8211; your development machine &#8211; and you lose it, you only have yourself to blame. If your development machine is your laptop, it&#8217;s even easier to lose. Avoid the pain and use a suitable source code repository from the outset!</p>
<p><strong>4. Don&#8217;t forget documentation</strong></p>
<p>Writing documentation is boring, but it is necessary. It&#8217;s your primary means of communicating your users what the software does and how to do it to. As with difficult build and install processes, you risk disenfranchisement if users can&#8217;t find out what they need to know.</p>
<p><strong>5. Don&#8217;t overlook testing</strong></p>
<p>Features, features, features. But if you neglect testing your software, you risk losing users, users, users. In the rush to implement and release a really handy new feature, ending up with a release that doesn&#8217;t work will not instil confidence in your product. And including a means for developers to run a solid set of automated tests and implement their own is very useful as a fail-fast development environment when they want to modify it themselves.</p>
<p>Well, that&#8217;s my five. You&#8217;ll notice I haven&#8217;t covered any software release &#8220;don&#8217;ts&#8221;, but that&#8217;s because I&#8217;m currently putting together a related top 5 list of software release &#8220;Dos&#8221; <img src='http://asksteve.software.ac.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So these are just scoped to software development. If you&#8217;re interested, you can check out these in more detail in <a title="Institute blog post on top 5 software don'ts" href="http://software.ac.uk/blog/2012-04-25-top-5-software-development-donts" target="_blank">in my post on the Software Sustainability Institute&#8217;s blog</a>.</p>
<p>Maybe you disagree with my list above, in which case <a href="mailto:asksteve@software.ac.uk">let me know</a> what you think are the big software development don&#8217;ts.</p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=237</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>“Oi, does my code smell? I’ve been told it does, but I can’t smell nuffink’! How do I give it the Lynx effect?”</title>
		<link>http://asksteve.software.ac.uk/?p=230</link>
		<comments>http://asksteve.software.ac.uk/?p=230#comments</comments>
		<pubDate>Mon, 30 Apr 2012 10:05:13 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=230</guid>
		<description><![CDATA[I first heard about “code smells” during a session I was chairing at Dev8D 2012 on “what makes good code good?”: Ian Bayley, from Oxford Unviersity, suggested “no ‘code smells’”. I’d never heard of this term so I turned to my trusty friend Google to see what was what. Although I hadn&#8217;t heard the term [...]]]></description>
			<content:encoded><![CDATA[<p>I first heard about “code smells” during a session I was chairing at <a href="http://dev8d.org/">Dev8D 2012</a> on <a href="http://software.ac.uk/blog/2012-02-17-what-makes-good-code-good-and-peer-software-reviewing-dev8d">“what makes good code good?”:</a> Ian Bayley, from Oxford Unviersity, suggested “no ‘code smells’”. I’d never heard of this term so I turned to my trusty friend Google to see what was what. Although I hadn&#8217;t heard the term before, it turns out that I knew what code smells are… source code that just looks “odd” or doesn’t feel quite right, which are signs that suggests to a developer that refactoring might be in order.</p>
<p>Not only were many of the smells familiar but the “deodorants” were too. For example, <a href="http://martinfowler.com/refactoring/catalog/replaceArrayWithObject.html">replacing arrays that are used as records with objects</a>,</p>
<blockquote>
<pre>String[] row = new String[3];</pre>
<pre>row [0] = "Liverpool";</pre>
<pre>row [1] = "15";</pre>
</blockquote>
<p>can be replaced by,</p>
<blockquote>
<pre>Performance row = new Performance();</pre>
<pre>row.setName("Liverpool");</pre>
<pre>row.setWins("15");</pre>
</blockquote>
<p>Or, <a href="http://martinfowler.com/refactoring/catalog/replaceNestedConditionalWithGuardClauses.html">replacing nested conditionals with guard clauses </a>e.g.:</p>
<blockquote>
<pre>double getPayAmount() {</pre>
<pre>    double result;</pre>
<pre>    if (_isDead) result = deadAmount();</pre>
<pre>    else {</pre>
<pre>        if (_isSeparated) result = separatedAmount();</pre>
<pre>        else {</pre>
<pre>            if (_isRetired) result = retiredAmount();</pre>
<pre>            else result = normalPayAmount();</pre>
<pre>        };</pre>
<pre>    }</pre>
<pre>    return result;</pre>
<pre>};</pre>
</blockquote>
<p>can be replaced by</p>
<blockquote>
<pre>double getPayAmount() {</pre>
<pre>    if (_isDead) return deadAmount();</pre>
<pre>    if (_isSeparated) return separatedAmount();</pre>
<pre>    if (_isRetired) return retiredAmount();</pre>
<pre>    return normalPayAmount();</pre>
<pre>};</pre>
</blockquote>
<p>The term “code smell” is attributed to Kent Beck in Martin Fowler’s book <em>Refactoring, Improving the Design of Existing Code</em> (Addison-Wesley, 1999, ISBN 0-201-48567-2). There are lots of online resources that will teach you how to spot smelly code and help with the deodorising so that your code ends up as pure as an Alpine breeze. As a starting point you could try Martin Fowler’s own <a href="http://martinfowler.com/refactoring/catalog/">&#8220;catalog of code smells and refactorings</a>&#8220;, which lists both symptoms and cures, judiciously highlighted with examples. A complementary resource is Mäntylä and Lassenius’s <a href="http://www.soberit.hut.fi/mmantyla/BadCodeSmellsTaxonomy.htm">“bad code smells taxonomy”</a>. This groups together bad smells into a useful, recognisable and amusingly named taxonomy. As a couple of examples they have,</p>
<ul>
<li>The Bloaters, including long methods, large classes, long parameter lists and data clumps (sets of data like 3 integers for RGB colours which could be encapsulated).</li>
<li>The Dispensables, anything which can, and should, be removed including lazy classes that don’t do enough, duplicated code, dead code and speculative generality (code which “might possibly be useful someday, maybe” but which incurs maintenance overheads).</li>
<li>Other classifications are the change preventers, the couplers and the object-orientation abusers.</li>
</ul>
<p>Another useful resource is<a href="http://sourcemaking.com/"> SourceMaking</a>’s pages on <a href="http://sourcemaking.com/refactoring">refactoring </a>which motivates refactoring before describing many code smells and their refactorings.</p>
<p>Static code analysis tools such as <a href="http://checkstyle.sourceforge.net/">CheckStyle </a>or <a href="http://www.logilab.org/857">Pylint</a> can also automatically detect (but not fix, that’s your job) code smells, and these might become a useful part of an nightly test system for your software, or part of a continuous integration server.</p>
<p>I hope this answers your question and the resources above will help you to write more fragrant code in future!</p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=230</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Self-assessing your own software &#8211; a very nifty resource</title>
		<link>http://asksteve.software.ac.uk/?p=232</link>
		<comments>http://asksteve.software.ac.uk/?p=232#comments</comments>
		<pubDate>Thu, 26 Apr 2012 12:59:46 +0000</pubDate>
		<dc:creator>SteveCrouch</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=232</guid>
		<description><![CDATA[At the Software Sustainability Institute I&#8217;m often asked - unsurprisingly &#8211;  to evaluate the sustainability of software. This typically leads to a report for the developers with observations and recommendations for improvement. Wouldn&#8217;t it be better if there was some way of evaluating your own software?
There is! Having a third-party assess the state of [...]]]></description>
			<content:encoded><![CDATA[<p><strong>At the Software Sustainability Institute I&#8217;m often asked </strong><strong>- unsurprisingly &#8211; </strong><strong> to evaluate the sustainability of software. This typically leads to a report for the developers with observations and recommendations for improvement. Wouldn&#8217;t it be better if there was some way of <a href="http://www.software.ac.uk/online-sustainability-evaluation">evaluating your own software</a>?</strong></p>
<p>There is! Having a third-party assess the state of your software in some way, be it a colleague testing the install process and documentation to provide feedback, or having the Institute perform a <a title="SSI's evaluation service" href="http://software.ac.uk/what-do-we-do" target="_blank">full evaluation</a> is always useful. However, developing the skill to impartially self-assess your own software is invaluable. Adopting an objective &#8216;green&#8217; user or developer perspective &#8211; removing your inner assumptions and knowledge of the software from the equation &#8211; can only help your software to become better.</p>
<p>Not only are the Institute&#8217;s <a title="SSI's evaluation processes" href="http://software.ac.uk/software-evaluation-guide" target="_blank">processes for evaluation available</a> for you to use yourselves, but there is now a <a href="http://www.software.ac.uk/online-sustainability-evaluation">very helpful, lightweight and quick sustainability evaluation</a> you can do on your own. You just fill in a simple web form with details about your software, and it returns a list of recommendations (with helpful links) on how you can improve your software. Simple! It investigates a number of key areas related to the sustainability of your software, including the processes for building and installation, documentation, availability, support, licences and source code structure, amongst many others.</p>
<p>You can check out this <a href="http://www.software.ac.uk/online-sustainability-evaluation">nifty evaluation resource</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=232</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing questions about testing!</title>
		<link>http://asksteve.software.ac.uk/?p=212</link>
		<comments>http://asksteve.software.ac.uk/?p=212#comments</comments>
		<pubDate>Mon, 05 Dec 2011 09:22:33 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=212</guid>
		<description><![CDATA[Today&#8217;s post comes courtesy of Mike Jackson, also from the Software Sustainability Institute. If the Institute was the Dukes of Hazzard television show, with Steve as Bo Duke, then Mike Jackson would surely be Luke Duke.  In this post, Mike answers a testing question about testing frameworks in Python.
Software testing is a vital part of software [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ffffff;"><em><strong>Today&#8217;s post comes courtesy of Mike Jackson, also from the Software Sustainability Institute. If the Institute was the<a href="http://en.wikipedia.org/wiki/The_Dukes_of_Hazzard"> Dukes of Hazzard</a> television show, with Steve as Bo Duke, then Mike Jackson would surely be Luke Duke.  In this post, Mike answers a testing question about testing frameworks in Python.</strong></em></span></p>
<p><span style="color: #ffffff;">Software testing is a vital part of software development. It not only allows us to demonstrate that our software satisfies its requirements but to ensure that our software is both correct and robust. Automated software testing provides us with a safety net during development, allowing us to fix bugs, make enhancements and extensions secure in the knowledge that if we break anything then the tests will catch this. After all, there are few things worse than fixing a bug to discover later that, in doing so, we&#8217;ve introduced a new one.</span></p>
<p><span style="color: #ffffff;">Philip Maechling of the <a href="http://www.scec.org/">Southern California Earthquake Center </a>(SCEC)</span><span style="color: #ffffff;">, at USC, recently contacted the Institute with questions about software testing. Philip and his colleagues develop scientific software that outputs computational results into files. These files are typically simple ASCII text files but contain series&#8217; of floating point numbers e.g. time series. Their acceptance testing involves comparing these files to existing reference result files.</span></p>
<p><span style="color: #ffffff;">Philip posed two questions:</span></p>
<ul>
<li><span style="color: #ffffff;">Many unit test frameworks (e.g. JUnit and PyUnit) are focused around instantiating an object, or other software module, within a test class, calling methods on that module, then checking the values returned against expected values. While file comparisons can be done with such frameworks, they are complicated due to the need for floating point compares (which is tricky at the best of times), and differences in header information, or non-significant file contents. So, are you aware of any testing tools designed to support tests that are based on file-based comparisons?</span></li>
<li><span style="color: #ffffff;">In our file-based comparison tests, we often use the same reference files in multiple tests. In some testing circles, a directory of tests and expected test results are collected into a datastore called an &#8220;oracle&#8221;. When you want to know the correct results, you look up your test and find the expected result in this oracle. Are you aware of any software unit or acceptance testing tools that support the idea of a test oracle? The concept is simple, and we have implemented a couple of our own oracle datastores, but we seem to re-invent this each project. If there is a standard solution, I am interested in trying it out.</span></li>
</ul>
<p><span style="color: #ffffff;">Question 2 is a generalisation of 1, using a set of reference files across multiple tests. As Philip comments, these reference files can be termed an &#8220;oracle&#8221;. More generally, &#8220;oracle&#8221; can be used to refer to anything which validates the outputs of a test i.e. checks that the outputs of the software during the test against the expected outputs. So, for example, in a <a href="http://pyunit.sourceforge.net/">PyUnit </a>test that compares the outputs of a function, for some specific inputs, to some hard-coded values, the comparison code hard-coded values serve as the oracle. If a developer tests a GUI and assesses the correctness of its behaviour then they are serving as the oracle. Douglas Hoffman&#8217;s paper <a href="http://www.softwarequalitymethods.com/Papers/OracleTax.pdf">A Taxonomy for Test Oracles</a> </span><span style="color: #ffffff;">from Quality Week, 1998, gives an overview and taxonomy of oracles.</span></p>
<p><span style="color: #ffffff;">For question 1, an internet search did not reveal any Python frameworks that explicitly support tests that involve comparing floating point data files for equality. </span><span style="color: #ffffff;">Even if a framework were available, there would still be work required by the developer to customise it towards the structure and content of their specific files. </span><span style="color: #ffffff;">Two frameworks which adopt such a solution and provide something close to Philip&#8217;s requirements are <a href="http://bitheap.org/cram/">Cram</a><span style="color: #ffffff;"> and <a href="http://texttest.carmen.se/">TextTest</a></span></span><span style="color: #ffffff;">. <a href="http://bitheap.org/cram/">Cram</a><span style="color: #ffffff;"> i</span>s a framework for testing command-line applications. It runs commands and compares their outputs to expected outputs.  The outputs are compared using pattern matching and regular expressions. <a href="http://texttest.carmen.se/">TextTest </a>is similar but also has support for GUI testing. Outputs are compared directly, but filters are provided to handle run dependant content and floating point differences outwith user-defined tolerances.</span></p>
<p><span style="color: #ffffff;">One can envisage at least two general approaches to comparing output files of floating point values to reference files. The first is to:</span></p>
<ul>
<li><span style="color: #ffffff;">Write a convertor that can be used to convert the output file data format into a simpler format containing just the floating point data.</span></li>
<li><span style="color: #ffffff;">Write a validator that takes in two floating point data sets and compares these, applying rounding or allowing for equality within defined tolerances.</span></li>
<li><span style="color: #ffffff;">Write each test to load the expected results from the reference files, the actual results from the output files, apply the convertor to both sets of results, then use the validator compare the two.</span></li>
</ul>
<p><span style="color: #ffffff;">The second is to:</span></p>
<ul>
<li><span style="color: #ffffff;">Manually convert the reference files into template files. Regular expressions can be used to both handle parts of the files that might vary across test runs (e.g. headers) as well as for specifying expected floating point values.</span></li>
<li><span style="color: #ffffff;">Write a validator which compares an output file to a reference file, applying the regular expressions in the reference file to assess whether the output file matches.</span></li>
<li><span style="color: #ffffff;">Write each test to apply the validator, comparing the output files to the reference files.</span></li>
</ul>
<p><span style="color: #ffffff;">Personally, I prefer the former solution as it avoids messing around with regular expressions.</span></p>
<p><span style="color: #ffffff;">For either solution, there are a number of Python libraries that can be used to construct a possible solution. These include:</span></p>
<ul>
<li><span style="color: #ffffff;"><a href="http://docs.python.org/library/unittest.html">PyUnit</a></span><span style="color: #ffffff;">, Python&#8217;s unit test library. This has test assertion commands (assertAlmostEqual and assertNotAlmostEqual) for comparing floating point values to a specific number of decimal places or within a specific tolerance.</span></li>
<li><span style="color: #ffffff;">Python <a href="http://docs.python.org/library/difflib.html">difflib</a></span><span style="color: #ffffff;"> library. This provides functions to compare two files and return the lines for which they differ. This is similar to the output from CVS and SVN &#8220;diff&#8221; commands. <a href="http://bitheap.org/cram/">Cram</a> uses <a href="http://docs.python.org/library/difflib.html">difflib</a>.</span></li>
<li><span style="color: #ffffff;">Python <a href="http://docs.python.org/library/re.html">re</a></span><span style="color: #ffffff;"> regular expression library. <a href="http://bitheap.org/cram/">Cram</a> uses <a href="http://docs.python.org/library/re.html">re</a>.</span></li>
<li><span style="color: #ffffff;">Python <a href="http://docs.python.org/library/filecmp.html">filecmp</a> file comparison library</span><span style="color: #ffffff;">.</span></li>
<li><span style="color: #ffffff;">An introduction to <a href="http://www.regular-expressions.info/floatingpoint.html">writing regular expressions for floating point numbers</a>.</span></li>
<li><span style="color: #ffffff;"><a href="http://texttest.carmen.se/">TextTest </a>(<a href="http://bazaar.launchpad.net/~geoff.bache/texttest/trunk/files">source code</a></span><span style="color: #ffffff;">) and <a href="http://bitheap.org/cram/">Cram</a> (<a href="http://bitbucket.org/brodie/cram">source code</a></span><span style="color: #ffffff;">) are both open source products and it might be possible to reuse their functionality for comparing script files.</span></li>
<li><span style="color: #ffffff;"><a href="http://code.google.com/p/hamcrest/">Hamcrest </a>library for building &#8220;matchers&#8221; which are useful for expressing custom comparisons. It has been ported to many languages including Python.</span></li>
</ul>
<p><span style="color: #ffffff;">Mike</span></p>
<p><span style="color: #ffffff;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=212</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choosing suitable open-source software</title>
		<link>http://asksteve.software.ac.uk/?p=202</link>
		<comments>http://asksteve.software.ac.uk/?p=202#comments</comments>
		<pubDate>Wed, 26 Oct 2011 12:51:04 +0000</pubDate>
		<dc:creator>SteveCrouch</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=202</guid>
		<description><![CDATA[At the SeIUCCR Summer School in September I was asked a blinder of a question:
&#8220;How do I choose sustainable software for my project?&#8221;
Assuming an open-source context for this question, there are many things worth considering. It could be that the functionality of your software needs extended. Not wanting to re-invent the wheel, you&#8217;re looking for [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ffffff;">At the <a title="SSI blog article on the SeIUCCR Summer School" href="http://software.ac.uk/blog/2011-10-07-ssi-seiuccr-summer-school-0" target="_blank">SeIUCCR Summer School in September</a> I was asked a blinder of a question:</span></p>
<p style="padding-left: 30px;"><span style="color: #ffffff; "><em>&#8220;How do I choose sustainable software for my project?&#8221;</em></span></p>
<p><span style="color: #ffffff; ">Assuming an open-source context for this question, there are many things worth considering. It could be that the functionality of your software needs extended. Not wanting to re-invent the wheel, you&#8217;re looking for an appropriate library to provide that functionality. Or perhaps you have an analysis tool that outputs a certain data format that you need to post-process into an image. What should you look for in software?</span></p>
<p><span style="color: #ffffff; ">It&#8217;s easy to reach for the first software package you come across that seems to do what you want. Perhaps it&#8217;s already installed in your target platform, or it&#8217;s the first thing you found on Google. But picking the wrong software can have expensive consequences if it doesn&#8217;t do everything you want or, even worse, development and support comes to a stop!</span></p>
<p><span style="color: #ffffff; ">Taking a little time to make an informed choice is time well spent. So what questions can you ask about the software to find out if it&#8217;s suitable?</span></p>
<p><span style="color: #ffffff;">First off, and most obvious: does it do what you want? Be sure you know your requirements, not only what you need now, but what you need in the future. What are the goals? If it&#8217;s for a wider community, think about the goals of the user community too. If the software doesn&#8217;t meet your needs, you should check </span><span style="color: #ffffff;">to see if the functionality can be extended, or look </span><span style="color: #ffffff;">for more suitable software.</span></p>
<p><span style="color: #ffffff;">Have a look at the software&#8217;s support, and check for an active user and developer community. Check the forums, issue tracker and mailing lists (they should have them!) for activity and responsiveness. If you run into problems, support is your first port of call, so it must be good.<br />
</span></p>
<p><span style="color: #ffffff;">Most importantly, check that the software has a future! If the software&#8217;s development and support were to stop, you could find yourself looking around for a replacement. This is ultimately what you are trying to avoid! Some positive indicators for sustainability &#8211; in addition to a well established community &#8211; are a roadmap, a solid track record of previous releases and an actively maintained website. If you are aware of appropriate open standards that are commonly used within your research field, does the software use them?</span></p>
<p><span style="color: #ffffff;">How is the software is provided? Check that documentation is available, and whether the pre-requisites for the software are appropriate for your needs. If you plan to extend the software then access to appropriate source code is very  important &#8211; is it provided via a source code repository, and is the code in an understandable and maintainable state that you can extend?</span></p>
<p><span style="color: #ffffff;">Perhaps the most important of all, check the licence conditions of the software. If you intend to distribute the software, check that the licence allows this, and check that you can distribute any modifications or extensions you make.</span></p>
<p><span style="color: #ffffff;">Of course, with such a complex question, there&#8217;s always more to know. Check out the Software Sustainability Institute&#8217;s guide on <a href="http://www.software.ac.uk/choosing-right-open-source-software-your-project#node-344">Choosing the right open source software for your project</a>, which goes into more detail.</span></p>
<p><span style="color: #ffffff;">Lastly, don&#8217;t be afraid to ask the software developers if you have any questions. If you get prompt and helpful responses, that&#8217;s a good indication you&#8217;ll be able to get the right support should you need it. If not, it might be time to look elsewhere. Now where did you put that list of alternatives&#8230;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=202</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Security Decay: Enter the Dragon!</title>
		<link>http://asksteve.software.ac.uk/?p=185</link>
		<comments>http://asksteve.software.ac.uk/?p=185#comments</comments>
		<pubDate>Mon, 12 Sep 2011 09:12:22 +0000</pubDate>
		<dc:creator>SteveCrouch</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=185</guid>
		<description><![CDATA[Security in complex systems is always a tricky business. Consider production Grid infrastructures as an example. The intricacies of establishing working trust relationships between the users and the infrastructure, and between the systems themselves, is a mammoth task. Solving problems with such systems is also very tricky, as I&#8217;ve previously found when developing EU-wide Grid [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #ffffff;">Security in complex systems is always a tricky business. Consider production Grid infrastructures as an example. The intricacies of establishing working trust relationships between the users and the infrastructure, and between the systems themselves, is a mammoth task. Solving problems with such systems is also very tricky, as I&#8217;ve previously found when developing <a title="Interoperability demonstrator at OGF28" href="http://www.omii.ac.uk/news/news.jhtml?nid=318" target="_blank">EU-wide Grid interoperability demonstrators of open standards</a>. They appear like dragons: huge, daunting, and difficult to defeat.</span></strong></p>
<p><span style="color: #ffffff;">The <a title="The UK National Grid Service" href="http://www.ngs.ac.uk/" target="_blank">UK National Grid Service</a> asked Steve (well, the Institute <em>really</em>) to help them out with their SARoNGS system. Our arrangement was very effective. The Software Sustainability Institute provided development effort for the investigation, whilst the NGS fixed issues and offered the in-depth systems knowledge that only they could provide.</span></p>
<p><span style="color: #ffffff;">So what is SARoNGS all about? The <a title="SARoNGS" href="https://cts.ngs.ac.uk/" target="_blank">Shibboleth Access to Resources on the NGS</a> service greatly simplifies authentication to NGS resources by accepting institutional Shibboleth credentials. It&#8217;s great for users, because they don&#8217;t need to apply for, own and use an X509 certificate. However, it appeared that the automatically generated SARoNGS certificates were being rejected by the <a title="NGS Workload Management System" href="http://www.ngs.ac.uk/uiwms" target="_blank">NGS&#8217;s Workload Management Service</a> (WMS). In short, you could no longer use SARoNGS certificates to submit jobs through the WMS without seeing a rather ominous error light up the screen:</span></p>
<p style="padding-left: 30px;"><span style="color: #ffffff;"><em>Connection failed: CA certificate verification failed</em></span></p>
<p><span style="color: #ffffff; ">We were warned <a title="Here be dragons! (and Workload Management Systems)" href="http://software.ac.uk/news/2011-05-31-here-be-dragons-and-workload-management-systems" target="_blank">here be dragons</a>, but we ploughed on heedless of the danger.</span></p>
<p><span style="color: #ffffff;">You may have heard of <em>software decay</em>. This can occur when the environment around a piece of software changes, which leads to failures in the system as a whole. For example, an update to a dependent library or to the operating system could cause a problem. Updating one of the ubiquitous jar files in Java, only to find some of the API functions have become deprecated, can also cause grief. The good news is that there are things you can do to avoid this problem, some of which I&#8217;ve <a title="How to develop code to avoid dependency problems" href="http://asksteve.software.ac.uk/?p=97" target="_blank">looked at already</a>.</span></p>
<p><span style="color: #ffffff;">Security problems are often esoteric and difficult to solve. The problem could be a software dependency issue, say a newly updated security library with a bug that incorrectly interprets certificate attributes. It could also be a problem with the way in which trust relationships are defined. Sophisticated production Grid systems often trust a veritable legion of Certificate Authorities (CAs). Each CA has its own CA trust certificates, Certificate Revocation Lists (CRLs &#8211; a list of certificates not to trust) and signing policies. (I won&#8217;t get into how VOMS fits into the picture in this post, but if you&#8217;re interested, <a href="mailto:asksteve@software.ac.uk">let me know</a>.) Sorting out certificate problems can be like looking for a needle in a haystack&#8230; in a tornado. However, once identified, these issues are often easy to fix.</span></p>
<p><span style="color: #ffffff;">Systems can also fail when you haven&#8217;t changed anything at all</span><span style="color: #ffffff;">, and this was the case with the first problem we found with SARoNGS.</span></p>
<p><span style="color: #ffffff;">Time is an important concept in security. For example, the NGS proxy certificates have a limited lifetime to reduce their vulnerability if the proxy is compromised. CRLs must also be kept up to date. The problem with expired CRLs is that they can cause the entire authentication step to fail, and this is what had happened with SARoNGS: a CRL in a critical location had expired. We updated the CRL and the first dragon lay dead on our screens!</span></p>
<p><span style="color: #ffffff;">When establishing trust in Grid systems, you need to decide which certificates to trust and where in the system to trust them. The second problem with SARoNGS was caused by two different signing policies being simultaneously. Some sites were intentionally configured to trust SARoNGS, and others were not. However, the installation of an update using the <a title="The International Grid Trust Federation" href="http://www.igtf.net/" target="_blank">International Grid Trust Federation (IGTF) bundle</a> meant that the UK e-Science signing policy reverted to the IGTF default: do not trust SARoNGS certificates. Again, an easy problem to fix, but a difficult one to identify. Once SARoNGS trust was reinstated in the signing policy (we used a modified NGS IGTF+ bundle) the problem was resolved and the last dragon soundly defeated.</span></p>
<p><span style="color: #ffffff;"> </span><span style="color: #ffffff;">And so the legend goes, the dragons of SARoNGS were slain. If you ever find yourself developing Grid software and run into a security brick wall, why not take a look at those conspicuous looking CRL and signing policy files? They could be dragons. And dragons need slaying!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=185</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>As a developer, why should you care about the research field you work in?</title>
		<link>http://asksteve.software.ac.uk/?p=147</link>
		<comments>http://asksteve.software.ac.uk/?p=147#comments</comments>
		<pubDate>Wed, 27 Jul 2011 15:41:41 +0000</pubDate>
		<dc:creator>SteveCrouch</dc:creator>
				<category><![CDATA[Collaboration]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=147</guid>
		<description><![CDATA[&#8220;Programming is 10% science, 20% ingenuity, and 70% getting the ingenuity to work with the science.&#8221; &#8211; Anon
Software developers working on an academic research project will, unsurprisingly, do just that: develop software. But to what extent should a developer care about the research field in which they work? This and other related questions have popped [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><span style="color: #ffffff;"><em>&#8220;Programming is 10% science, 20% ingenuity, and 70% getting the ingenuity to work with the science.&#8221;</em> &#8211; Anon</span></p></blockquote>
<p><span style="color: #ffffff; ">Software developers working on an academic research project will, unsurprisingly, do just that: develop software. But to what extent should a developer care about the research field in which they work? This and other related questions have popped up a few times recently, and this theme also permeated a few sessions at our <a title="The Institute's Collaboration Workshop, March 2011" href="http://software.ac.uk/home/cw11" target="_blank">Collaborations Workshop back in March</a>.</span></p>
<p><span style="color: #ffffff; ">The first thing to realise is that researchers and software developers both use long words, but they are generally different long words. Each group comprises experts (in their own discipline), but each group has its own language. For example (with elementary translations in [ ]) &#8230;</span></p>
<blockquote><p><span style="color: #ffffff; ">Researcher: <em>Can you imagine what we could do with a more timely lattice energy landscape minimisation for these carbolyxate salts!? [If only we could do our calculations faster!]</em></span></p>
<p><span style="color: #ffffff;">Developer: <em>Nope &#8211; does it have something to do with matrices?</em></span></p>
<p><span style="color: #ffffff;"><em><br />
</em></span></p>
<p><span style="color: #ffffff; ">Developer: <em>Did you see that amazing multi-threaded C++ app for distributed </em><em>p</em></span><span style="color: #ffffff; "><em>roblem solving for Android appear on the appstore last night? [Just imagine how many calculations you could do in a shorter space of time - on a smartphone!]</em></span></p>
<p><span style="color: #ffffff;">Researcher: <em>Sorry, I</em><em> don&#8217;t watch Star Trek</em></span></p></blockquote>
<p><span style="color: #ffffff; ">Ok, so this is a little oversimplified. But such a disparity in communication means that real opportunities are missed. How do developers make sure that they understand the importance of what researchers are saying, and vice versa?</span></p>
<p><span style="color: #ffffff; ">Developers and researchers are waking up to what can be achieved if they work together, and find ways to communicate effectively. </span><span style="color: #ffffff;">As developers, we shouldn&#8217;t expect researchers to automatically believe in our religious arguments about proper software design. But if we understand the science a little bit better, then we increase our chance of identifying ways to improve the science through what we know of software &#8211; and there lies the true benefit for researchers. You only have to look at the successes of <a title="The Taverna software - an open source and domain-independent Workflow Management System" href="http://www.taverna.org.uk/" target="_blank">Taverna</a>, <a title="OGSA-DAI - a framework for the access, management and integration of distributed, heterogeneous data resources" href="http://www.epcc.ed.ac.uk/projects/ogsa-dai" target="_blank">OGSA-DAI</a>, <a title="GridSAM - an open standards-based job submission interface for submitting computational jobs to many commonly used distributed resource management systems" href="http://www.omii.ac.uk/wiki/GridSAM" target="_blank">GridSAM</a> and the <a title="The ENGAGE Project final report" href="http://www.omii.ac.uk/attach/BoardMeeting/ENGAGE%20Final%20Report%20v06.pdf" target="_blank">ENGAGE projects</a> to see what is possible when researchers and software developers come together in the right way. In the <a title="CPOSS ENGAGE project" href="http://www.omii.ac.uk/wiki/Nwsltr1209CPOSS" target="_blank">CPOSS ENGAGE</a> project, the improved coupling of a number of software technologies enabled them to perform science that wasn&#8217;t even possible before.</span></p>
<p><span style="color: #ffffff;">Of course, taking the time to learn more about the science takes effort. But if you go that extra mile every once in a while, digging a little deeper into the science behind the software you&#8217;re writing, who knows? Software and software infrastructures have a lot to offer research, and you may just be the one to help the scientists make that important discovery.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=147</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use software in your project? After some travel money? Become an Agent!</title>
		<link>http://asksteve.software.ac.uk/?p=167</link>
		<comments>http://asksteve.software.ac.uk/?p=167#comments</comments>
		<pubDate>Fri, 22 Jul 2011 08:54:00 +0000</pubDate>
		<dc:creator>SteveCrouch</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=167</guid>
		<description><![CDATA[One of the big problems with research, particularly in these austeric times, is finding the money to travel to all those great conferences. You miss opportunities to present your work, and you can miss out on discovering first hand what else is afoot in your research field.
The great news is that if you use software [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">One of the big problems with research, particularly in these austeric times, is finding the money to travel to all those great conferences. You miss opportunities to present your work, and you can miss out on discovering first hand what else is afoot in your research field.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">The great news is that if you use software in your research and you have a good understanding of what&#8217;s happening in your field, funding is available from the SSI to help you with this conference travel trouble. Regardless of discipline, the SSI will pay a number of select researchers £3000 a year &#8211; in return for keeping us up to date on the latest developments in the field. This obviously helps you with disseminating your greatness and keeping up to date, while allowing us to build a network of Agents to understand which fields most need our help.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">There are some compelling benefits to consider:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">- Up to £3000 a year to attend the conferences and events that you want to attend</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">- Your advocacy will ensure that your field benefits from the best support for software development</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">- Add world-leading researchers to your professional network</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">- Free attendance at training events for new tools and technologies</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">- If you develop code, improve your knowledge of effective techniques for developing sustainable software</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">- A great addition to your CV</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">Not bad eh? And you don&#8217;t have to be a professor or Principle Investigator to qualify &#8211; you just need to be &#8216;in the know&#8217;. The SSI are looking for applicants from all disciplines, especially from those fields flagged as strategically important to UK research: the ageing population, environment and climate change, the digital economy, energy and food security.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">The closing date for applications is 8th August 2011. If you&#8217;re interested, or would like to nominate someone else, why not find out more and apply:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">http://software.ac.uk/join-our-agents-network</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">Plus, saying &#8216;I&#8217;m an Agent for the SSI&#8217; sounds cool.</div>
<p><span style="color: #ffffff;"><img class="size-full wp-image-175 alignright" style="margin-left: 8px; margin-right: 8px;" title="AgentSq72dpi" src="http://asksteve.software.ac.uk/wp-content/uploads/2011/07/AgentSq72dpi.jpg" alt="AgentSq72dpi" width="240" height="183" />One of the big problems with research, particularly in these austere times, is finding the money to travel to all those great conferences. You miss opportunities to present your work, and you can miss out on discovering first hand what is afoot in your research field.</span></p>
<p><span style="color: #ffffff;">The great news is that if you use software in your research and you have a good understanding of what&#8217;s happening in your field, funding is available from the <a title="The Software Sustainability Institute" href="http://www.software.ac.uk" target="_blank">Software Sustainability Institute</a>. Regardless of discipline, the Institute will pay a number of researchers £3000 a year &#8211; in return for keeping the institute up to date on the latest developments in the researcher&#8217;s field. This helps you with disseminating your greatness and keeping up to date, while allowing the institute to build a network of Agents to understand which fields most need help.</span></p>
<p><span style="color: #ffffff;">There are some compelling benefits to consider:</span></p>
<ul>
<li><span style="color: #ffffff;">Up to £3000 a year to attend the conferences and events that you want to attend</span></li>
<li><span style="color: #ffffff;">Your advocacy will ensure that your field benefits from the best support for software development</span></li>
<li><span style="color: #ffffff;">Add world-leading researchers to your professional network</span></li>
<li><span style="color: #ffffff;">Free attendance at training events for new tools and technologies</span></li>
<li><span style="color: #ffffff;">If you develop code, improve your knowledge of effective techniques for developing sustainable software</span></li>
<li><span style="color: #ffffff;">A great addition to your CV</span></li>
</ul>
<p><span style="color: #ffffff;">Not bad eh? And you don&#8217;t have to be a professor or Principle Investigator to qualify &#8211; you just need to be <em>in the know</em>. The institute are looking for applicants from all disciplines, especially from those fields flagged as strategically important to UK research: the ageing population, environment and climate change, the digital economy, energy and food security.</span></p>
<p><span style="color: #ffffff;">The closing date for applications is 8th August 2011. If you&#8217;re interested, or would like to nominate someone else, why not find out more and apply at </span><span style="color: #ffffff;"><a title="Register to become an SSI agent" href="http://software.ac.uk/join-our-agents-network" target="_blank">http://software.ac.uk/join-our-agents-network</a>?</span></p>
<p><span style="color: #ffffff;">Plus, saying &#8216;I&#8217;m an Agent for the SSI&#8217; sounds cool.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=167</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A unit test framework in MATLAB?</title>
		<link>http://asksteve.software.ac.uk/?p=136</link>
		<comments>http://asksteve.software.ac.uk/?p=136#comments</comments>
		<pubDate>Wed, 13 Jul 2011 15:35:55 +0000</pubDate>
		<dc:creator>SteveCrouch</dc:creator>
				<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://asksteve.software.ac.uk/?p=136</guid>
		<description><![CDATA[You may recall a while back I looked at test-driven development, and covered unit testing. Well, I received a related question asking whether there was a unit test framework for MATLAB, so let&#8217;s have a quick look at a few of these&#8230;
Arguably the most popular is the xUnit Test Framework, which is compatible with MATLAB [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #ffffff;">Yo</span><span style="color: #ffffff;"><span style="color: #ffffff;">u may recall a while back I looked at <a title="Test-driven development" href="http://asksteve.software.ac.uk/?p=8" target="_blank">test-driven development</a>, and covered unit testing. Well, I receiv</span>ed a related question asking whether there was a unit test framework for <a title="MATLAB from MathWorks" href="http://www.mathworks.co.uk/programs/techkits/techkit_ml_b2.html?ref=ggl&amp;s_cid=adw_uk_search_matlab_kit" target="_blank">MATLAB</a>, so let&#8217;s have a quick look at a few of these&#8230;</span></strong></p>
<p><span style="color: #ffffff;">Arguably the most popular is the <a title="xUnit Test Framework" href="http://www.mathworks.com/matlabcentral/fileexchange/22846-matlab-xunit-test-framework" target="_blank">xUnit Test Framework</a>, which is compatible with MATLAB 7.6 (R2008a) or later. You can write unit tests using the standard MATLAB function files, or xUnit-style subclasses (like Java JUnit) and it has comprehensive documentation. There is also a very good technical article on <a title="Automated Software Testing for MATLAB on Slideshare" href="http://www.slideshare.net/Softwarecentral/automated-software-testing-for-matlab" target="_blank">Automated Software Testing for MATLAB</a> which is aimed at researchers wanting to do unit testing in xUnit, complete with examples and advice. Greg Wilson from the excellent <a title="Software Carpentry" href="http://software-carpentry.org/" target="_blank">Software Carpentry</a> project contributed to the article, and the Software Carpentry site has many general <a title="MATLAB tutorials - Software Carpentry" href="http://software-carpentry.org/4_0/matlab/" target="_blank">tutorials on using MATLAB</a>.</span></p>
<p><span style="color: #ffffff;">There are others, including <a title="mlunit_2008a" href="http://www.mathworks.co.uk/matlabcentral/fileexchange/21888" target="_blank">mlunit_2008a</a>, which may also be worth a look, as well as the interesting <a title="Doctest for MATLAB" href="http://www.mathworks.com/matlabcentral/fileexchange/28862-doctest-embed-testable-examples-in-your-functions-help-comments" target="_blank">Doctest</a> for MATLAB, which works like doctest in Python &#8211; you embed simple tests into the function&#8217;s help description in the code. For example, you could specify in a MATLAB function:</span></p>
<pre><span style="color: #ffffff;">function sum = subtract2(value)
</span><span style="color: #ffffff;">% subtracts 2 from a number
</span><span style="color: #ffffff;">%
</span><span style="color: #ffffff;">% subtract2(value)
</span><span style="color: #ffffff;">% returns (value - 2)
</span><span style="color: #ffffff;">%
</span><span style="color: #ffffff;">% Examples:
</span><span style="color: #ffffff;">% &gt;&gt; subtract2(3)
</span><span style="color: #ffffff;">% ans =
</span><span style="color: #ffffff;">% 1
</span><span style="color: #ffffff;">%
</span><span style="color: #ffffff;">% &gt;&gt;subtract2([8 5])
</span><span style="color: #ffffff;">% ans =
</span><span style="color: #ffffff;">% 6 2
</span><span style="color: #ffffff; line-height: 15px;">if ~ isnumeric(value) 
</span><span style="color: #ffffff; line-height: 15px;"> error('subtract2(value) requires value to be a number'); 
</span><span style="color: #ffffff; line-height: 15px;">end
</span><span style="color: #ffffff; line-height: 15px;">sum = value - 2;</span></pre>
<p><span style="color: #ffffff;">Then you can run <em>doctest subtract2</em> and have those embedded tests returned:</span></p>
<pre><span style="color: #ffffff;">TAP version 1.3
</span><span style="color: #ffffff;">1.3
</span><span style="color: #ffffff;">ok 1 - "subtract2(3)"
</span><span style="color: #ffffff;">ok 2 - "subtract2([8 5])"</span></pre>
<p><span style="color: #ffffff;">It would depend on what the nature of the tests you wish to write, and how complex, as to whether this approach is suitable.</span></p>
<p><span style="color: #ffffff;">&#8217;til next time!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://asksteve.software.ac.uk/?feed=rss2&amp;p=136</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

