Solver check section

From Algebra.Com's Help
Jump to: navigation, search

This article is part of the help section on Defining solvers.

A solver must have a check section. Its objective is to verify, in an automated way, that your solver is still working after you changed something. If you properly define a check section in the beginning, it will catch mistakes that you may introduce later. I think that having a wrong solver is highly embarrassing, and this section will help you avoid embarrassment.

Solvers without check sections or those that do not pass the check section, will automatically not be allowed to be promoted to production.

What a check section does is lists several combinations of input values and output values that should be produced. If the solver with these inputs produces given outputs, it is considered to be valid. For many problems, having one combination is enough, but for some, more than one will be necessary. Having a good check section will save you from embarrassment.

A check section is defined similarly to other section. In the text of your solver, on a new line, from the beginning of the line, type

==section check

Then proceed and type your input. Example:

==section check
  diff=24 after=20 times=2 bobs_age=28 janes_age=4

In this example, it is saying that input variables diff=24, after=20 and times=2 produce outputs bobs_age=28 and janes_age=4. Input variables are defined in the input section and output variables are defined in output section.

When your solver is checked by my system, it will verify that the mentioned inputs produce the mentioned outputs. If that is not the case, you will be alerted and your solver will not be allowed to be promoted to production.