unicode-org / icu4x

Solving i18n for client-side and resource-constrained environments.
https://icu4x.unicode.org
Other
1.33k stars 173 forks source link

Data-driven testing #51

Open echeran opened 4 years ago

echeran commented 4 years ago

One part of the larger testing strategy for ICU4X would be to have a clean, consistent way of organizing the unit tests for the business logic (i18n algorithms). In particular, it would be nice to have a data-oriented style of testing, as exemplified already in some parts of @zbraniecki's unic-locale repo. ICU unit tests tend to be written in a parameterized style, but the idea here is to take the data-driven nature further.

Pros and Cons

Pros:

Cons:

Existing libraries

Most searches for "data driven testing" produce results for databases, spreadsheets, and automated web UI testing. Links to more relevant pre-existing libraries are welcome.

Some examples of test libraries written to reduce the cognitive load when testing, especially when testing data collections:

Beyond just asserting that the actual return value matches the provided expected value, we should also consider the following testing aspects:

nciric commented 4 years ago

Since we play a lot with JSON (test data etc) - this may be helpful - JSON Schema.

JSON Schema

sffc commented 3 years ago

I'm merging #223 and #410 into this issue. Some notes from those issues:

sffc commented 2 years ago

Related: https://unicode-org.atlassian.net/browse/CLDR-15111