<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "http://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="methods-article" dtd-version="1.2" xml:lang="en">
    <front>
        <journal-meta>
            <journal-id journal-id-type="pmc">F1000Research</journal-id>
            <journal-title-group>
                <journal-title>F1000Research</journal-title>
            </journal-title-group>
            <issn pub-type="epub">2046-1402</issn>
            <publisher>
                <publisher-name>F1000 Research Limited</publisher-name>
                <publisher-loc>London, UK</publisher-loc>
            </publisher>
        </journal-meta>
        <article-meta>
            <article-id pub-id-type="doi">10.12688/f1000research.9315.1</article-id>
            <article-categories>
                <subj-group subj-group-type="heading">
                    <subject>Method Article</subject>
                </subj-group>
                <subj-group>
                    <subject>Articles</subject>
                    <subj-group>
                        <subject>Bioinformatics</subject>
                    </subj-group>
                    <subj-group>
                        <subject>Theoretical &amp; Computational Neuroscience</subject>
                    </subj-group>
                    <subj-group>
                        <subject>Theory &amp; Simulation</subject>
                    </subj-group>
                </subj-group>
            </article-categories>
            <title-group>
                <article-title>Unit testing, model validation, and biological simulation</article-title>
                <fn-group content-type="pub-status">
                    <fn>
                        <p>[version 1; peer review: 2 approved, 1 approved with reservations]</p>
                    </fn>
                </fn-group>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author" corresp="no" equal-contrib="yes">
                    <name>
                        <surname>Sarma</surname>
                        <given-names>Gopal P.</given-names>
                    </name>
                    <uri content-type="orcid">https://orcid.org/0000-0002-9413-6202</uri>
                    <xref ref-type="aff" rid="a1">1</xref>
                    <xref ref-type="aff" rid="a6">6</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no" equal-contrib="yes">
                    <name>
                        <surname>Jacobs</surname>
                        <given-names>Travis W.</given-names>
                    </name>
                    <xref ref-type="aff" rid="a2">2</xref>
                    <xref ref-type="aff" rid="a6">6</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Watts</surname>
                        <given-names>Mark D.</given-names>
                    </name>
                    <xref ref-type="aff" rid="a3">3</xref>
                    <xref ref-type="aff" rid="a6">6</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Ghayoomie</surname>
                        <given-names>S. Vahid</given-names>
                    </name>
                    <xref ref-type="aff" rid="a4">4</xref>
                    <xref ref-type="aff" rid="a6">6</xref>
                </contrib>
                <contrib contrib-type="author" corresp="yes">
                    <name>
                        <surname>Larson</surname>
                        <given-names>Stephen D.</given-names>
                    </name>
                    <xref ref-type="corresp" rid="c1">a</xref>
                    <xref ref-type="aff" rid="a6">6</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Gerkin</surname>
                        <given-names>Richard C.</given-names>
                    </name>
                    <xref ref-type="aff" rid="a5">5</xref>
                    <xref ref-type="aff" rid="a6">6</xref>
                </contrib>
                <aff id="a1">
                    <label>1</label>School of Medicine, Emory University, Atlanta, USA</aff>
                <aff id="a2">
                    <label>2</label>Department of Bioengineering, Imperial College London, London, UK</aff>
                <aff id="a3">
                    <label>3</label>The University of Texas at Austin, Austin, USA</aff>
                <aff id="a4">
                    <label>4</label>Laboratory of Systems Biology and Bioinformatics, University of Tehran, Tehran, Iran</aff>
                <aff id="a5">
                    <label>5</label>School of Life Sciences, Arizona State University, Tempe, USA</aff>
                <aff id="a6">
                    <label>6</label>OpenWorm Foundation, Boston, USA</aff>
            </contrib-group>
            <author-notes>
                <corresp id="c1">
                    <label>a</label>
                    <email xlink:href="mailto:stephen@openworm.org">stephen@openworm.org</email>
                </corresp>
                <fn id="fn1">
                    <label>*</label>
                    <p>Joint first authors</p>
                </fn>
                <fn id="fn2">
                    <label>&#x2020;</label>
                    <p>Joint senior authors</p>
                </fn>
                <fn fn-type="con">
                    <p>GPS, TWJ, SDL, and RCG wrote the manuscript. All authors contributed to the unit testing framework in the Open Worm project.</p>
                </fn>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>10</day>
                <month>8</month>
                <year>2016</year>
            </pub-date>
            <pub-date pub-type="collection">
                <year>2016</year>
            </pub-date>
            <volume>5</volume>
            <elocation-id>1946</elocation-id>
            <history>
                <date date-type="accepted">
                    <day>2</day>
                    <month>8</month>
                    <year>2016</year>
                </date>
            </history>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2016 Sarma GP et al.</copyright-statement>
                <copyright-year>2016</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access article distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <self-uri content-type="pdf" xlink:href="https://f1000research.com/articles/5-1946/pdf"/>
            <abstract>
                <p>The growth of the software industry has gone hand in hand with the development of tools and cultural practices for ensuring the reliability of complex pieces of software. These tools and practices are now acknowledged to be essential to the management of modern software. As computational models and methods have become increasingly common in the biological sciences, it is important to examine how these practices can accelerate biological software development and improve research quality. In this article, we give a focused case study of our experience with the practices of unit testing and test-driven development in 
                    <italic toggle="yes">OpenWorm</italic>, an open-science project aimed at modeling 
                    <italic toggle="yes">Caenorhabditis elegans</italic>. We identify and discuss the challenges of incorporating test-driven development into a heterogeneous, data-driven project, as well as the role of 
                    <italic toggle="yes">model validation tests</italic>, a category of tests unique to software which expresses scientific models.</p>
            </abstract>
            <kwd-group kwd-group-type="author">
                <kwd>model</kwd>
                <kwd>biology</kwd>
                <kwd>software</kwd>
                <kwd>validation</kwd>
                <kwd>C. elegans</kwd>
                <kwd>testing</kwd>
                <kwd>quality control</kwd>
            </kwd-group>
            <funding-group>
                <funding-statement>This work was funded in part by NIMH (R01MH106674, RCG), and NIBIB (R01EB021711, RCG; and R01EB014640, Sharon M. Crook).</funding-statement>
                <funding-statement>
                    <italic>The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</italic>
                </funding-statement>
            </funding-group>
        </article-meta>
    </front>
    <body>
        <sec sec-type="intro">
            <title>Introduction</title>
            <p>Software plays an increasingly prominent role in the biological sciences. This growth has been driven by an explosion in the availability of data and the parallel development of software to store, share, and analyze this data. In addition, simulations have also become a common tool in both fundamental and applied research
                <sup>
                    <xref ref-type="bibr" rid="ref-1">1</xref>,
                    <xref ref-type="bibr" rid="ref-2">2</xref>
                </sup>. Simulation management (initialization, execution, and output handling) relies entirely on software.</p>
            <p>Software used for collaborative biological research has an additional level of complexity (beyond that shared by other widely-used software) stemming from the need to incorporate and interact with the 
                <italic toggle="yes">results</italic> of scientific research, in the form of large datasets or dynamical models. This added level of complexity suggests that technical tools and cultural practices for ensuring software reliability are of particular importance in the biological sciences
                <sup>
                    <xref ref-type="bibr" rid="ref-3">3</xref>
                </sup>.</p>
            <p>In this article, we discuss our experience in applying a number of basic practices of industrial software engineering&#x2014;broadly known as 
                <italic toggle="yes">unit testing</italic> and the related concept of 
                <italic toggle="yes">test-driven development</italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-4">4</xref>&#x2013;
                    <xref ref-type="bibr" rid="ref-7">7</xref>
                </sup>&#x2014;in the context of the OpenWorm project. OpenWorm (
                <ext-link ext-link-type="uri" xlink:href="http://www.openworm.org">http://www.openworm.org</ext-link>) is an international, collaborative open-science project aimed at integrating the world&#x2019;s collective scientific understanding of the 
                <italic toggle="yes">C. elegans</italic> round worm into a single computational model
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>
                </sup>. It is a diverse project incorporating data, simulations, powerful but intuitive user interfaces, and visualization. Since the goal of the project is to simulate an entire organism, the project and its underlying code are necessarily complex. The scope of the project is immense &#x2013; OpenWorm has over fifty contributors from sixteen countries and projects divided into over forty-five sub-repositories under version control containing a total of hundreds of thousands of lines of code. For a project of this magnitude to remain manageable and sustainable, a thorough testing framework and culture of test-driven development is essential
                <sup>
                    <xref ref-type="bibr" rid="ref-4">4</xref>&#x2013;
                    <xref ref-type="bibr" rid="ref-7">7</xref>
                </sup>. In 
                <xref ref-type="fig" rid="f1">Figure 1</xref>, we show a diagrammatic overview of the many projects within OpenWorm and the relationship of testing to each of these. For extremely small projects, unit testing simply adds an overhead with little or no return on the time investment. As the project grows in size, however, the gains are quite significant, as the burden on the programmers of maintaining a large project can be substantially reduced.</p>
            <fig fig-type="figure" id="f1" orientation="portrait" position="float">
                <label>Figure 1. </label>
                <caption>
                    <title>Diagram of some of the key OpenWorm modules and their corresponding testing frameworks.</title>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/10031/d1064a99-68aa-41bc-8fb6-8c50580e0b3b_figure1.gif"/>
            </fig>
            <p>In the code excerpts below, we will discuss 4 types of tests that are used in the OpenWorm code-base. They are:</p>
            <list list-type="bullet">
                <list-item>
                    <p>
						
                        <bold>Verification tests:</bold> These are tests of basic software correctness and are not unique to the scientific nature of the project.</p>
                </list-item>
                <list-item>
                    <p>
						
                        <bold>Data integrity tests:</bold> These are tests unique to a project which incorporates data. Among other purposes, these tests serve as basic sanity checks verifying, for instance, that each piece of data in the project is associated with a scientific paper and corresponding DOI.</p>
                </list-item>
                <list-item>
                    <p>
						
                        <bold>Biological integrity tests:</bold> These are tests that verify correspondence with known information about static parameters that characterize 
                        <italic toggle="yes">C. Elegans</italic>, for example, the total number of neurons.</p>
                </list-item>
                <list-item>
                    <p>
						
                        <bold>Model validation tests:</bold> These are tests unique to projects which incorporate dynamic models. Model validation tests (using the Python package 
                        <monospace>SciUnit</monospace>) verify that a given dynamic model (such as the behavior of an ion channel) generates output that is consistent with known behavior from experimental data.</p>
                </list-item>
            </list>
            <p>The target audience for this article is computational biologists who have limited experience with large software projects and are looking to incorporate standard industrial practices into their work, or who anticipate involvement with larger projects in either academia or industry. We also hope that the exposition will be accessible to other scientists interested in learning about computational techniques and software engineering. We hope to contribute to raising the quality of biological software by describing some basic concepts of software engineering in the context of a practical research project.</p>
        </sec>
        <sec>
            <title>Unit testing for scientific software</title>
            <sec>
                <title>A simple introduction to unit testing</title>
                <p>The basic concept behind software testing is quite simple. Suppose we have a piece of code which takes some number of inputs and produces corresponding outputs. A 
                    <italic toggle="yes">unit test</italic>, 
                    <italic toggle="yes">verification test</italic>, or simply 
                    <italic toggle="yes">test</italic> is a function that compares an input-output pair and returns a boolean value 
                    <italic toggle="yes">True</italic> or 
                    <italic toggle="yes">False</italic>. A result of 
                    <italic toggle="yes">True</italic> indicates that the code is behaving as intended, and a result of 
                    <italic toggle="yes">False</italic> indicates that it is not, and consequently, that any program relying on that code cannot be trusted to behave as intended.</p>
                <p>Let us take a simple example. Suppose we have a function that takes a list of numbers and then returns them in sorted order, from lowest to highest. Sorting is a classic algorithmic task, and there are many different sorting algorithms with different performance characteristics; while the specific strategies they employ differ wildly, ultimately the result should be the same for any implementation. A unit test for one&#x2019;s sorting algorithm should take as input a list of numbers, feed it to the sorting algorithm, and then check that each element in the output list is less than or equal to the one that comes after it. The unit test would return 
                    <italic toggle="yes">True</italic> if the output list had that property, and 
                    <italic toggle="yes">False</italic> if not.</p>
                <p>If one has multiple implementations of a sorting algorithm, then one can use a reliable reference implementation as a testing mechanism for the others. In other words, a test might return 
                    <italic toggle="yes">True</italic> if a novel sorting algorithm gives the same result as one widely known to be valid. There are other strategies along these lines. For example, suppose we have an implementation of an algorithm for multiplication called 
                    <monospace>multiply</monospace>. If we have a trusted implementation of an algorithm for addition, we can test that our multiplication algorithm works as expected by checking its behavior against the appropriate number of addition operations, e.g., 
                    <monospace>multiply(3,5) = 3 + 3 + 3 + 3 + 3</monospace>. See 
                    <xref ref-type="other" rid="l1">Listing 1</xref> for an implementation of this test in Python code.</p>
                <p id="l1">
                    <bold>
                        <styled-content style="#CC6538;" style-type="color">Listing 1.</styled-content> Simple test for the multiplication operation.</bold>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve"> 
                        <styled-content style="font-size:15px;">1</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">def</styled-content> 
                        <styled-content style="font-size:15px;">test_multiply():
 2</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    """</styled-content>

                        <styled-content style="font-size:15px;"> 3</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    Test our multiplication function against the</styled-content>

                        <styled-content style="font-size:15px;"> 4</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    standard addition operator</styled-content>

                        <styled-content style="font-size:15px;"> 5</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    """</styled-content>

                        <styled-content style="font-size:15px;"> 6</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">    assert multiply</styled-content>
                        <styled-content style="font-size:15px;">(3, 5) == 3 + 3 + 3 + 3 + 3</styled-content>
                    </preformat>
                </p>
                <p>In the previous example, the hypothetical unit test verified the core functionality of the algorithm. We had an algorithm that claimed to sort things, and we wanted to check that it worked as advertised. But there are many other kinds of tests that we might be compelled to write in order to know that our software is working correctly. For instance, what happens if we feed an empty list to our sorting algorithm (this is an example of an 
                    <italic toggle="yes">edge case</italic>)? Should it simply return the list, generate an error message, or both? What if a user accidentally gives the algorithm something that is not a list, say for example, an image? What should the error message be in this case? Should there be a single error message to cover all cases, or should the error message be tailored to the specific case at hand? One can easily write unit tests to verify that the correct behavior has been implemented in all of these cases.</p>
                <p>The sum total of all of the desired behaviors of an algorithm is called a 
                    <italic toggle="yes">specification</italic>, or 
                    <italic toggle="yes">spec</italic> for short. For instance, the specification for a sorting algorithm might look like the following:</p>
                <list list-type="bullet">
                    <list-item>
                        <p>When given a list of numbers, return the list sorted from smallest to largest.</p>
                    </list-item>
                    <list-item>
                        <p>When given a list of strings, return the list sorted in lexicographic order.</p>
                    </list-item>
                    <list-item>
                        <p>If the input is an empty list, return the empty list and do not generate an error message.</p>
                    </list-item>
                    <list-item>
                        <p>If the input is not a list, generate the error message &#x201c;Input should be a list of real numbers or strings&#x201d;.</p>
                    </list-item>
                    <list-item>
                        <p>If the input is neither a list of strings nor a list of numbers, return the same error message as above.</p>
                    </list-item>
                </list>
                <p>In 
                    <xref ref-type="other" rid="l2">Listing 2</xref>, we have given a suite of unit tests for a sorting algorithm called 
                    <monospace>mySort</monospace> based on this specification. The basic notion demonstrated in the context of the sorting algorithm extends to any piece of software. In OpenWorm, we make extensive use of unit testing to verify both the functional properties of the system, as well as the validity of the data and models that comprise the simulation. For instance, the two tests given below in 
                    <xref ref-type="other" rid="l3">Listing 3</xref> check that any worm model has 302 neurons, and that the number of synapses for a given type of neuron is in accordance with its known value from the scientific literature. We will examine the different types of tests in more detail in the next section.</p>
                <p id="l2">
                    <bold>
                        <styled-content style="#CC6538;" style-type="color">Listing 2.</styled-content> Sample tests for the sorting specification given in the text.</bold> The class 
                    <monospace>SortingTest</monospace> is a container for all of the individual tests that define the specification and can be extended if more tests are added.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve"> 
                        <styled-content style="font-size:15px;">1</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">import</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">random</styled-content>
 
                        <styled-content style="font-size:15px;">2</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">import</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">unittest</styled-content>
 
                        <styled-content style="font-size:15px;">3</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">from</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">my_code</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">import</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">my_sort</styled-content>
 
                        <styled-content style="font-size:15px;">4
 5</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">"""</styled-content>
 
                        <styled-content style="font-size:15px;">6</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">Specification:</styled-content>
 
                        <styled-content style="font-size:15px;">7</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">1) When given a list of numbers,</styled-content>
 
                        <styled-content style="font-size:15px;">8</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">return the list sorted from smallest to largest.</styled-content>
 
                        <styled-content style="font-size:15px;">9
10</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">2) When given a list of strings,</styled-content>

                        <styled-content style="font-size:15px;">11</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">return the list sorted in lexicographic order.</styled-content>

                        <styled-content style="font-size:15px;">12
13</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">3) If the input is an empty list,</styled-content>

                        <styled-content style="font-size:15px;">14</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">return the empty list and do not generate an error message.</styled-content>

                        <styled-content style="font-size:15px;">15
16</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">4) If the input is not a list, generate the error message:</styled-content>

                        <styled-content style="font-size:15px;">17</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">"Input should be a list of real numbers or strings".</styled-content>

                        <styled-content style="font-size:15px;">18</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">"""</styled-content>

                        <styled-content style="font-size:15px;">19
20</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">class</styled-content> 
                        <styled-content style="font-size:15px;">SortingTest(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">unittest</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">TestCase</styled-content>
                        <styled-content style="font-size:15px;">):
21</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    """A class implementing tests for a sorting function"""</styled-content>

                        <styled-content style="font-size:15px;">22</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">    def</styled-content> 
                        <styled-content style="font-size:15px;">setUp(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">):
23</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">f</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">my_sort</styled-content> 
                        <styled-content style="font-size:15px;color:#000071"># The function we will test is mySort</styled-content>

                        <styled-content style="font-size:15px;">24
25</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">    def</styled-content> 
                        <styled-content style="font-size:15px;">test_number_sort(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">):
26</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """Test that numbers sort correctly"""</styled-content>

                        <styled-content style="font-size:15px;">27</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        sorted_list</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">range</styled-content>
                        <styled-content style="font-size:15px;">(100000)
28</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        shuffled_list</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">random</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">shuffle</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#FF005A">range</styled-content>
                        <styled-content style="font-size:15px;">(100000))</styled-content>

                        <styled-content style="font-size:15px;">29</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">assertEqual</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">f</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">shuffled_list</styled-content>
                        <styled-content style="font-size:15px;">),</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">sorted_list</styled-content>
                        <styled-content style="font-size:15px;">)
30
31</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">    def</styled-content> 
                        <styled-content style="font-size:15px;">test_string_sort(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">):
32</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """Test that strings sort correctly"""</styled-content>

                        <styled-content style="font-size:15px;">33</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        word_file</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#0000A0">&#x2019;/usr/share/dict/words&#x2019;</styled-content>

                        <styled-content style="font-size:15px;">34</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        words</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">open</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">word_file</styled-content>
                        <styled-content style="font-size:15px;">).</styled-content>
                        <styled-content style="font-size:15px;color:#009600">read</styled-content>
                        <styled-content style="font-size:15px;">().</styled-content>
                        <styled-content style="font-size:15px;color:#009600">splitlines</styled-content>
                        <styled-content style="font-size:15px;">()
35</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        sorted_words</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">words</styled-content>

                        <styled-content style="font-size:15px;">36</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        shuffled_words</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">random</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">shuffle</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">words</styled-content>
                        <styled-content style="font-size:15px;">)
37</styled-content>
                        <styled-content style="font-size:15px;color:#009600">         self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">assertEqual</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">f</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">shuffled_words</styled-content>
                        <styled-content style="font-size:15px;">),</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">sorted_words</styled-content>
                        <styled-content style="font-size:15px;">)
38
39</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">    def</styled-content> 
                        <styled-content style="font-size:15px;">test_empty_list(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">):
40</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """Test that empty list returns empty list"""</styled-content>

                        <styled-content style="font-size:15px;">41</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">assertEqual</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">f</styled-content>
                        <styled-content style="font-size:15px;">([]), [])
42
43</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">    def</styled-content> 
                        <styled-content style="font-size:15px;">test_not_list(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">):
44</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """Test that invalid inputs generate correct error message"""</styled-content>

                        <styled-content style="font-size:15px;">45</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        message</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#0000A0">&#x2019;Input should be a list of real numbers or strings.&#x2019;</styled-content>

                        <styled-content style="font-size:15px;">46</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">assertRaisesRegexp</styled-content>
                        <styled-content style="font-size:15px;color:#009600">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">TypeError</styled-content>
                        <styled-content style="font-size:15px;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">message</styled-content>
                        <styled-content style="font-size:15px;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">f</styled-content>
                        <styled-content style="font-size:15px;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">&#x2019;a&#x2019;</styled-content>
                        <styled-content style="font-size:15px;">)
47
48</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">    def</styled-content> 
                        <styled-content style="font-size:15px;">test_mixed_list(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">):
49</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """Test that mixed lists generate appropriate error message"""</styled-content>

                        <styled-content style="font-size:15px;">50</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        mixed_list</styled-content> 
                        <styled-content style="font-size:15px;">= [1, 2,</styled-content> 
                        <styled-content style="font-size:15px;color:#0000A0">&#x2019;a&#x2019;</styled-content>
                        <styled-content style="font-size:15px;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#0000A0">&#x2019;b&#x2019;</styled-content>
                        <styled-content style="font-size:15px;">, 3]
51</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        message</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#0000A0">&#x2019;Input should be a list of real numbers or strings.&#x2019;</styled-content>

                        <styled-content style="font-size:15px;">52</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">assertRaisesRegexp</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">TypeError</styled-content>
                        <styled-content style="font-size:15px;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">message</styled-content>
                        <styled-content style="font-size:15px;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">f</styled-content>
                        <styled-content style="font-size:15px;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">mixed_list</styled-content>
                        <styled-content style="font-size:15px;">)</styled-content>
                    </preformat>
                </p>
                <p id="l3">
                    <bold>
                        <styled-content style="#CC6538;" style-type="color">Listing 3.</styled-content> Excerpts from basic biological integrity tests for worm models.</bold> Given the size of the data repositories that OpenWorm relies upon, there are many simple tests such as these for ensuring the correctness of the associated data.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve"> 
                        <styled-content style="font-size:15px;">1</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">import</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">PyOpenWorm</styled-content>
 
                        <styled-content style="font-size:15px;">2</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">import</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">unittest</styled-content>
 
                        <styled-content style="font-size:15px;">3
 4</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">class</styled-content> 
                        <styled-content style="font-size:15px;">BiologicalIntegrityTest(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">unittest</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">TestCase</styled-content>
                        <styled-content style="font-size:15px;">):
 5</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    """</styled-content>
 
                        <styled-content style="font-size:15px;">6</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    Tests that read from the database and ensure that basic</styled-content>
 
                        <styled-content style="font-size:15px;">7</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    queries have expected results, as a way to ensure data quality.</styled-content>
 
                        <styled-content style="font-size:15px;">8</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">    """</styled-content>
 
                        <styled-content style="font-size:15px;">9</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">    def</styled-content> 
                        <styled-content style="font-size:15px;">test_correct_neuron_number(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">):
10</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """</styled-content>

                        <styled-content style="font-size:15px;">11</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        This test verifies that the worm model</styled-content>

                        <styled-content style="font-size:15px;">12</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        has exactly 302 neurons.</styled-content>

                        <styled-content style="font-size:15px;">13</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """</styled-content>

                        <styled-content style="font-size:15px;">14</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        net</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">PyOpenWorm</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">Worm</styled-content>
                        <styled-content style="font-size:15px;">().</styled-content>
                        <styled-content style="font-size:15px;color:#009600">get_neuron_network</styled-content>
                        <styled-content style="font-size:15px;">()
15</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">assertEqual</styled-content>
                        <styled-content style="font-size:15px;">(302,</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">len</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#FF005A">set</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">net</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">neurons</styled-content>
                        <styled-content style="font-size:15px;">())))
16
17</styled-content> 
                        <styled-content style="font-size:15px;color:#FF005A">    def</styled-content> 
                        <styled-content style="font-size:15px;">test_neuron_syn_degree(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">self</styled-content>
                        <styled-content style="font-size:15px;">):
18</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """</styled-content>

                        <styled-content style="font-size:15px;">19</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        This test verifies that the number of chemical synapses</styled-content>

                        <styled-content style="font-size:15px;">20</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        associated with a given neuron AVAL is equal to 90.</styled-content>

                        <styled-content style="font-size:15px;">21</styled-content> 
                        <styled-content style="font-size:15px;color:#000071">        """</styled-content>

                        <styled-content style="font-size:15px;">22</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        aval</styled-content> 
                        <styled-content style="font-size:15px;">=</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">PyOpenWorm</styled-content>.
                        <styled-content style="font-size:15px;color:#009600">Neuron</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">name</styled-content>
                        <styled-content style="font-size:15px;">=</styled-content>
                        <styled-content style="font-size:15px;color:#0000A0">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="font-size:15px;">)
23</styled-content> 
                        <styled-content style="font-size:15px;color:#009600">        self</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">assertEqual</styled-content>
                        <styled-content style="font-size:15px;">(</styled-content>
                        <styled-content style="font-size:15px;color:#009600">aval</styled-content>
                        <styled-content style="font-size:15px;">.</styled-content>
                        <styled-content style="font-size:15px;color:#009600">Syn_degree</styled-content>
                        <styled-content style="font-size:15px;">(), 90)</styled-content>
                    </preformat>
                </p>
                <p>In 
                    <italic toggle="yes">test-driven development</italic>, the specification for a piece of software, as well as the corresponding unit tests are written 
                    <italic toggle="yes">before coding the software itself</italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-4">4</xref>,
                        <xref ref-type="bibr" rid="ref-7">7</xref>
                    </sup>. The argument for test-driven development is that having a well-developed testing framework before beginning the actual process of software development increases the likelihood that bugs will be caught as quickly as possible, and furthermore, that it helps the programmer to clarify their thought processes. In practice, while some tests are written before-hand, others are written in parallel with the rest of code development, or shortly after a piece of code is written but before it is integrated.</p>
                <p>We mention here that, in the software community, a distinction is often made between unit tests and 
                    <italic toggle="yes">integration tests</italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-7">7</xref>
                    </sup>. Strictly speaking, a unit test is a test which is applicable to the smallest, functional unit of code, and which has no external dependencies. On the other hand, tests which verify that different components work together are classified as integration tests; they verify that multiple components are integrated correctly. Some of the tests discussed below would strictly be considered integration tests. For the sake of simplicity, we will not distinguish between unit tests and integration tests in this article, and will refer to both as simply 
                    <italic toggle="yes">tests</italic> or 
                    <italic toggle="yes">unit tests</italic>. The primary distinction that we make here is instead between ordinary 
                    <italic toggle="yes">verification</italic> tests (to verify that code works as intended) and 
                    <italic toggle="yes">model validation</italic> tests (to validate a model against experimental data), which we discuss in more depth below.</p>
            </sec>
            <sec>
                <title>Unit testing in OpenWorm</title>
                <p>The software that makes up OpenWorm shares common ground with all other pieces of software, whether the sorting algorithm described above, a word processor, or an operating system. As a result, there are a range of unit tests that need to be written to ensure that basic pieces of the software infrastructure function correctly. Many of these tests will not be of any scientific significance; they are simply sanity checks to ensure correct behavior for predictable cases. For instance, there are tests for checking that certain internal functions return the appropriate error messages when given incorrect inputs; there are tests for verifying that databases are loaded correctly; there are tests which check that functions adhere to a specific naming convention which will help automated tools process the code-base.</p>
                <p>As a data-driven, scientific research project, however, OpenWorm also makes use of several other categories of tests that do not typically appear in software development. For instance, the 
                    <monospace>PyOpenWorm</monospace> subproject of OpenWorm is a simple API that provides a repository of information about 
                    <italic toggle="yes">C. elegans</italic> anatomy (
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/openworm/PyOpenWorm">https://github.com/openworm/PyOpenWorm</ext-link>). Given that the aim of OpenWorm is to produce a realistic simulation of the nematode, a carefully curated repository of empirical information is a cornerstone of the project.</p>
                <p>In the context of unit testing, there needs to be a category of tests that ensure that a curated datum has been appropriately verified and, furthermore, that its internal representation in the 
                    <monospace>PyOpenWorm</monospace> database is consistent. For example, for each &#x201c;fact&#x201d; in 
                    <monospace>PyOpenWorm</monospace>, there needs to be an associated piece of evidence, which serves as a reference. Practically, this evidence consists of a Digital Object Identifier
                    <sup>
                        <xref ref-type="bibr" rid="ref-9">9</xref>
                    </sup>, or DOI, which corresponds to a research paper from which the fact was originally retrieved. For this class of tests, we traverse the database of facts and verify that for each fact there is an associated source of evidence, i.e., a DOI. Furthermore, these tests verify that each DOI is valid, and that the URL corresponding to the DOI is accessible. There are also tests to check the internal consistency of the 
                    <monospace>PyOpenWorm</monospace> database, for instance, that neurons with the same name have the same identifier. 
                    <xref ref-type="other" rid="l4">Listing 4</xref> gives several excerpts from the 
                    <monospace>PyOpenWorm</monospace> testing framework. It consists of tests to verify the references in the database, i.e., the DOIs which correspond to research papers.</p>
                <p id="l4">
                    <bold>
                        <styled-content style="#CC6538;" style-type="color">Listing 4.</styled-content> Verifying data integrity is an integral component of testing in OpenWorm.</bold> Below, we give several sample tests to verify the existence of valid DOIs, one technique used to ensure that facts in the 
                    <monospace>PyOpenWorm</monospace> repository are appropriately linked to the research literature.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve"> 1 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">_DataTest</styled-content> 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># our in-house setup/teardown code</styled-content>
 2 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">from</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">PyOpenWorm</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">Evidence</styled-content>
 3
 4 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">class</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">EvidenceQualityTests(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">_DataTest</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">):</styled-content>
 5 	    
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""A class implementing tests for evidence quality."""</styled-content>
 6 	
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">def</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">test_has_valid_resource(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">):</styled-content>
 7 	    
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""Checks if the object has either a valid DOI or URL"""</styled-content>
 8 	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ev</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">Evidence</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">()</styled-content>
 9 	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">allEvidence</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">list</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ev</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">load</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">())</styled-content>
10 	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evcheck</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">= []</styled-content>
11
12 	    
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""Loop over all evidence fields in the database"""</styled-content>
13 	    
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">for</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evobj</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">in</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">allEvidence</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">:</styled-content>
14 	        
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">if</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evobj</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">doi</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">():</styled-content>
15 	      	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">doi</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evobj</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">doi</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">()</styled-content>
16 	      	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">val</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">requests</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">get</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;http://dx.doi.org/&#x2019;</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">+</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">doi</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
17 	      	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evcheck</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">append</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">val</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">status_code</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">== 200)</styled-content>
18
19 	       
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">elif</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evobj</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">url</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">():</styled-content>
20 	      	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">url</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evobj</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">url</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">()</styled-content>
21 	      	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">val</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">requests</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">get</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">url</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
22 	      	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evcheck</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">append</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">val</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">status_code</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">== 200)</styled-content>
23
24 	       
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">else</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">:</styled-content>
25 	      	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evcheck</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">append</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">False</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
26
27 	  
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">assertTrue</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">False</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">not in</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">evcheck</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
</preformat>
</p>
                <p>In 
                    <xref ref-type="other" rid="l5">Listing 5</xref>, we give several tests for verifying the contents of the 
                    <monospace>PyOpenWorm</monospace> repository. Since each of the functions below is designed to test properties of 
                    <monospace>Neuron</monospace> objects, they are part of a single class called 
                    <monospace>NeuronTest</monospace>. These tests fall into the category of verification tests, and several of the tests, such as 
                    <monospace>test_name</monospace> and 
                    <monospace>test_type</monospace> simply check that the database is working correctly.</p>
                <p id="l5">
                    <bold>
                        <styled-content style="#CC6538;" style-type="color">Listing 5.</styled-content> An assortment of verification tests from 
                        <monospace>PyOpenWorm</monospace>.</bold> These verify that the database behaves as we would expect it to, that properties of certain objects (
                    <monospace>Neuron</monospace> objects, in this case) are correctly specified, and that the database is not populated with duplicate entries.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve"> 1 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">_DataTest</styled-content> 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># our in-house setup/teardown code</styled-content>
 2 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">from</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">PyOpenWorm</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">Neuron</styled-content>
 3
 4 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">class</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">NeuronTest(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">_DataTest</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">):</styled-content>
 5 	
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
 6 	
                        <styled-content style="color:#000071;font-size:15px;#cccccc">AVAL, ADAL, AVAR, and PCVL are individual neurons in C. Elegans.</styled-content>
 7 	
                        <styled-content style="color:#000071;font-size:15px;#cccccc">AB plapaaaap is the lineage name of the ADAL neuron.</styled-content>
 8 	
                        <styled-content style="color:#000071;font-size:15px;#cccccc">A class implementing tests for Neuron objects.</styled-content>
 9 	
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
10 	
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">def</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">test_same_name_same_id(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">):</styled-content>
11 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
12 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">Test that two Neuron objects with the same name</styled-content>
13 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">have the same identifier().</styled-content>
14 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
15 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">c</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">Neuron</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
16 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">c1</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">Neuron</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
17 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">assertEqual</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">c</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">identifier</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">query</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">True</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">),</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">c1</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">identifier</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">query</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">True</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">))</styled-content>
18
19 	
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">def</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">test_type(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">):</styled-content>
20 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
21 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">Test that a Neuron&#x2019;s retrieved type is identical to</styled-content>
22 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">its type as inserted into the database.</styled-content>
23 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
24 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">n</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>(
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
25 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">n</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">type</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;interneuron&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
26 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">n</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">save</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">()</styled-content>
27 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">assertEqual</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;interneuron&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">).</styled-content>
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">type</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">one</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">())</styled-content>
28
29 	
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">def</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">test_name(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">):</styled-content>
30 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
31 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">Test that the name property is set when the neuron</styled-content>
32 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">is initialized with it.</styled-content>
33 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
34 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">assertEqual</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">
                            <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content>
                        </styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">).</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">())</styled-content>
35 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">assertEqual</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAR&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAR&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">).</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">())</styled-content>
36
37 	
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">def</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">test_init_from_lineage_name(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">):</styled-content>
38 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
39 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">Test that we can retrieve a Neuron from the database</styled-content>
40 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">by its lineage name only.</styled-content>
41 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
42 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">c</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">Neuron</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">lineageName</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AB plapaaaap&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;ADAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
43 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">c</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">save</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">()</styled-content>
44 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">c</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">Neuron</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">lineageName</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AB plapaaaap&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
45 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">assertEqual</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">c</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(),</styled-content> 
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;ADAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
46
47 	
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">def</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">test_neighbor(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">):</styled-content>
48 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
49 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">Test that a Neuron has a &#x2019;neighbors&#x2019; property, and that the</styled-content>
50 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">correct Neuron is returned when calling the &#x2019;neighbor&#x2019; function.</styled-content>
51 	     
                        <styled-content style="color:#000071;font-size:15px;#cccccc">"""</styled-content>
52 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">n</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>.
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
53 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">n</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neighbor</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;PVCL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">))</styled-content>
54 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neighbors</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">list</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">n</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neighbor</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">())</styled-content>
55 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">assertIn</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;PVCL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">),</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neighbors</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
56 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">n</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">save</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">()</styled-content>
57 	     
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">assertIn</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;PVCL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">),</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">list</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">self</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neur</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#0000A0;font-size:15px;#cccccc">&#x2019;AVAL&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">).</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neighbor</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">()))</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>Model validation with 
                    <monospace>SciUnit</monospace>
				</title>
                <p>Many computational models in biology are compared only informally with the experimental data they aim to explain. In contrast, we formalize data-driven model validation in OpenWorm by incorporating tests to 
                    <italic toggle="yes">validate</italic> each dynamical model in the project against experimental data from the literature. As an example, consider a scenario where a developer creates a new model and provides parameter values for a simulation. In addition to running all of the 
                    <italic toggle="yes">verification</italic> tests described above, the model and parameter values must be 
                    <italic toggle="yes">validated</italic> with respect to established experimental results. In general, each summary output of the model is validated against a corresponding piece of data. One example of a summary model output is the &#x201c;IV Curve&#x201d; (i.e. current evoked in response to each of a series of voltage steps) of a given neuronal ion channel. We expect that our model will possess only ion channels which behave similarly to those observed experimentally, i.e. that the model IV Curve matches the experimentally-determined IV curve. If our model&#x2019;s IV curve deviates too greatly from that observed experimentally, the model developers should be alerted and provided with information that will allow them to investigate the source of the discrepancy
                    <sup>
                        <xref ref-type="bibr" rid="ref-10">10</xref>
                    </sup>. This may mean that parameter values must be modified, or in some cases the model itself must be substantially revised. In the case of OpenWorm, the necessary data for validating models is part of the 
                    <monospace>PyOpenWorm</monospace> and 
                    <monospace>ChannelWorm</monospace> subprojects (
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/openworm/ChannelWorm">https://github.com/openworm/ChannelWorm</ext-link>), which are repositories of curated information about 
                    <italic toggle="yes">C. elegans</italic> anatomy and ion channels.</p>
                <p>Ordinary unit testing frameworks do not readily lend themselves to this kind of model validation. Rather than simply comparing an input-output pair, model validation tests should perform the same procedure that a scientist would perform before submitting a newly hypothesized model for publication. That is, they should generate some kind of summary statistic encoding the deviation between experimental data and model output. For example, in the case of an IV Curve, one might use the area between the model and data curves as a summary statistic. In the case of OpenWorm, because these models are part of a continuously updated and re-executed simulation, and not simply static equations in a research paper, the model validation process must happen automatically and continuously, alongside other unit tests.</p>
                <p>To incorporate model validation tests, we use the Python package 
                    <monospace>SciUnit</monospace>
                    <sup>
                        <xref ref-type="bibr" rid="ref-11">11</xref>
                    </sup> (
                    <ext-link ext-link-type="uri" xlink:href="http://sciunit.scidash.org">http://sciunit.scidash.org</ext-link>). While there are some practical differences between writing 
                    <monospace>SciUnit</monospace> tests and ordinary unit tests, the concepts are quite similar. For example, a 
                    <monospace>SciUnit</monospace> test can be configured to return 
                    <italic toggle="yes">True</italic> if the test passes, i.e. model output and data are in sufficient agreement, and 
                    <italic toggle="yes">False</italic> otherwise. Ultimately, a scientific model is just another piece of software&#x2014;thus it can be validated with respect to a specification. In the case of dynamical models, these specifications come from the scientific literature, and are validated with the same types of tests used before submitting a model for publication. 
                    <monospace>SciUnit</monospace> simply formalizes this testing procedure in the context of a software development work-flow. In 
                    <xref ref-type="other" rid="l6">Listing 6</xref>, we give an example of 
                    <monospace>SciUnit</monospace> tests using the neuron-specific helper library 
                    <monospace>NeuronUnit</monospace> (
                    <ext-link ext-link-type="uri" xlink:href="http://neuronunit.scidash.org">http://neuronunit.scidash.org</ext-link>) for neuron-specific models.</p>
                <p id="l6">
                    <bold>
                        <styled-content style="#CC6538;" style-type="color">Listing 6.</styled-content> Excerpt from a 
                        <monospace>SciUnit</monospace> test in 
                        <monospace>ChannelWorm</monospace>, a repository of information about ion channels.</bold> The test listed here verifies that a given ion channel has the correct current / voltage behavior. In terms of the informal classification of tests given above, this test falls under the category of model validation tests.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve"> 1 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">os</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">sys</styled-content>
 2 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">numpy as np</styled-content>
 3 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">quantities as pq</styled-content>
 4 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">from</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neuronunit</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">tests</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">channel</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">IVCurvePeakTest</styled-content>
 5 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">from</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">neuronunit</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">models</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">channel</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ChannelModel</styled-content>
 6 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">from</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">channelworm</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ion_channel</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">models</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">import</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">GraphData</styled-content>
 7
 8 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># Instantiate the model; CW_HOME is the location of the ChannelWorm repo</styled-content>
 9 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ch_model_name</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#0021BE;font-size:15px;#cccccc">&#x2019;EGL-19.channel&#x2019;</styled-content>
10 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">channel_id</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#0021BE;font-size:15px;#cccccc">&#x2019;ca_boyle&#x2019;</styled-content>
11 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ch_file_path</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">os</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">path</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">join</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">CW_HOME</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content> 
                        <styled-content style="color:#0021BE;font-size:15px;#cccccc">&#x2019;models&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content> 
                        <styled-content style="color:#0021BE;font-size:15px;#cccccc">&#x2019;%s.nml&#x2019;</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">%</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ch_model_name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
12 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">model</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ChannelModel</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ch_file_path</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">channel_index</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=0,</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">ch_model_name</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
13
14 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># Get the experiment data and instantiate the test</styled-content>
15 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">doi</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#0021BE;font-size:15px;#cccccc">&#x2019;10.1083/jcb.200203055&#x2019;</styled-content>
16 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">fig</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#0021BE;font-size:15px;#cccccc">&#x2019;2B&#x2019;</styled-content>
17 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">sample_data</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">GraphData</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">objects</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">get</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
18 	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">graph__experiment__reference__doi</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">doi</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content>
19 	    
                        <styled-content style="color:#009600;font-size:15px;#cccccc">graph__figure_ref_address</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">fig</styled-content>
20 	
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
21
22 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># Current density in A/F and membrane potential in mV.</styled-content>
23 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">obs</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#FF005A;font-size:15px;#cccccc">zip</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(*</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">sample_data</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">asarray</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">())</styled-content>
24 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">observation</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">= {</styled-content>
                        <styled-content style="color:#0021BE;font-size:15px;#cccccc">&#x2019;i/C&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">:</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">obs</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">[1]*</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">pq</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">A</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">/</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">pq</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">F</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">,</styled-content> 
                        <styled-content style="color:#0021BE;font-size:15px;#cccccc">&#x2019;v&#x2019;</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">:</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">obs</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">[0]*</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">pq</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">mV</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">}</styled-content>
25
26 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># Use these observations to instantiate a quantitative test of the peak</styled-content>
27 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># current (I) in response to a series of voltage pulses (V) delivered</styled-content>
28 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># to the channel.</styled-content>
29 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">test</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">IVCurvePeakTest</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">observation</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
30
31 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># Judge the model output against the experimental data.</styled-content>
32 
                        <styled-content style="color:#000071;font-size:15px;#cccccc"># Score will reflect a measure of agreement between I/V curves.</styled-content>
33 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">score</styled-content> 
                        <styled-content style="color:#000025;font-size:15px;#cccccc">=</styled-content> 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">test</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">judge</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">(</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">model</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">)</styled-content>
34 
                        <styled-content style="color:#009600;font-size:15px;#cccccc">score</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">.</styled-content>
                        <styled-content style="color:#009600;font-size:15px;#cccccc">plot</styled-content>
                        <styled-content style="color:#000025;font-size:15px;#cccccc">()</styled-content>
                    </preformat>
                </p>
                <p>In the preceding example, the statistic is computed within the 
                    <monospace>SciUnit</monospace> method 
                    <monospace>judge</monospace>, which is analogous to the 
                    <monospace>self.assert</monospace> statements used in the ordinary unit tests above. While the ordinary unit test compares the output of a function pair to an accepted reference output, 
                    <monospace>judge</monospace> compares the output of a model (i.e. simulation data) to accepted reference experimental data. Internally, the 
                    <monospace>judge</monospace> method invokes other code (not shown) which encodes the test&#x2019;s specification, i.e. what a model must do to pass the test. The output of the test is a numeric score. In order to include 
                    <monospace>SciUnit</monospace> tests alongside other unit tests in a testing suite, they can be configured to map that numeric score to a boolean value reflecting whether the model/data agreement returned by 
                    <monospace>judge</monospace> is within an acceptable range.</p>
                <p>The output of these model validation tests can also be inspected visually; 
                    <xref ref-type="fig" rid="f2">Figure 2</xref> shows the graphical output of the test workflow in 
                    <xref ref-type="other" rid="l6">Listing 6</xref>, and illustrates for the developers why the test failed (mismatch between current-voltage relationship produced by the model and the one found in the experimental literature). Further details about the output of this test &#x2013; including the algorithm for computing model/data agreement, and the magnitude of disagreement required to produce a failing score &#x2013; can also be accessed via attributes and methods of the 
                    <monospace>score</monospace> object (not shown, but see 
                    <monospace>SciUnit</monospace> documentation). Consequently, full provenance information about the test is retained.</p>
                <fig fig-type="figure" id="f2" orientation="portrait" position="float">
                    <label>Figure 2. </label>
                    <caption>
                        <title>Graphical output from 
                            <xref ref-type="other" rid="l6">Listing 6</xref>, showing a failed test which alerts developers to an inconsistency between model
and data.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/10031/d1064a99-68aa-41bc-8fb6-8c50580e0b3b_figure2.gif"/>
                </fig>
                <p>Some computational science projects use ad-hoc scripts that directly run models and compare their outputs to reference data. This can be adequate in simple cases, but for larger projects, particularly distributed open-source projects with many contributors, the mixing of implementation and interface carries significant drawbacks
                    <sup>
                        <xref ref-type="bibr" rid="ref-12">12</xref>
                    </sup>. For example, in order to record and store the membrane potential of a model cell&#x2013;to then compare to reference data&#x2013;one could determine which functions are needed to run the simulation in a given simulation engine, extract the membrane potential from the resulting files, and then call those functions in a test script. However, this approach has three major flaws. First, it may be difficult for a new contributor or collaborator to understand what is being tested, as the test code is polluted with implementation details of the model that are not universally understood. Second, such a test will not work on any model that does not have the same implementation details, and thus has limited re-usability. Third, any changes to the model implementation will require parallel changes to the corresponding tests. In contrast, by separating tests from implementation details, tests can work on any model that implements a well-defined set of capabilities exposed via an interface. 
                    <monospace>SciUnit</monospace> does this by design, and 
                    <monospace>SciUnit</monospace> tests interact with models only through an interface of standard methods, for example, those provided by 
                    <monospace>NeuronUnit</monospace>. It is the responsibility of the model developer to match this interface by referencing standard methods, e.g. 
                    <monospace>run, get_membrane_potential</monospace>, etc. Ultimately, the separation of implementation from interface leads to greater code clarity, more rapid development, and greater test re-usability.</p>
            </sec>
            <sec>
                <title>Test coverage</title>
                <p>The 
                    <italic toggle="yes">coverage</italic> of a testing suite is defined as the percentage of functions in a code-base which are being tested. Since there is no rigorous measure of what constitutes an adequate test, precise figures of test coverage should be interpreted with caution. Nonetheless, automated tools which analyze a code-base to determine test coverage can be a valuable resource in suggesting areas of a code-base in need of additional attention. Ideally, test coverage should be as high as possible, indicating that a large fraction of or even the entire code-base has been tested according to the intended specifications.</p>
                <p>In 
                    <monospace>PyOpenWorm</monospace>, we make use several of pre-existing tools in the Python ecosystem for calculating test coverage of the Python code-base, specifically, the aptly-named 
                    <monospace>Coverage</monospace> package
                    <sup>
                        <xref ref-type="bibr" rid="ref-13">13</xref>
                    </sup>, as well as a GitHub extension dedicated to tracking the coverage of such projects known as 
                    <monospace>Coveralls</monospace>
                    <sup>
                        <xref ref-type="bibr" rid="ref-14">14</xref>
                    </sup>. We adopted these tools in an effort to track which parts of the code-base need additional tests, and to give further backing to the test-driven culture of the project. 
                    <monospace>PyOpenWorm</monospace> currently has a test coverage of roughly 73%. If a contributor to 
                    <monospace>PyOpenWorm</monospace> introduces some new code to the project but does not add tests for it, the contributor will see that test coverage has been reduced. By making changes in test coverage explicit, for example with a badge on the project&#x2019;s homepage, it is easier to track the impact of a growing code-base.</p>
            </sec>
            <sec>
                <title>Continuous integration</title>
                <p>Modern software is often written using a process of 
                    <italic toggle="yes">continuous integration</italic> or CI
                    <sup>
                        <xref ref-type="bibr" rid="ref-15">15</xref>,
                        <xref ref-type="bibr" rid="ref-16">16</xref>
                    </sup>, whereby the contributions of developers are integrated into a shared repository multiple times a day by an automated system. Typically, the output of a testing suite will determine whether or not the new contributions of a developer can be immediately integrated, or whether changes are required to avoid 
                    <italic toggle="yes">regression</italic>, i.e. failing unit tests that passed before the new contribution.</p>
                <p>The benefits of continuous integration include early detection of bugs, eliminating development bottle-necks close to the release date (in the case of commercial software), and the regular availability of usable versions of the software. The process of continuous integration also encourages shifts in how developers think about structuring their code, and encourages regular, modular contributions, rather than massive, monolithic changes that can be difficult to debug.</p>
                <p>The entire OpenWorm project, including the 
                    <monospace>PyOpenWorm</monospace> and 
                    <monospace>ChannelWorm</monospace> modules make use of continuous integration (see 
                    <xref ref-type="fig" rid="f3">Figure 3</xref>), taking advantage of a free service called Travis-CI (
                    <ext-link ext-link-type="uri" xlink:href="https://travis-ci.org">https://travis-ci.org</ext-link>) that tests changes to the code-base as they are pushed to the collaborative software development portal GitHub
                    <sup>
                        <xref ref-type="bibr" rid="ref-17">17</xref>
                    </sup>. With each change, the entire project is built from scratch on a machine in the cloud, and the entire test suite is run. A build that passes all tests is a &#x201c;passing build&#x201d;, and the changes introduced will not break any functionality that is being tested. Because the entire project is built from scratch with each change to the code-base, the dependencies required to achieve this build must be made explicit. This ensures that there is a clear roadmap to the installation of dependencies required to run the project successfully &#x2013; no hidden assumptions about pre-existing libraries can be made.</p>
                <fig fig-type="figure" id="f3" orientation="portrait" position="float">
                    <label>Figure 3. </label>
                    <caption>
                        <title>Sample output from the OpenWorm continuous integration dashboard.</title>
                        <p>Each row corresponds to a single set of contributions, known as a 
                            <italic toggle="yes">commit</italic>, submitted by a given developer. A commit is assigned a 
                            <italic toggle="yes">build number</italic>, which is given in the second column, and the result of the build process is indicated by the color of the corresponding row. If any of the unit tests fail, the build will be marked as failed (errored, in red), and the code contributions will be rejected. The developer is then responsible for identifying and fixing the corresponding bugs, and resubmitting their contributions to the code repository.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/10031/d1064a99-68aa-41bc-8fb6-8c50580e0b3b_figure3.gif"/>
                </fig>
            </sec>
            <sec>
                <title>Skipped tests and expected failures</title>
                <p>Suppose we have rigorously employed a process of test-driven development. Starting with a carefully designed specification, we have written a test suite for a broad range of functionality, and are using a continuous integration system to incorporate the ongoing contributions of developers on a regular basis.</p>
                <p>In this scenario, given that we have written a test suite prior to the development of the software, our CI system will reject all of our initial contributions because most tests fail, simply because the code that would pass the tests has not been written yet! To address precisely this scenario, many testing frameworks allow tests to be annotated as 
                    <italic toggle="yes">expected failures</italic> or simply to skip a given test entirely. The ability to mark tests as expected failures allows developers to incrementally enable tests, and furthermore draws attention to missing functionality. Consequently, the fraction of tests passed becomes a benchmark for progress towards an explicit development goal, 
                    <italic toggle="yes">that goal being encoded by the set of all tests that have been written</italic>.</p>
                <p>The OpenWorm code-base makes extensive use of skipped tests and expected failures as a core part of the culture of test-driven development. In 
                    <monospace>PyOpenWorm</monospace>, for example, data integrity tests are often added in advance of the data itself being incorporated to the database. These tests provide a critical safety net as new information is curated from the scientific literature. Prior to the curation of this information, the tests are simply skipped. Once the information is curated, the tests are run, and indicate whether the information is usable by the project.</p>
            </sec>
            <sec>
                <title>Frivolous tests and overly specific tests</title>
                <p>Tests are typically sufficiently straightforward to write that it is easy to proliferate a testing suite with a large number of unnecessary tests. Often, these tests will be completely frivolous and cause no harm, beyond causing a testing suite to take much longer than necessary to run. However, tests which are overly specific can actually hinder the process of development. If there are tests which are too specific and constrain internal behavior that is not meant to be static, a developer&#x2019;s contributions may be unnecessarily rejected during the process of continuous integration.</p>
            </sec>
        </sec>
        <sec sec-type="conclusions">
            <title>Conclusions</title>
            <p>Our aim in this article is to give an overview of some basic development practices from industrial software engineering that are of particular relevance to biological software. As a summary, we list here the types of tests used in OpenWorm. This list is simply an informal classification, and not a definitive taxonomy:</p>
            <p>
				
                <bold>Verification tests (the usual suspects)</bold> These are tests common to all pieces of software and are not particularly relevant to the biological nature of the project. For instance, tests that verify that error handling is implemented correctly, that databases are accessed correctly, or that performing certain numerical operations produces results within an acceptable range.</p>
            <p>
				
                <bold>Data integrity tests</bold> These are tests unique to a project that incorporates curated data. In the case of OpenWorm, these tests check (among other things) that every biological fact in the 
                <monospace>PyOpenWorm</monospace> repository has an associated piece of experimental evidence, typically corresponding to a DOI, and that each of these DOIs is valid.</p>
            <p>
				
                <bold>Biological integrity tests</bold> These tests verify that data tokens in the 
                <monospace>PyOpenWorm</monospace> repository correspond to known information about 
                <italic toggle="yes">C. Elegans</italic>. In contrast to the model validation tests described below, biological integrity tests typically only check static information/parameters.</p>
            <p>
				
                <bold>Model validation tests</bold> These are tests specific to a project that incorporates scientific models. Model validation tests allow us to check that specific models, such as the behavior of ion channels, correspond to known behavior from the scientific literature. In effect, they extend the notion of unit testing to compare summary data and model output according to some summary statistic. In OpenWorm, the Python package 
                <monospace>SciUnit</monospace> and derivative packages like 
                <monospace>NeuronUnit</monospace> are used for writing tests that check the validity of scientific models against accepted data.</p>
            <p>It should be clear from the above discussion and corresponding code examples that unit tests are fundamentally quite simple objects. Their behavior is no more than to compare input-output pairs, or in the case of 
                <monospace>SciUnit</monospace> tests, that a given model&#x2019;s output corresponds to a known reference from the scientific literature. The sophistication of testing frameworks is generally quite minimal when compared to the software itself being tested. While ad-hoc test scripts may be sufficient for small projects, for large projects with many contributors, a systematic approach to unit testing can result in significant efficiency gains and ease the burden of long-term code maintenance. In the context of 
                <italic toggle="yes">continuous integration</italic>, whereby a piece of software is built in an ongoing cycle as developers make changes and additions to the code-base, unit testing provides a valuable safety net that can prevent flawed code from prematurely being integrated.</p>
            <p>However, in spite of the conceptual simplicity and potential pitfalls of testing, its importance cannot be overstated. Writing tests requires careful thought and planning and some knowledge of the code-base being tested. Testing from a specification alone can result in inadequate testing, but tests which are too specific to the code-base can result in unnecessary roadblocks for developers.</p>
            <p>Rather than being thought of as a sophisticated set of technical tools, unit testing should be viewed as a cultural practice for ensuring the reliability of complex software. Perhaps a useful analogy is the powerful impact that checklists have had in clinical medicine, aviation, construction, and many other industries
                <sup>
                    <xref ref-type="bibr" rid="ref-18">18</xref>&#x2013;
                    <xref ref-type="bibr" rid="ref-20">20</xref>
                </sup>. Unit tests are sanity checks at a minimum, and can potentially guide the scientific development of models when used in conjunction with experimental data. In order to reap their benefit, their existence and maintenance needs to be valued by all of the participants of the research and software development process. Finally, in order for this culture to be created, test-driven development should not be a heavy-handed imposition on the developers. Otherwise, it will be incorrectly perceived as a bureaucratic hurdle, rather than the valuable safety-net that it is.</p>
        </sec>
        <sec>
            <title>Software availability</title>
            <p>Software available from: 
                <ext-link ext-link-type="uri" xlink:href="http://www.openworm.org/">http://www.openworm.org/</ext-link>
            </p>
            <p>Latest source code: 
                <ext-link ext-link-type="uri" xlink:href="http://github.com/OpenWorm">http://github.com/OpenWorm</ext-link>
			</p>
        </sec>
    </body>
    <back>
        <ack>
            <title>Acknowledgements</title>
            <p>We would like to thank supporters of OpenWorm, including NeuroLinx.org, the backers of the 2014 OpenWorm Kickstarter campaign (
                <ext-link ext-link-type="uri" xlink:href="http://www.openworm.org/supporters.html">http://www.openworm.org/supporters.html</ext-link>), Google Summer of Code 2015, and the International Neuroinformatics Coordinating Facility. We would also like to thank the scientific and code contributors to OpenWorm (
                <ext-link ext-link-type="uri" xlink:href="http://www.openworm.org/people.html">http://www.openworm.org/people.html</ext-link>), and Shreejoy Tripathy for careful reading of the manuscript.</p>
        </ack>
        <ref-list>
            <ref id="ref-1">
                <label>1</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Takahashi</surname>
                            <given-names>K</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Yugi</surname>
                            <given-names>K</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Hashimoto</surname>
                            <given-names>K</given-names>
                        </name>
						
                        <etal/>
					</person-group>:
                    <article-title>Computational Challenges in Cell Simulation: A Software Engineering Approach.</article-title>
                    <source>
						
                        <italic toggle="yes">IEEE Intelligent Systems.</italic>
					</source>
                    <year>2002</year>;<volume>17</volume>(<issue>5</issue>):<fpage>64</fpage>&#x2013;<lpage>71</lpage>.
                    <pub-id pub-id-type="doi">10.1109/mis.2002.1039834</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-2">
                <label>2</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Macklin</surname>
                            <given-names>DN</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Ruggero</surname>
                            <given-names>NA</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Covert</surname>
                            <given-names>MW</given-names>
                        </name>
					</person-group>:
                    <article-title>The future of whole-cell modeling.</article-title>
                    <source>
						
                        <italic toggle="yes">Curr Opin Biotechnol.</italic>
					</source>
                    <year>2014</year>;<volume>28</volume>:<fpage>111</fpage>&#x2013;<lpage>115</lpage>.
                    <pub-id pub-id-type="pmid">24556244</pub-id>
                    <pub-id pub-id-type="doi">10.1016/j.copbio.2014.01.012</pub-id>
                    <pub-id pub-id-type="pmcid">4111988</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-3">
                <label>3</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Gewaltig</surname>
                            <given-names>MO</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Cannon</surname>
                            <given-names>R</given-names>
                        </name>
					</person-group>:
                    <article-title>Current practice in software development for computational neuroscience and how to improve it.</article-title>
                    <source>
						
                        <italic toggle="yes">PLoS Comput Biol.</italic>
					</source>
                    <year>2014</year>;<volume>10</volume>(<issue>1</issue>):<fpage>e1003376</fpage>.
                    <pub-id pub-id-type="pmid">24465191</pub-id>
                    <pub-id pub-id-type="doi">10.1371/journal.pcbi.1003376</pub-id>
                    <pub-id pub-id-type="pmcid">3900372</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-4">
                <label>4</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Beck</surname>
                            <given-names>K</given-names>
                        </name>
					</person-group>:
                    <article-title>Test Driven Development: By Example.</article-title>Addison Wesley,<year>2002</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://books.google.co.in/books?id=CUlsAQAAQBAJ&amp;printsec=frontcover">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-5">
                <label>5</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Maximilien</surname>
                            <given-names>EM</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Williams</surname>
                            <given-names>L</given-names>
                        </name>
					</person-group>:
                    <article-title>Assessing test-driven development at IBM.</article-title>In
                    <italic toggle="yes">Software Engineering, 2003. Proceedings. 25th International Conference on.</italic>IEEE,<year>2003</year>;<fpage>564</fpage>&#x2013;<lpage>569</lpage>.
                    <pub-id pub-id-type="doi">10.1109/ICSE.2003.1201238</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-6">
                <label>6</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Erdogmus</surname>
                            <given-names>H</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Morisio</surname>
                            <given-names>M</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Torchiano</surname>
                            <given-names>M</given-names>
                        </name>
					</person-group>:
                    <article-title>On the effectiveness of the test-first approach to programming.</article-title>
                    <source>
						
                        <italic toggle="yes">IEEE Transactions on Software Engineering.</italic>
					</source>
                    <year>2005</year>;<volume>31</volume>(<issue>3</issue>):<fpage>226</fpage>&#x2013;<lpage>237</lpage>.
                    <pub-id pub-id-type="doi">10.1109/TSE.2005.37</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-7">
                <label>7</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Osherove</surname>
                            <given-names>R</given-names>
                        </name>
					</person-group>:
                    <article-title>The Art of Unit Testing: with examples in C#.</article-title>Manning Publications,<year>2013</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://g-02.ebooks-it.org/e-books/manning/Manning.The.Art.Of.Unit.Testing.With.Examples.In.C.Sharp.2nd.Edition.Dec.2013.ISBN.1617290890.pdf?l=7_klTEg3-ODNx_CSF-9fiw">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-8">
                <label>8</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Szigeti</surname>
                            <given-names>B</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Gleeson</surname>
                            <given-names>P</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Vella</surname>
                            <given-names>M</given-names>
                        </name>
						
                        <etal/>
					</person-group>:
                    <article-title>OpenWorm: an open-science approach to modeling 
                        <italic toggle="yes">Caenorhabditis elegans</italic>.</article-title>
                    <source>
						
                        <italic toggle="yes">Front Comput Neurosci.</italic>
					</source>
                    <year>2014</year>;<volume>8</volume>:<fpage>137</fpage>.
                    <pub-id pub-id-type="pmid">25404913</pub-id>
                    <pub-id pub-id-type="doi">10.3389/fncom.2014.00137</pub-id>
                    <pub-id pub-id-type="pmcid">4217485</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-9">
                <label>9</label>
                <mixed-citation publication-type="journal">
                    <article-title>DOI
                        <sup>&#x00ae;</sup> System and Internet Identifier Specifications</article-title>.<year>2015</year>. Accessed: 2015-07-24.
                    <ext-link ext-link-type="uri" xlink:href="http://www.doi.org/factsheets/DOIIdentifierSpecs.html">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-10">
                <label>10</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>De Schutter</surname>
                            <given-names>E</given-names>
                        </name>
					</person-group>:
                    <article-title>The dangers of plug-and-play simulation using shared models.</article-title>
                    <source>
						
                        <italic toggle="yes">Neuroinformatics.</italic>
					</source>
                    <year>2014</year>;<volume>12</volume>(<issue>2</issue>):<fpage>227</fpage>&#x2013;<lpage>228</lpage>.
                    <pub-id pub-id-type="pmid">24664409</pub-id>
                    <pub-id pub-id-type="doi">10.1007/s12021-014-9224-7</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-11">
                <label>11</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Omar</surname>
                            <given-names>C</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Aldrich</surname>
                            <given-names>J</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Gerkin</surname>
                            <given-names>R</given-names>
                        </name>
					</person-group>:
                    <article-title>Collaborative infrastructure for test-driven scientific model validation.</article-title>In
                    <italic toggle="yes">Companion Proceedings of the 36th International Conference on Software Engineering.</italic>ACM Press,<year>2014</year>;<fpage>524</fpage>&#x2013;<lpage>527</lpage>.
                    <pub-id pub-id-type="doi">10.1145/2591062.2591129</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-12">
                <label>12</label>
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Shalloway</surname>
                            <given-names>A</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Trott</surname>
                            <given-names>JR</given-names>
                        </name>
					</person-group>:
                    <article-title>Design patterns explained: a new perspective on object-oriented design.</article-title>Pearson Education,<year>2004</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://books.google.co.in/books?id=84Whswqz4rAC&amp;printsec=frontcover">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-13">
                <label>13</label>
                <mixed-citation publication-type="journal">
                    <article-title>Code coverage measurement for python</article-title>.<year>2015</year>. Accessed: 2015-07-24.
                    <ext-link ext-link-type="uri" xlink:href="https://pypi.python.org/pypi/coverage/3.7.1">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-14">
                <label>14</label>
                <mixed-citation publication-type="journal">
                    <article-title>Coveralls-Test Coverage History and Statistics</article-title>.<year>2015</year>. Accessed: 2015-07-24.
                    <ext-link ext-link-type="uri" xlink:href="https://coveralls.io/">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-15">
                <label>15</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Booch</surname>
                            <given-names>G</given-names>
                        </name>
					</person-group>:
                    <article-title>Object Oriented Analysis and Design with Applications</article-title>. Benjamin-Cummings,<year>1990</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://dl.acm.org/citation.cfm?id=82528">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-16">
                <label>16</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Duvall</surname>
                            <given-names>PM</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Matyas</surname>
                            <given-names>S</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Glover</surname>
                            <given-names>A</given-names>
                        </name>
					</person-group>:
                    <article-title>Continuous Integration: Improving Software Quality and Reducing Risk</article-title>. Addison-Wesley Professional,<year>2007</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://books.google.co.in/books?id=PV9qfEdv9L0C&amp;printsec=frontcover">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-17">
                <label>17</label>
                <mixed-citation publication-type="book">
                    <article-title>Travis CI - Test and Deploy Your Code with Confidence</article-title>.<year>2015</year>. Accessed: 2015- 07-24.
                    <ext-link ext-link-type="uri" xlink:href="http://www.travis-ci.org">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-18">
                <label>18</label>
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Gawande</surname>
                            <given-names>A</given-names>
                        </name>
					</person-group>:
                    <article-title>The Checklist Manifesto: How to Get Things Right.</article-title>Picador.<year>2011</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://books.google.co.in/books?id=7GJi0fsSmUoC&amp;printsec=frontcover">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-19">
                <label>19</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Huang</surname>
                            <given-names>L</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Kim</surname>
                            <given-names>R</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Berry</surname>
                            <given-names>W</given-names>
                        </name>
					</person-group>:
                    <article-title>Creating a culture of safety by using checklists.</article-title>
                    <source>
						
                        <italic toggle="yes">AORN J.</italic>
					</source>
                    <year>2013</year>;<volume>97</volume>(<issue>3</issue>):<fpage>365</fpage>&#x2013;<lpage>368</lpage>.
                    <pub-id pub-id-type="pmid">23452700</pub-id>
                    <pub-id pub-id-type="doi">10.1016/j.aorn.2012.12.019</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-20">
                <label>20</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
						
                        <name name-style="western">
                            <surname>Weiser</surname>
                            <given-names>TG</given-names>
                        </name>
						
                        <name name-style="western">
                            <surname>Berry</surname>
                            <given-names>WR</given-names>
                        </name>
					</person-group>:
                    <article-title>Perioperative checklist methodologies.</article-title>
                    <source>
						
                        <italic toggle="yes">Can J Anaesth.</italic>
					</source>
                    <year>2013</year>;<volume>60</volume>(<issue>2</issue>):<fpage>136</fpage>&#x2013;<lpage>142</lpage>.
                    <pub-id pub-id-type="pmid">23233394</pub-id>
                    <pub-id pub-id-type="doi">10.1007/s12630-012-9854-x</pub-id>
                </mixed-citation>
            </ref>
        </ref-list>
    </back>
    <sub-article article-type="reviewer-report" id="report15595">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.10031.r15595</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Davison</surname>
                        <given-names>Andrew</given-names>
                    </name>
                    <xref ref-type="aff" rid="r15595a1">1</xref>
                    <role>Referee</role>
                </contrib>
                <aff id="r15595a1">
                    <label>1</label>Unit of Neuroscience, Information et Complexity (UNIC), French National Center for Scientific Research, Gif-sur-Yvette, France</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>31</day>
                <month>8</month>
                <year>2016</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2016 Davison A</copyright-statement>
                <copyright-year>2016</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport15595" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.9315.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>The article provides an introduction to automated software testing,&#x00a0;its application to computational biology, and&#x00a0;model validation as a form of testing, with examples taken from the OpenWorm project. The article is clearly written, and will be a helpful resource for computational biologists.</p>
            <p> </p>
            <p> The article could be improved by a deeper discussion of some of the more difficult issues in the automation of model validation: 
                <list list-type="bullet">
                    <list-item>
                        <p>what criteria to apply when transforming a numerical measure of closeness into a pass/fail?</p>
                    </list-item>
                    <list-item>
                        <p>how to support the use of different criteria by different scientists, who might weigh the relative importance of particular validations very differently?</p>
                    </list-item>
                    <list-item>
                        <p>how to handle contradictory experimental results?</p>
                    </list-item>
                </list> I would also be interested to read a discussion of possible improvements to continuous integration dashboards in the context of continuous validation, e.g. tracking the evolution of numerical validation results across model versions.</p>
            <p>Reviewer Expertise:</p>
            <p>NA</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report15594">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.10031.r15594</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Roessert</surname>
                        <given-names>Christian</given-names>
                    </name>
                    <xref ref-type="aff" rid="r15594a1">1</xref>
                    <role>Referee</role>
                </contrib>
                <aff id="r15594a1">
                    <label>1</label>Blue Brain Project, E&#x0301;cole Polytechnique Fe&#x0301;de&#x0301;rale de Lausanne (EPFL), Geneva, Switzerland</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>30</day>
                <month>8</month>
                <year>2016</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2016 Roessert C</copyright-statement>
                <copyright-year>2016</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport15594" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.9315.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve-with-reservations</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>In this article the authors show how industrial practices of unit testing and test-driven development can be used and extended for computational modelling in biological sciences. The manuscript is well written and provides clear examples making it easy to understand the basic concepts.</p>
            <p> </p>
            <p> I believe that establishing a culture of test-driven development in biological sciences is of great importance. However, in my view applying software engineering practices to computational modelling is often not as easy as depicted by the authors. I have the following suggestions to improve the manuscript:</p>
            <p> &#x00a0; 
                <list list-type="order">
                    <list-item>
                        <p>Judging the quality and validity of a computational model is a matter of scientific discussion and often cannot be easily reduced to a pass or fail decision in a model validation test. I would like to see a bit more detail on the transformation of the numeric score to a Boolean value used in the given ion channel test example but also on the general (statistical) concepts behind these decisions.</p>
                    </list-item>
                    <list-item>
                        <p>To iteratively improve a computational model, it is important to know not only if but also why a certain model fails or passes the model validation test. Since continuous integration systems are designed for simple verification tests: can the detailed results/figures and scores for each model validation test be shown directly on the CI dashboard? A discussion on the limits of current CI tools for biological modelling would be very helpful.</p>
                    </list-item>
                    <list-item>
                        <p>While the calculation of ion channel dynamics for a model validation test is computationally relatively cheap, computations become much more expensive once full detailed cell models or even networks have to be computed to validate against e.g.
                            <italic> in vivo</italic> recordings. In these cases, the testing framework becomes much more sophisticated than &#x201c;simple objects&#x201d; and free services like Travis-CI will likely not be able to provide the required computational power. Is there a certain limit for your model validation test concept you would consider in the OpenWorm project and in general? Are there any ideas how to overcome these limitations? A discussion on the limits of the presented framework would be appreciated.</p>
                    </list-item>
                </list>
            </p>
            <p>Reviewer Expertise:</p>
            <p>NA</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.</p>
        </body>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report15597">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.10031.r15597</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Cannon</surname>
                        <given-names>Robert</given-names>
                    </name>
                    <xref ref-type="aff" rid="r15597a1">1</xref>
                    <role>Referee</role>
                </contrib>
                <aff id="r15597a1">
                    <label>1</label>Textensor Limited, Edinburgh, UK</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>24</day>
                <month>8</month>
                <year>2016</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2016 Cannon R</copyright-statement>
                <copyright-year>2016</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport15597" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.9315.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>The authors present an interesting review of how they have applied traditional software testing methodologies to the OpenWorm project. It provides a nicely balanced perspective on a subject that often leads to strong opinions.</p>
            <p> </p>
            <p> As they stay, the objective is to provide a focused case study of how testing is applied in the OpenWorm project. As such, the title is somewhat generic: I would suggest adding OpenWorm in there and possibly mentioning that this is a case study.</p>
            <p> Probably the most novel part of the work is the incorporation of "Model Validation Tests" which serve to verify that the components, such as ion channel models, from which the model is built, behave in line with experimental data. The authors state that "Ultimately, a scientific model is just another piece of software&#x2014;thus it can be validated with respect to a specification." In a sense this is true, but, as Ref 10 points out
                <sup>
                    <xref ref-type="bibr" rid="rep-ref-15597-1">1</xref>
                </sup> the specification in the literature is often vague, incomplete or generally erroneous. &#x00a0;The SciUnit "judge" method appears to be the answer to this, replacing the usual software testing "assert" function. Presumably a lot of the subtlety of the approach, and indeed the scientific input whether a model is indeed a good match to experiments, is embedded in the implementation of the various "judge" methods. &#x00a0;Although it is not essential for this paper it would be interesting to see a little more of how this is done in the OpenWorm project.</p>
            <p>Reviewer Expertise:</p>
            <p>NA</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
        <back>
            <ref-list>
                <title>References</title>
                <ref id="rep-ref-15597-1">
                    <label>1</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>The Dangers of Plug-and-Play Simulation Using Shared Models</article-title>.
                        <source>
                            <italic>Neuroinformatics</italic>
                        </source>.<year>2014</year>;
                        <elocation-id>10.1007/s12021-014-9224-7</elocation-id>
                        <pub-id pub-id-type="doi">10.1007/s12021-014-9224-7</pub-id>
                    </mixed-citation>
                </ref>
            </ref-list>
        </back>
    </sub-article>
</article>
