# 4. Testing¶

The first thing we have to do after the compilation of the Tex is to create a new test input. To do so, click an the "Manage Tests" button in the toolbar:

A new window will pop up and now we have to provide test input. Mark the program problem you want to insert a test input for in the left frame and click on the "New Test" button.

Now you have to enter a title for the test and the code the user usually writes in the text field of the problem web page. After that don't forget to click the "Save Test" button.

The surroundings of the text field come from the prganswer environment
of the corresponding tex document. This means, while entering the code
you see the exact same answer-block that will be seen on the web page.

As a first test, we fill in the sample answer und give it a title:

int length = array.length;
int min = Integer.MAX_VALUE;
for ( int i = 0; i < length; ++i )
min = Math.min(min, array[i]);
return min;


After clicking the "Save Test" button MIAU offers you to open the correction preview in Firefox.
Click "Yes". The following web page shows up in Firefox in a new tab:

You can create more tests by repeating the steps above with different inputs, correct and wrong ones.

If you wish to delete one or multiple tests, mark them in the "Manage Tests" dialog and click the delete button.

You can also run multiple tests in batch mode by clicking "Run Tests".

Running a test in batch mode means applying the corrector to the stored input datasheet and comparing the resulting correction datasheet with the stored one. The test has passed if no error occurs and the resulting correction coincides with the stored one. Otherwise, the test fails. The test status (running, passed, or failed) is displayed in MIAU standard output console.