TheProlog / prolog-use_cases

Use-case layer for Meldd/Prolog application.
0 stars 0 forks source link

Clean up and DRY up tests. #64

Open jdickey opened 8 years ago

jdickey commented 8 years ago

There is lots of duplicate code in tests, especially things like dummied collaborator objects, repetitive parameter validation, etc, etc. There's also numerous test cases that make multiple assertions; this has been identified by the larger community as an irritating code smell.

We know that several classes' fixture setup is more onerous than the code the tests execute; this itself is another important code smell suggesting that the classes being tested "do too much" on their own and could usefully be decomposed into smaller, more granular classes.

Come to think of it, we've recently recognised that our deep-namespace naming conventions aren't consistently helpful either, but that should be thought through as each source class is maintained, rather than going on a weeks-long "fix everything" yak shave; let's just simply resolve in future to avoid deep namespacing of classes that aren't part of the public API or duplicating the non-namespaced name of another class (why have different multi-use classes with the same name that do different things?),

But if we have to copy and paste five more repository class fixtures, we're likely to break something both physical and essential. 😡

Pull requests welcome, in case you weren't tipped off by the "help wanted" label.