Timeline for Test cases do all the work through helper method -- bad practice?
Current License: CC BY-SA 3.0
15 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2017 at 12:40 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Apr 12, 2017 at 7:31 | history | edited | CommunityBot | replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/ | |
| Mar 13, 2016 at 20:34 | answer | added | thepacker | timeline score: 0 | |
| Mar 13, 2016 at 19:55 | vote | accept | Attilio | ||
| Mar 13, 2016 at 19:54 | history | edited | Attilio | CC BY-SA 3.0 | test case names changed to soemthing meaningful |
| Mar 10, 2016 at 11:55 | answer | added | Marjan Venema | timeline score: 3 | |
| Mar 10, 2016 at 9:23 | comment | added | Thijs Riezebeek | Abstracting functions and setup functions in tests is not a bad thing. However reading a test function should clarify what it is testing. Even reading only the test name should indicate this. Furthermore your example could probably be solved better with a dataProvider | |
| Mar 10, 2016 at 9:22 | comment | added | Attilio | RE setup/teardown: I am not sure why not use the special methods (I did not write this code, found it in the project I'm working on) -- probably it can be refactored in that way RE assertions: both the expected and the actual values are parameters, passed to the assertion helper method (see Remark 3.) | |
| Mar 10, 2016 at 8:42 | answer | added | Matthew Walton | timeline score: 0 | |
| Mar 9, 2016 at 20:48 | comment | added | wonderbell | I am curious to know how are you handling assertion part in your helper. For tests, intended output is fixed for the given input, and can be easily tested with parameterized tests. If you are doing something dramatically complex in the test helper assertion, then I would say it indicates a code smell in your actual method being tested. | |
| Mar 9, 2016 at 19:17 | comment | added | user40980 | ... and if you're doing different setups and tear downs for different sets of tests within a class, put them in separate classes. | |
| Mar 9, 2016 at 18:59 | answer | added | Kilian Foth | timeline score: 1 | |
| Mar 9, 2016 at 18:20 | comment | added | Matthew | I think it's fine to reduce duplication this way, however, in my opinion, reading the test alone should still give clear indication of what the test is doing. Also, most frameworks have a setup and teardown functionality in it, any reason why you cannot leverage those instead? | |
| Mar 9, 2016 at 18:19 | review | First posts | |||
| Mar 9, 2016 at 19:31 | |||||
| Mar 9, 2016 at 18:16 | history | asked | Attilio | CC BY-SA 3.0 |