Statistical Unit Tests with ensure4j

As part of another project I am developing ensure4j. The syntax (see the examples here) is working quite nicely, ensure4j is already very useful for internal use.

Lately I was busy adding tests that are able to verify if some code (e.g. an optimizer that uses random, like genetic algorithm, simulated annealing, …) produces the desired in e.g. 95% of the cases (Wikipedia has a nice practical example for confidence intervals).

Example Usage

Here is an example that tests the nonsense code Math.random() * 2.

ensure(new Experiment() {
    public double measure() {
        return Math.random() * 2;
    }
}).between(0.9, 1.1, 0.95).sample(10, 100);

The code most likely does not make much sense out of context like this, so here is an explanation of what it does:

Read more

How To Introduce a Wiki

On my quest of successfully installing a wiki at my workplace, I came to the conclusion that the biggest problem is a social one. On this quest, I fought with Google and other search engines to present you this list of great links to this topic:

There does not seem to be much information on this topic available, but it is something to start with.

svnlog2html

Subversion has the ability to output a log file in XML format. I think it would be pretty straightforward to implement an application in Ruby (mabe with use of Amrita), that creates some nice looking statistic about the repository.

On a side note, I have a personal subversion repository that contains everything I have accomplished during my study of Software Engineering in Hagenberg. This dates back to somewhere in 2000, and so far I am at revision 3628, and the repository uses about 500MB. It is a bit strange that 5 years worth of work can fit on a single CD 8-)

DoNoFo

SuperMemo is the only application I know of that tries to improve ones memory. The problem is that it is not free, and only works in Windows.

The idea is to write an application similar to supermemo called donofo (= do not forget), but written in a platform independent language (Ruby or XUL), and with mathematical based optimizer. Although the SuperMemo developer has done a lot of research, he seems to have not much of programming experience. The optimizer should be based on mathematical sound methods (bayesian networks?), I am pretty sure this can be done without stuff like neural networks or lots of parameters gathered through trial and error.

Ruby Programming Challenge

Python has a quite interesting programming challenge. Unfortunately it is not possible to do the challenge in any other programming language, because in the later levels it starts to depend on special libraries that are only available in Python.

The idea is to create a similar challenge that does not depend on a programming language. Ruby probably should be a very practical choice to get through all levels, but It should also be possible with Perl, Python, Java, or whatever. This would also be a very entertaining way to teach programming. It could work like a game with different episodes: string episode with 10 levels, an OOP episode, etc.