<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cs.earlham.edu/index.php?action=history&amp;feed=atom&amp;title=BCCD%3ARegression_Testing</id>
	<title>BCCD:Regression Testing - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cs.earlham.edu/index.php?action=history&amp;feed=atom&amp;title=BCCD%3ARegression_Testing"/>
	<link rel="alternate" type="text/html" href="https://wiki.cs.earlham.edu/index.php?title=BCCD:Regression_Testing&amp;action=history"/>
	<updated>2026-07-22T07:22:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.cs.earlham.edu/index.php?title=BCCD:Regression_Testing&amp;diff=5408&amp;oldid=prev</id>
		<title>Tmcnulty at 18:30, 30 March 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.cs.earlham.edu/index.php?title=BCCD:Regression_Testing&amp;diff=5408&amp;oldid=prev"/>
		<updated>2008-03-30T18:30:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:30, 30 March 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l54&quot;&gt;Line 54:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 54:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===show-results.php===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===show-results.php===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This script handles the analysis and display of the regression test data that resides in the SQL tables created by &amp;lt;code&amp;gt;post-results.php&amp;lt;/code&amp;gt;.  Per regression test, it operates with the folllowing parameters: (a) a table name; (b) an array of check columns, i.e., columns that contain the actual test data that we&#039;re concerned with; and (c) an array of control columns, i.e., columns whose values determine the grouping of data within each test table, e.g., if one&#039;s control columns are &#039;processor&#039; and &#039;node_count&#039;, then &amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt; will discover every possible combination (between columns) of distinct column cell values and use that set of combinations to group test data prior to analysis and display.  Each grouping combination includes exactly one value from every control column.  This is easier understood when seen than when described (due in a large part to my inability to describe the system at hand), so visit the [http://cluster.earlham.edu/~&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tmcnulty&lt;/del&gt;/bccdrt/ actual script] and see what it does for yourself!&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This script handles the analysis and display of the regression test data that resides in the SQL tables created by &amp;lt;code&amp;gt;post-results.php&amp;lt;/code&amp;gt;.  Per regression test, it operates with the folllowing parameters: (a) a table name; (b) an array of check columns, i.e., columns that contain the actual test data that we&#039;re concerned with; and (c) an array of control columns, i.e., columns whose values determine the grouping of data within each test table, e.g., if one&#039;s control columns are &#039;processor&#039; and &#039;node_count&#039;, then &amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt; will discover every possible combination (between columns) of distinct column cell values and use that set of combinations to group test data prior to analysis and display.  Each grouping combination includes exactly one value from every control column.  This is easier understood when seen than when described (due in a large part to my inability to describe the system at hand), so visit the [http://cluster.earlham.edu/~&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tobias&lt;/ins&gt;/bccdrt/ actual script] and see what it does for yourself!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, to make &amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt; aware of your newly-defined regression test, simply create an associative array containing your table name (&amp;lt;code&amp;gt;tbname&amp;lt;/code&amp;gt;), array of check columns (&amp;lt;code&amp;gt;check_cols&amp;lt;/code&amp;gt;), and array of control columns (&amp;lt;code&amp;gt;control_cols&amp;lt;/code&amp;gt;) and append it to the &amp;lt;code&amp;gt;$tests&amp;lt;/code&amp;gt; array.  The table name is the test name prefixed by &amp;lt;code&amp;gt;rt_&amp;lt;/code&amp;gt;, and the column names are exactly the same as those passed to &amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt; in the original Python.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, to make &amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt; aware of your newly-defined regression test, simply create an associative array containing your table name (&amp;lt;code&amp;gt;tbname&amp;lt;/code&amp;gt;), array of check columns (&amp;lt;code&amp;gt;check_cols&amp;lt;/code&amp;gt;), and array of control columns (&amp;lt;code&amp;gt;control_cols&amp;lt;/code&amp;gt;) and append it to the &amp;lt;code&amp;gt;$tests&amp;lt;/code&amp;gt; array.  The table name is the test name prefixed by &amp;lt;code&amp;gt;rt_&amp;lt;/code&amp;gt;, and the column names are exactly the same as those passed to &amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt; in the original Python.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-3892:rev-5408:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Tmcnulty</name></author>
	</entry>
	<entry>
		<id>https://wiki.cs.earlham.edu/index.php?title=BCCD:Regression_Testing&amp;diff=3892&amp;oldid=prev</id>
		<title>Tmcnulty: move from Powerpc</title>
		<link rel="alternate" type="text/html" href="https://wiki.cs.earlham.edu/index.php?title=BCCD:Regression_Testing&amp;diff=3892&amp;oldid=prev"/>
		<updated>2005-10-07T03:16:43Z</updated>

		<summary type="html">&lt;p&gt;move from Powerpc&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Regression Testing=&lt;br /&gt;
==Executing the Tests==&lt;br /&gt;
To execute the regression tests included with bccdrt on a running copy of the BCCD, simply checkout the &amp;lt;code&amp;gt;bccdrt&amp;lt;/code&amp;gt; module from CVS on &amp;lt;code&amp;gt;bccd.cs.uni.edu&amp;lt;/code&amp;gt; and start &amp;lt;code&amp;gt;runtests.py&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export CVSROOT=username@bccd.cs.uni.edu:/var/lib/cvs/var/lib/cvs # you aren&amp;#039;t seeing double and this isn&amp;#039;t a typo!&lt;br /&gt;
cvs co bccdrt&lt;br /&gt;
cd bccdrt&lt;br /&gt;
./runtests.py # run list-packages and install python first if need be&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==System Overview==&lt;br /&gt;
This section exposes the architecture behind bccdrt, which refers generally to the collection of Python and PHP scripts than handle the execution and data extraction (&amp;lt;code&amp;gt;bccdrt.py&amp;lt;/code&amp;gt;), recording (&amp;lt;code&amp;gt;post-results.php&amp;lt;/code&amp;gt;), and analysis (&amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt;) of BCCD regression tests (the scripts were written and tested on PPC, but can be used on any architecture the BCCD supports).&lt;br /&gt;
&lt;br /&gt;
===htdocs===&lt;br /&gt;
This directory houses the PHP scripts that record and analyze test data.&lt;br /&gt;
&lt;br /&gt;
===rt.d===&lt;br /&gt;
This directory houses individual test scripts and the bccdrt library, which provides several routines to the individual tests (see [[#bccdrt.py|bccdrt.py]] below).&lt;br /&gt;
&lt;br /&gt;
===runtests.py===&lt;br /&gt;
This script calls some generic bccd cluster initialization routines (&amp;lt;code&amp;gt;bccd-allowall&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bccd-snarfhosts&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;bccd-checkem machines&amp;lt;/code&amp;gt;) and then executes each of the tests in the &amp;lt;code&amp;gt;rt.d&amp;lt;/code&amp;gt; directory.  No per-test modification of &amp;lt;code&amp;gt;runtests.py&amp;lt;/code&amp;gt; is necessary.&lt;br /&gt;
&lt;br /&gt;
===bccdrt.py===&lt;br /&gt;
This library provides several routines to individal tests, including &amp;lt;code&amp;gt;system(...)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;runcmd(...)&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt;. It resides in the &amp;lt;code&amp;gt;rt.d&amp;lt;/code&amp;gt; directory, but contains no actual test code itself.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;system(...)&amp;lt;/code&amp;gt; takes a single argument in the form of a shell command, executes that command, and allows the output to print to the console.&lt;br /&gt;
*&amp;lt;code&amp;gt;runcmd(...)&amp;lt;/code&amp;gt; does the same thing, but returns the output (both stdout and stderr) as a string.&lt;br /&gt;
*&amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt; takes two arguments: the test name and an associative array of your test data (column) names and values.  &amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt; adds the generic test data, like machine name, BCCD release, etc., encodes the data in XML, and posts it to &amp;lt;code&amp;gt;post-results.php&amp;lt;/code&amp;gt; via HTTP.&lt;br /&gt;
&lt;br /&gt;
To define a new test, write a new script in Python that executes whatever programs on the BCCD the test involves and then extracts the relevant data from them (e.g., with regular expressions).  There is an sample test in &amp;lt;code&amp;gt;rt.d&amp;lt;/code&amp;gt; named &amp;lt;code&amp;gt;gromacs.py&amp;lt;/code&amp;gt;.  The only call your test function must make is to &amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example: Creating the associative array and calling &amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import bccdrt&lt;br /&gt;
&lt;br /&gt;
result={}&lt;br /&gt;
&lt;br /&gt;
result[&amp;quot;molecule&amp;quot;] = os.path.basename(moleculedir)&lt;br /&gt;
result[&amp;quot;np&amp;quot;] = np&lt;br /&gt;
result[&amp;quot;walltime&amp;quot;] = Real&lt;br /&gt;
result[&amp;quot;psNODEhr&amp;quot;] = psNODEhr&lt;br /&gt;
&lt;br /&gt;
postresult(&amp;quot;gromacs&amp;quot;,result)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===post-results.php===&lt;br /&gt;
This script is generally responsible for recording data as posted by &amp;lt;code&amp;gt;bccdrt.py&amp;lt;/code&amp;gt;.  This involves the following:&lt;br /&gt;
* receiving the XML-encoded data from &amp;lt;code&amp;gt;bccdrt.py&amp;lt;/code&amp;gt;&lt;br /&gt;
* determining the SQL table format from the given data names and values&lt;br /&gt;
* creating the SQL table if necessary&lt;br /&gt;
* inserting the given data into the table&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What does this mean for you?&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;post-results.php&amp;lt;/code&amp;gt; is entirely automatic; that is, it requires no per-test modification to operate.&lt;br /&gt;
&lt;br /&gt;
===show-results.php===&lt;br /&gt;
This script handles the analysis and display of the regression test data that resides in the SQL tables created by &amp;lt;code&amp;gt;post-results.php&amp;lt;/code&amp;gt;.  Per regression test, it operates with the folllowing parameters: (a) a table name; (b) an array of check columns, i.e., columns that contain the actual test data that we&amp;#039;re concerned with; and (c) an array of control columns, i.e., columns whose values determine the grouping of data within each test table, e.g., if one&amp;#039;s control columns are &amp;#039;processor&amp;#039; and &amp;#039;node_count&amp;#039;, then &amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt; will discover every possible combination (between columns) of distinct column cell values and use that set of combinations to group test data prior to analysis and display.  Each grouping combination includes exactly one value from every control column.  This is easier understood when seen than when described (due in a large part to my inability to describe the system at hand), so visit the [http://cluster.earlham.edu/~tmcnulty/bccdrt/ actual script] and see what it does for yourself!&lt;br /&gt;
&lt;br /&gt;
So, to make &amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt; aware of your newly-defined regression test, simply create an associative array containing your table name (&amp;lt;code&amp;gt;tbname&amp;lt;/code&amp;gt;), array of check columns (&amp;lt;code&amp;gt;check_cols&amp;lt;/code&amp;gt;), and array of control columns (&amp;lt;code&amp;gt;control_cols&amp;lt;/code&amp;gt;) and append it to the &amp;lt;code&amp;gt;$tests&amp;lt;/code&amp;gt; array.  The table name is the test name prefixed by &amp;lt;code&amp;gt;rt_&amp;lt;/code&amp;gt;, and the column names are exactly the same as those passed to &amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt; in the original Python.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example: Defining a test in show-results.php&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$tests = array( array(  &amp;quot;tbname&amp;quot; =&amp;gt; &amp;quot;rt_gromacs&amp;quot;,&lt;br /&gt;
                        &amp;quot;check_cols&amp;quot; =&amp;gt; array(&amp;quot;walltime&amp;quot;,&amp;quot;psNODEhr&amp;quot;),&lt;br /&gt;
                        &amp;quot;control_cols&amp;quot; =&amp;gt; array(&amp;quot;machine&amp;quot;,&amp;quot;molecule&amp;quot;,&amp;quot;np&amp;quot;) )&lt;br /&gt;
               );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt; then iterates through &amp;lt;code&amp;gt;$tests&amp;lt;/code&amp;gt; in the body of the HTML document, calling &amp;lt;code&amp;gt;showResults(...)&amp;lt;/code&amp;gt; with the parameters defined in each element.&lt;br /&gt;
&lt;br /&gt;
==Recap: Creating a New Test==&lt;br /&gt;
That&amp;#039;s a lot of talk for a relatively simple process.  Here&amp;#039;s the basic outline once more of what creating a new regression test involves:&lt;br /&gt;
&lt;br /&gt;
* 1. write the actual test in Python and call &amp;lt;code&amp;gt;postresult(...)&amp;lt;/code&amp;gt; to send the test data to the result server&lt;br /&gt;
* 2. drop your test in the &amp;lt;code&amp;gt;rt.d&amp;lt;/code&amp;gt; directory&lt;br /&gt;
* 3. define your test&amp;#039;s table name, check columns, and control columns in &amp;lt;code&amp;gt;show-results.php&amp;lt;/code&amp;gt;&lt;br /&gt;
* 4. commit your changes to CVS, update the CVS module on the result server, and [[#Executing_the_Tests|execute the tests]].&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
===How does show-results.php analyze test data?===&lt;br /&gt;
The analysis script calculates the standard deviation of each grouping of each check column and from that determines, on a per-cell basis, outliers in the data set, i.e., possible test failures (1*S).  Cells that pass the test are given the CSS class &amp;lt;code&amp;gt;rt_pass&amp;lt;/code&amp;gt;, and cells that fail &amp;lt;code&amp;gt;rt_fail&amp;lt;/code&amp;gt;.  Currently, the stylesheet marks passes green and potential failures red.&lt;br /&gt;
&lt;br /&gt;
==TODO==&lt;br /&gt;
* Implement early failure detection and reporting (e.g., &amp;quot;this command doesn&amp;#039;t even run&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
That brings a close to our discussion of BCCD regression testing.  Please direct any questions, comments, or suggestions to the system&amp;#039;s author, [mailto:tmcnulty@ppckernel.org Tobias McNulty].&lt;/div&gt;</summary>
		<author><name>Tmcnulty</name></author>
	</entry>
</feed>