Hey,
In trying to remove deprecated method usage, I've found that quite a few tests in Wikibase.git are really complicated. Mostly this seems to be caused by trying to stuff tests for structurally very different behaviours in the same test method and data provider. There is no need to do this at all. The need for a control structure in a test method is very rare, and should be carefully considered. There is a lot of good material on the topic, though if you cannot find the time to look into that, just keep that simple guideline in mind: no control structures. Please keep the tests (and production code) simple!
Cheers
-- Jeroen De Dauw - http://www.bn2vs.com Software craftsmanship advocate Evil software architect at Wikimedia Germany ~=[,,_,,]:3
Hey,
Other things that I have come across a lot so far that are making the tests more complex then they need to be include
* calls to production code other then what is directly under test. There are several deprecated methods that are used only by tests. * tests that use fakes that emulate production code behaviour. Some fakes are extremely complex and have their own tests.
That is not to say all fakes are bad or that calls to additional production code should always be avoided. The cost of both should however be considered, and typically avoided.
Cheers
-- Jeroen De Dauw - http://www.bn2vs.com Software craftsmanship advocate Evil software architect at Wikimedia Germany ~=[,,_,,]:3
wikidata-tech@lists.wikimedia.org