Code covered by the BSD License  

Highlights from
Automatic validation of software

  • prtest1 For demonstration of the VALIDATE function. No intrinsic value!
  • prtest2 For demonstration of the VALIDATE function. No intrinsic value!
  • prtest3 For demonstration of the VALIDATE function. No intrinsic value!
  • validate(dirname) VALIDATE Validate software using standard test files.
  • View all files
Be the first to rate this file! 1 Download (last 30 days) File Size: 3.07 KB File ID: #20037

Automatic validation of software

by Toby Driscoll

 

23 May 2008 (Updated 22 Jul 2008)

Validate software using a test library of functions in a directory.

| Watch this File

File Information
Description

When developing a software package, it is useful to test changes by periodically running all the functions in a validation library. This function automates the process.

VALIDATE DIRNAME runs each M-file in the directory DIRNAME. Each M-file
should be a function that takes no inputs and returns a logical vector
or scalar. Three outcomes are possible:

  'passed' All return values are true.
  'failed' Some return value is false.
  'crashed' Function threw an error.

A report is generated dynamically in the command window.

VALIDATE by itself tries to find a directory named 'validtests' in the
directory in which validate.m resides.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
27 May 2008 John D'Errico

This seems pretty good. In fact, it is a problem that we had to deal with in my previous job, validating large libraries of code.

I did find one line that caused some difficulty however. What is this? Both MATLAB and Google fail to find it.

chebfunpref('factory');

I won't rate this code until the above question is resolved, since I can't test it. However, I'd probably have given the submission a fairly high rating. There is good help, the logical error checking, and the author has used tools like filesep and fullfile so the code will be insensitive to your particular operating system.

20 Nov 2008 Toby Driscoll

The line in the comment above was accidentally left over from the project that inspired the submission. I have removed it and the package should work now.

Please login to add a comment or rating.
Updates
22 Jul 2008

Bug due to an errant line as noted in the first review.

Tag Activity for this File
Tag Applied By Date/Time
development environment Toby Driscoll 22 Oct 2008 10:03:21
software Toby Driscoll 22 Oct 2008 10:03:21
programming Toby Driscoll 22 Oct 2008 10:03:21
development Toby Driscoll 22 Oct 2008 10:03:21
validation Toby Driscoll 22 Oct 2008 10:03:21
testing Toby Driscoll 22 Oct 2008 10:03:21
unit testing Ryan Ollos 23 Sep 2009 17:50:01
validation Ryan Ollos 23 Sep 2009 17:50:14

Contact us at files@mathworks.com