|
|
|
Regular expressions are very powerful, but most of them in Moodle are untested. Ideally we should unit-test every regular expression with a wide range of inputs.
This is difficult for one main reason: often the regular expressions are not accessible to unit tests, they are deeply embedded in the logic and have strong coupling.
One solution is to extract all static regular expressions into constants, and dynamic expressions into functions. Unit tests can then be written for them easily.
|
|
Description
|
Regular expressions are very powerful, but most of them in Moodle are untested. Ideally we should unit-test every regular expression with a wide range of inputs.
This is difficult for one main reason: often the regular expressions are not accessible to unit tests, they are deeply embedded in the logic and have strong coupling.
One solution is to extract all static regular expressions into constants, and dynamic expressions into functions. Unit tests can then be written for them easily. |
Show » |
made changes - 13/Nov/09 04:08 PM
| Field |
Original Value |
New Value |
|
Assignee
|
Nicolas Connault
[ nicolasconnault
]
|
moodle.com
[ moodle.com
]
|
|