kriegaex commented on PR #133: URL: https://github.com/apache/xalan-java/pull/133#issuecomment-1835253535
> I would rather extract the "version parsing method" I forgot to answer to that. The version parsing method already is separate, and there is a separate test for it, which does not need mocks. I.e., I already did what you suggested before you even asked for it. The only place I am using a partial mock is to stub out the one-line method `Version::getPropertiesStream` which uses `Class::getResourceAsStream` to read the properties file. In the process of writing the tests, I factored that line out into a separate method, because I only wanted to stub out the I/O operation, not a whole method doing other things. This is the beauty of test automation: It is a design tool first and foremost, things like protection from regressions and code coverage are only secondary benefits to me, even though important. TDD drives better design, and good design also implies good testability. The testability of this ugly class with static methods is as good as it can be, given the circumstances (backward compatibility). I do not like static tool classes at all, but I did not invent `Version`, merely port it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org For additional commands, e-mail: dev-h...@xalan.apache.org