{"id":302,"date":"2012-09-22T13:54:44","date_gmt":"2012-09-22T13:54:44","guid":{"rendered":"http:\/\/ahay.org\/blog\/?p=302"},"modified":"2015-08-04T23:51:33","modified_gmt":"2015-08-04T23:51:33","slug":"how-is-regression-testing-done-in-madagascar","status":"publish","type":"post","link":"https:\/\/ahay.org\/blog\/2012\/09\/22\/how-is-regression-testing-done-in-madagascar\/","title":{"rendered":"How is regression testing done in Madagascar?"},"content":{"rendered":"<p>Testing for reproducibility is an important principle behind Madagascar&#8217;s design. It works on several levels.<\/p>\n<ol>\n<li>Inside a project directory (with <tt>SConstruct<\/tt> file that contains <strong>from rsf.proj import *<\/strong>), run\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >scons lock<\/pre><\/div>\n<p>to create <em>Result<\/em> files (figures) and to copy them to a different location (specified by <strong>RSFFIGS<\/strong> or <tt>$RSFROOT\/share\/madagascar\/figs<\/tt> by default). Papers included with Madagascar (under <tt>$RSFSRC\/book<\/tt>) have their result figures saved in a <a href=\"\/wiki\/Download#Reproducible_figures\">repository<\/a>.<br \/>\nTo come back and test if the results are still reproducible, run <\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >scons test<\/pre><\/div>\n<p> or <\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >scons figurename.test<\/pre><\/div>\n<p>This command performs an intelligent comparison of figures using Joe Dellinger&#8217;s <a href=\"\/RSF\/sfvplotdiff.html\">sfvplotdiff<\/a> and reports an error if the figures are different. In the case of an error, you can run<\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >scons figurename.flip<\/pre><\/div>\n<p> to flip between the new version of the figure and the old version and on the screen and to compare them visually. Based on that comparison, you can either &#8220;lock&#8221; the new version with <\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >scons figurename.lock<\/pre><\/div>\n<p> or debug the error that caused the difference and try to fix it.<\/li>\n<li>To test all projects where a particular program, say <tt>sfspike<\/tt>, is used, run\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >cd $RSFSRC\/book; scons sfspike.test<\/pre><\/div>\n<p> This is useful for regression testing for changes in programs that may cause reproducibility failures. You can also run <\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >cd $RSFSRC\/book; scons test<\/pre><\/div>\n<p> to test all projects and all Madagascar programs. By default, testing is limited to projects that use only publicly available data and less that 1 Mb of disk space. This behavior can be changes by giving <tt>all=y<\/tt> or <tt>size=<\/tt> parameters to <tt>scons test<\/tt>.<\/li>\n<li>A collection of scripts developed by Jim Jennings and explained on the <a href=\"\/wiki\/Automatic_Testing\">Automatic Testing<\/a> page performs fine-grain testing with extended diagnostics.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Testing for reproducibility is an important principle behind Madagascar&#8217;s design. It works on several levels. Inside a project directory (with SConstruct file that contains from rsf.proj import *), run scons lock to create Result files (figures) and to copy them to a different location (specified by RSFFIGS or $RSFROOT\/share\/madagascar\/figs by default). Papers included with Madagascar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[4],"tags":[],"class_list":["post-302","post","type-post","status-publish","format-standard","hentry","category-faq"],"_links":{"self":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/comments?post=302"}],"version-history":[{"count":1,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":613,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/302\/revisions\/613"}],"wp:attachment":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}