Re:Near Future of Programming Languages [pdf]
by mpweiher on Monday October 30, 2017 @03:27AM
(#15583537)
> interleaving of tests with production code
> tests without cluttering the production code and excessive mocking
IMHO, tests should be an integral part of production code. In MPWTest[1], tests are typically expressed on the class side of the class under test, in a category called Testing, though it's easy to override that. This solves 2 of my major annoyances with xUnit-style testing: dual class/test hierarchies and (with static typing) the need to add public interface for the tests, which don't have privileged access.
Mocking in particular and stubbing should be eliminated as much as possible, but this is not a programming language issue[2], more a "not making architectural assumptions too early" issue.
> tests without cluttering the production code and excessive mocking
IMHO, tests should be an integral part of production code. In MPWTest[1], tests are typically expressed on the class side of the class under test, in a category called Testing, though it's easy to override that. This solves 2 of my major annoyances with xUnit-style testing: dual class/test hierarchies and (with static typing) the need to add public interface for the tests, which don't have privileged access.
Mocking in particular and stubbing should be eliminated as much as possible, but this is not a programming language issue[2], more a "not making architectural assumptions too early" issue.
[1] https://github.com/mpw/MPWTest
[2] http://blog.metaobject.com/2014/05/why-i-don-mock.html