exercism / php

Exercism exercises in PHP.
https://exercism.org/tracks/php
MIT License
144 stars 139 forks source link

Discussion: Use of data providers in test classes #755

Open mk-mxp opened 5 months ago

mk-mxp commented 5 months ago

Using data providers is a convenient way to reduce code and increase coherence inside the test classes. Having the test case data separated from the test code itself follows best practices and is encouraged in professional use.

But in Exercism it raises a bunch of problems:

So I would prefer to convert existing data provider based tests to flat test methods and not add new exercises with data providers.

Any opinions about that?

tomasnorre commented 2 months ago

As there are limited tests, even thought they are more or less always looking the same. I'm OK with not using dataproviders, if that improves user experience in Online Editor.

I would always reach for data providers personally in a private project, with descriptive keys.

But I think user experience is key here. We will not need to tweak tests that often.