Posts

Showing posts from October, 2008

Generating tests in Python unittest

There are many applications where you want to apply a code to a variety of data sets, and verify that you get the correct output. In this context, what you want is a test generator, which can dynamically create tests, based on the set of data sets that are available for testing. Unfortunately, this does not appear to be a feature of unittest . The closest I have seen to this, is the support for test generators in the nose package, which extends unittest to provide test discovery mechanisms. However, that test generation feature is somewhat limited; it only applies to test functions that are Python generators, and not to similar class methods. The following example shows how to directly insert new test methods into a unittest.TestCase class : # # A simple example for generating tests in the Python unittest framework # import glob import unittest # # Defining the class that will contain the new tests # class TestCases(unittest.TestCase): pass # # A generic function that performs a te

Constraint Programming

Nick Berger pointed me to the Global Constraint Catalog , a collection of constraints that are can be used for constraint programming formulations.  This looks like a nice reference!

New Journal: Mathematical Programming Computation

I have recently joined the editorial board of the new journal Mathematical Programming Computation , which publishes original research articles that are at the intersection of math programming and computing. This journal reflects the growing role of computation in operations research, where real-world applications often require the application of complex software packages to analyze mathematical models. This journal will include articles that report on innovative software, comparative tests, modeling environments, libraries of data, and/or applications. A main feature of the journal is the inclusion of accompanying software and data with submitted manuscripts. The journal's review process includes the evaluation and testing of the accompanying software. Where possible, the review will aim for verification of reported computational results. Topics covered in Mathematical Programming Computation include linear programming, convex optimization, nonlinear optimization, stochastic opti