Content deleted Content added
→Alternative implementation: easy to convert ? |
→Alternative implementation: comment |
||
Line 19:
I created an alternative test module in hu.wikipedia and would welcome any comments or feature requests. The module is at [[:hu:Modul:Homokozó/Tgr/ScribuntoUnit]], a usage example is at [[:hu:Modul:Homokozó/Tgr/Set/tests]] (the documentation is in Hungarian, but comments and variable names are in English, and the code follows xUnit conventions, so understanding it shouldn't be a problem). It throws exceptions from failed assertions, builds a result table based on which tests throw exception/error, and can then present the results in any way; I believe the separation of actual testing and display code makes it more maintainable and reusable. --[[User:Tgr|Tgr]] ([[User talk:Tgr|talk]]) 15:17, 25 May 2013 (UTC)
:{{replyto|Tgr}} didn't have time to fully read it, would it be much work on the test cases to convert them to your new module ? —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 20:53, 4 June 2013 (UTC)
: I created [[Module:UnitTests/sandbox]] which right now only mixes logic and presentation in three places. I created [[Module talk:Citation/CS1/testcases2]] to make sure it still works and for comparison purposes. testcases2 uses 6.91 MB of memory and takes 3.964 seconds to process tests compared to testcases which uses 7.23 MB of memory and takes 4.933 seconds to process tests. Maybe with full separation of the logic and presentation the memory footprint and processing time can be decreased further. I think another approach to unit testing would be better, but that will require rewriting current tests, which like in the case of the citation module, could take a bit of effort to do. --<span style="font: bold 10pt 'courier new', comic, sans, ms;">[[User:Darklama|<font color="midnightblue">dark</font>]][[User_talk:Darklama|<font color="green">lama</font>]]</span> 15:11, 5 June 2013 (UTC)
|