Difference between revisions of "BIST for m-files"

From Octave
Jump to navigation Jump to search
m (moved FilesMissingTests to Files missing tests: more readable non Camel case)
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
These m-files do not have built-in tests.
 
These m-files do not have built-in tests.
  
Sometimes this is because the function is interactive, like the @ftp class, and would be very difficult to test.
+
Sometimes this is because the function is interactive, like the inputdlg function, or reads data from a device like the @audiorecorder class, and would be very difficult to test.
  
 
Sometimes this is because the output is graphical, such as the plot routines, and would be difficult to test without image comparison routines.  These functions often have %!demo blocks instead.
 
Sometimes this is because the output is graphical, such as the plot routines, and would be difficult to test without image comparison routines.  These functions often have %!demo blocks instead.
Line 20: Line 20:
 
Before starting, take a look at Appendix B Test and Demo Functions and Appendix C Tips and Standards for what functions are available for testing and how to write code that conforms to Octave's coding guidelines.  Another good strategy is to look for %!test, %!testif, %!xtest blocks in existing m-files and see how they were coded.
 
Before starting, take a look at Appendix B Test and Demo Functions and Appendix C Tips and Standards for what functions are available for testing and how to write code that conforms to Octave's coding guidelines.  Another good strategy is to look for %!test, %!testif, %!xtest blocks in existing m-files and see how they were coded.
  
== Functions lacking tests (Jan. 10th, 2014) ==
+
== Functions lacking tests (as of December 15, 2015) ==
  
* @ftp/ascii.m
+
* audio/@audioplayer/__get_properties__.m
* @ftp/binary.m
+
* audio/@audioplayer/display.m
* @ftp/cd.m
+
* audio/@audioplayer/get.m
* @ftp/close.m
+
* audio/@audioplayer/isplaying.m
* @ftp/delete.m
+
* audio/@audioplayer/pause.m
* @ftp/dir.m
+
* audio/@audioplayer/play.m
* @ftp/display.m
+
* audio/@audioplayer/playblocking.m
* @ftp/ftp.m
+
* audio/@audioplayer/resume.m
* @ftp/loadobj.m
+
* audio/@audioplayer/set.m
* @ftp/mget.m
+
* audio/@audioplayer/stop.m
* @ftp/mkdir.m
+
* audio/@audioplayer/subsasgn.m
* @ftp/mput.m
+
* audio/@audioplayer/subsref.m
* @ftp/rename.m
+
* audio/@audiorecorder/__get_properties__.m
* @ftp/rmdir.m
+
* audio/@audiorecorder/display.m
* @ftp/saveobj.m
+
* audio/@audiorecorder/get.m
 +
* audio/@audiorecorder/getaudiodata.m
 +
* audio/@audiorecorder/getplayer.m
 +
* audio/@audiorecorder/isrecording.m
 +
* audio/@audiorecorder/pause.m
 +
* audio/@audiorecorder/play.m
 +
* audio/@audiorecorder/record.m
 +
* audio/@audiorecorder/recordblocking.m
 +
* audio/@audiorecorder/resume.m
 +
* audio/@audiorecorder/set.m
 +
* audio/@audiorecorder/stop.m
 +
* audio/@audiorecorder/subsasgn.m
 +
* audio/@audiorecorder/subsref.m
 
* audio/lin2mu.m
 
* audio/lin2mu.m
* audio/loadaudio.m
 
 
* audio/mu2lin.m
 
* audio/mu2lin.m
* audio/record.m
 
* audio/saveaudio.m
 
* audio/setaudio.m
 
* general/del2.m
 
 
* general/display.m
 
* general/display.m
 
* general/loadobj.m
 
* general/loadobj.m
Line 49: Line 56:
 
* general/saveobj.m
 
* general/saveobj.m
 
* general/subsindex.m
 
* general/subsindex.m
* geometry/delaunayn.m
 
 
* gui/errordlg.m
 
* gui/errordlg.m
 
* gui/guihandles.m
 
* gui/guihandles.m
Line 66: Line 72:
 
* gui/uiwait.m
 
* gui/uiwait.m
 
* gui/warndlg.m
 
* gui/warndlg.m
* help/__gripe_missing_component__.m
 
 
* help/lookfor.m
 
* help/lookfor.m
 
* image/autumn.m
 
* image/autumn.m
Line 74: Line 79:
 
* image/cool.m
 
* image/cool.m
 
* image/copper.m
 
* image/copper.m
 +
* image/cubehelix.m
 
* image/flag.m
 
* image/flag.m
* image/gmap40.m
 
 
* image/gray.m
 
* image/gray.m
 
* image/hot.m
 
* image/hot.m
 
* image/hsv.m
 
* image/hsv.m
* image/image.m
 
 
* image/imagesc.m
 
* image/imagesc.m
* image/imfinfo.m
 
 
* image/jet.m
 
* image/jet.m
 
* image/lines.m
 
* image/lines.m
Line 91: Line 94:
 
* image/spring.m
 
* image/spring.m
 
* image/summer.m
 
* image/summer.m
 +
* image/viridis.m
 
* image/white.m
 
* image/white.m
 
* image/winter.m
 
* image/winter.m
 
* java/javaArray.m
 
* java/javaArray.m
 +
* java/java_get.m
 +
* java/java_set.m
 
* java/javaaddpath.m
 
* java/javaaddpath.m
 
* java/javaclasspath.m
 
* java/javaclasspath.m
Line 99: Line 105:
 
* java/javarmpath.m
 
* java/javarmpath.m
 
* linear-algebra/krylov.m
 
* linear-algebra/krylov.m
* linear-algebra/subspace.m
 
* miscellaneous/bunzip2.m
 
* miscellaneous/cast.m
 
* miscellaneous/copyfile.m
 
* miscellaneous/debug.m
 
* miscellaneous/dir.m
 
* miscellaneous/dump_prefs.m
 
* miscellaneous/fact.m
 
* miscellaneous/fileattrib.m
 
* miscellaneous/getappdata.m
 
* miscellaneous/gunzip.m
 
* miscellaneous/info.m
 
* miscellaneous/menu.m
 
* miscellaneous/mex.m
 
 
* miscellaneous/mkoctfile.m
 
* miscellaneous/mkoctfile.m
* miscellaneous/movefile.m
+
* ode/odeplot.m
* miscellaneous/pack.m
 
* miscellaneous/parseparams.m
 
* miscellaneous/perl.m
 
* miscellaneous/python.m
 
* miscellaneous/tar.m
 
* miscellaneous/unpack.m
 
* miscellaneous/untar.m
 
* miscellaneous/unzip.m
 
* miscellaneous/what.m
 
* miscellaneous/zip.m
 
 
* optimization/glpk.m
 
* optimization/glpk.m
* path/pathdef.m
 
* path/savepath.m
 
 
* pkg/pkg.m
 
* pkg/pkg.m
* plot/appearance/__clabel__.m
 
* plot/appearance/__getlegenddata__.m
 
 
* plot/appearance/box.m
 
* plot/appearance/box.m
 
* plot/appearance/caxis.m
 
* plot/appearance/caxis.m
Line 188: Line 166:
 
* plot/draw/surfc.m
 
* plot/draw/surfc.m
 
* plot/draw/surfl.m
 
* plot/draw/surfl.m
* plot/draw/surfnorm.m
 
 
* plot/draw/tetramesh.m
 
* plot/draw/tetramesh.m
 
* plot/draw/triplot.m
 
* plot/draw/triplot.m
 
* plot/draw/waterfall.m
 
* plot/draw/waterfall.m
* plot/util/__actual_axis_position__.m
 
* plot/util/__default_plot_options__.m
 
* plot/util/__next_line_color__.m
 
* plot/util/__next_line_style__.m
 
* plot/util/__pltopt__.m
 
 
* plot/util/axes.m
 
* plot/util/axes.m
 
* plot/util/closereq.m
 
* plot/util/closereq.m
Line 202: Line 174:
 
* plot/util/gco.m
 
* plot/util/gco.m
 
* plot/util/hdl2struct.m
 
* plot/util/hdl2struct.m
* plot/util/linkprop.m
+
* plot/util/pan.m
 
* plot/util/print.m
 
* plot/util/print.m
 
* plot/util/refresh.m
 
* plot/util/refresh.m
 
* plot/util/refreshdata.m
 
* plot/util/refreshdata.m
 +
* plot/util/rotate3d.m
 
* plot/util/saveas.m
 
* plot/util/saveas.m
 
* plot/util/shg.m
 
* plot/util/shg.m
 
* plot/util/struct2hdl.m
 
* plot/util/struct2hdl.m
* plot/util/subplot.m
+
* plot/util/zoom.m
* prefs/addpref.m
 
* prefs/getpref.m
 
* prefs/ispref.m
 
* prefs/prefdir.m
 
* prefs/preferences.m
 
* prefs/setpref.m
 
 
* signal/arch_fit.m
 
* signal/arch_fit.m
 
* signal/arch_rnd.m
 
* signal/arch_rnd.m
Line 226: Line 193:
 
* signal/freqz_plot.m
 
* signal/freqz_plot.m
 
* signal/hurst.m
 
* signal/hurst.m
* signal/periodogram.m
 
 
* signal/spencer.m
 
* signal/spencer.m
 
* signal/stft.m
 
* signal/stft.m
Line 234: Line 200:
 
* sparse/etreeplot.m
 
* sparse/etreeplot.m
 
* sparse/treeplot.m
 
* sparse/treeplot.m
* special-matrix/gallery.m
 
 
* statistics/base/qqplot.m
 
* statistics/base/qqplot.m
 
* statistics/distributions/wienrnd.m
 
* statistics/distributions/wienrnd.m
Line 252: Line 217:
 
* statistics/tests/run_test.m
 
* statistics/tests/run_test.m
 
* statistics/tests/sign_test.m
 
* statistics/tests/sign_test.m
* statistics/tests/t_test.m
 
 
* statistics/tests/t_test_2.m
 
* statistics/tests/t_test_2.m
 
* statistics/tests/t_test_regression.m
 
* statistics/tests/t_test_regression.m
Line 259: Line 223:
 
* statistics/tests/welch_test.m
 
* statistics/tests/welch_test.m
 
* statistics/tests/wilcoxon_test.m
 
* statistics/tests/wilcoxon_test.m
* statistics/tests/z_test.m
 
 
* statistics/tests/z_test_2.m
 
* statistics/tests/z_test_2.m
* testfun/__have_feature__.m
+
 
* testfun/__printf_assert__.m
+
[[Category:Development]]
* testfun/__prog_output_assert__.m
+
[[Category:Testing]]
* testfun/__run_test_suite__.m
 

Latest revision as of 09:34, 3 October 2018

Overview[edit]

These m-files do not have built-in tests.

Sometimes this is because the function is interactive, like the inputdlg function, or reads data from a device like the @audiorecorder class, and would be very difficult to test.

Sometimes this is because the output is graphical, such as the plot routines, and would be difficult to test without image comparison routines. These functions often have %!demo blocks instead.

Sometimes the function is an internal one (begins with "__" and ends with "__"). These functions don't usually need tests by themselves as they are called by another function which does have tests written for it. Still it would be nice to remove these from the list by adding

 ## No test needed for internal helper function.
 %!assert (1)
 

to the internal function.

For the remainder, it's because no one has taken the time to write a test for them.

Before starting, take a look at Appendix B Test and Demo Functions and Appendix C Tips and Standards for what functions are available for testing and how to write code that conforms to Octave's coding guidelines. Another good strategy is to look for %!test, %!testif, %!xtest blocks in existing m-files and see how they were coded.

Functions lacking tests (as of December 15, 2015)[edit]

  • audio/@audioplayer/__get_properties__.m
  • audio/@audioplayer/display.m
  • audio/@audioplayer/get.m
  • audio/@audioplayer/isplaying.m
  • audio/@audioplayer/pause.m
  • audio/@audioplayer/play.m
  • audio/@audioplayer/playblocking.m
  • audio/@audioplayer/resume.m
  • audio/@audioplayer/set.m
  • audio/@audioplayer/stop.m
  • audio/@audioplayer/subsasgn.m
  • audio/@audioplayer/subsref.m
  • audio/@audiorecorder/__get_properties__.m
  • audio/@audiorecorder/display.m
  • audio/@audiorecorder/get.m
  • audio/@audiorecorder/getaudiodata.m
  • audio/@audiorecorder/getplayer.m
  • audio/@audiorecorder/isrecording.m
  • audio/@audiorecorder/pause.m
  • audio/@audiorecorder/play.m
  • audio/@audiorecorder/record.m
  • audio/@audiorecorder/recordblocking.m
  • audio/@audiorecorder/resume.m
  • audio/@audiorecorder/set.m
  • audio/@audiorecorder/stop.m
  • audio/@audiorecorder/subsasgn.m
  • audio/@audiorecorder/subsref.m
  • audio/lin2mu.m
  • audio/mu2lin.m
  • general/display.m
  • general/loadobj.m
  • general/profexplore.m
  • general/saveobj.m
  • general/subsindex.m
  • gui/errordlg.m
  • gui/guihandles.m
  • gui/helpdlg.m
  • gui/inputdlg.m
  • gui/listdlg.m
  • gui/msgbox.m
  • gui/questdlg.m
  • gui/uicontextmenu.m
  • gui/uicontrol.m
  • gui/uipanel.m
  • gui/uipushtool.m
  • gui/uiresume.m
  • gui/uitoggletool.m
  • gui/uitoolbar.m
  • gui/uiwait.m
  • gui/warndlg.m
  • help/lookfor.m
  • image/autumn.m
  • image/bone.m
  • image/brighten.m
  • image/colorcube.m
  • image/cool.m
  • image/copper.m
  • image/cubehelix.m
  • image/flag.m
  • image/gray.m
  • image/hot.m
  • image/hsv.m
  • image/imagesc.m
  • image/jet.m
  • image/lines.m
  • image/ocean.m
  • image/pink.m
  • image/prism.m
  • image/rainbow.m
  • image/spinmap.m
  • image/spring.m
  • image/summer.m
  • image/viridis.m
  • image/white.m
  • image/winter.m
  • java/javaArray.m
  • java/java_get.m
  • java/java_set.m
  • java/javaaddpath.m
  • java/javaclasspath.m
  • java/javamem.m
  • java/javarmpath.m
  • linear-algebra/krylov.m
  • miscellaneous/mkoctfile.m
  • ode/odeplot.m
  • optimization/glpk.m
  • pkg/pkg.m
  • plot/appearance/box.m
  • plot/appearance/caxis.m
  • plot/appearance/clabel.m
  • plot/appearance/daspect.m
  • plot/appearance/diffuse.m
  • plot/appearance/grid.m
  • plot/appearance/hidden.m
  • plot/appearance/pbaspect.m
  • plot/appearance/shading.m
  • plot/appearance/specular.m
  • plot/draw/bar.m
  • plot/draw/barh.m
  • plot/draw/colorbar.m
  • plot/draw/comet.m
  • plot/draw/comet3.m
  • plot/draw/contour3.m
  • plot/draw/contourf.m
  • plot/draw/cylinder.m
  • plot/draw/ellipsoid.m
  • plot/draw/ezcontour.m
  • plot/draw/ezcontourf.m
  • plot/draw/ezmesh.m
  • plot/draw/ezmeshc.m
  • plot/draw/ezplot.m
  • plot/draw/ezplot3.m
  • plot/draw/ezpolar.m
  • plot/draw/ezsurf.m
  • plot/draw/ezsurfc.m
  • plot/draw/fill.m
  • plot/draw/loglogerr.m
  • plot/draw/mesh.m
  • plot/draw/meshc.m
  • plot/draw/meshz.m
  • plot/draw/pareto.m
  • plot/draw/pcolor.m
  • plot/draw/peaks.m
  • plot/draw/pie.m
  • plot/draw/pie3.m
  • plot/draw/plot.m
  • plot/draw/plot3.m
  • plot/draw/plotmatrix.m
  • plot/draw/plotyy.m
  • plot/draw/polar.m
  • plot/draw/quiver.m
  • plot/draw/quiver3.m
  • plot/draw/rectangle.m
  • plot/draw/ribbon.m
  • plot/draw/rose.m
  • plot/draw/scatter.m
  • plot/draw/scatter3.m
  • plot/draw/semilogxerr.m
  • plot/draw/semilogyerr.m
  • plot/draw/slice.m
  • plot/draw/sphere.m
  • plot/draw/surf.m
  • plot/draw/surfc.m
  • plot/draw/surfl.m
  • plot/draw/tetramesh.m
  • plot/draw/triplot.m
  • plot/draw/waterfall.m
  • plot/util/axes.m
  • plot/util/closereq.m
  • plot/util/findfigs.m
  • plot/util/gco.m
  • plot/util/hdl2struct.m
  • plot/util/pan.m
  • plot/util/print.m
  • plot/util/refresh.m
  • plot/util/refreshdata.m
  • plot/util/rotate3d.m
  • plot/util/saveas.m
  • plot/util/shg.m
  • plot/util/struct2hdl.m
  • plot/util/zoom.m
  • signal/arch_fit.m
  • signal/arch_rnd.m
  • signal/arch_test.m
  • signal/arma_rnd.m
  • signal/diffpara.m
  • signal/durbinlevinson.m
  • signal/filter2.m
  • signal/fractdiff.m
  • signal/freqz_plot.m
  • signal/hurst.m
  • signal/spencer.m
  • signal/stft.m
  • signal/synthesis.m
  • signal/yulewalker.m
  • sparse/colperm.m
  • sparse/etreeplot.m
  • sparse/treeplot.m
  • statistics/base/qqplot.m
  • statistics/distributions/wienrnd.m
  • statistics/models/logistic_regression.m
  • statistics/tests/anova.m
  • statistics/tests/bartlett_test.m
  • statistics/tests/chisquare_test_homogeneity.m
  • statistics/tests/chisquare_test_independence.m
  • statistics/tests/cor_test.m
  • statistics/tests/f_test_regression.m
  • statistics/tests/hotelling_test.m
  • statistics/tests/hotelling_test_2.m
  • statistics/tests/kolmogorov_smirnov_test_2.m
  • statistics/tests/manova.m
  • statistics/tests/mcnemar_test.m
  • statistics/tests/prop_test_2.m
  • statistics/tests/run_test.m
  • statistics/tests/sign_test.m
  • statistics/tests/t_test_2.m
  • statistics/tests/t_test_regression.m
  • statistics/tests/u_test.m
  • statistics/tests/var_test.m
  • statistics/tests/welch_test.m
  • statistics/tests/wilcoxon_test.m
  • statistics/tests/z_test_2.m