News for hackers. Stuff that matters.
Re:Why I don't mock by nope_42 on Wednesday May 28, 2014 @09:01AM (#7809658)
I had a random idea the other day to create a program that monitors/logs system level calls and lets you replay them for a program. This would effectively let you use your program as normal, log any actual pieces that use external resources, and then automatically use the saved results as part of your test framework by overriding those system calls at the appropriate time.

Is anyone aware of a solution like this? I certainly don't have time to create it but I would definitely find it useful.

Re:Why I don't mock by AlexanderDhoore on Wednesday May 28, 2014 @09:21AM (#7809733)
We have something like this at the company I work for. We have a "simulation layer" which wraps ALL third party code. This lets us simulate the failure of file system calls, network drivers... And we use it to write our tests.
Re:Why I don't mock by phaedrus on Wednesday May 28, 2014 @09:56AM (#7809887)
I did this for a gdb wrapper I wrote. It logs all the stdin/stdout between itself and gdb and between itself and the user. You can then take that log file and replay it to simulate both the user input and the gdb output.
Re:Why I don't mock by lucaspiller on Wednesday May 28, 2014 @09:28AM (#7809758)
Although not quite the same, VCR for Ruby does this for network requests.
Re:Why I don't mock by ap22213 on Wednesday May 28, 2014 @09:21AM (#7809732)
IIRC, SoapUI does something similar.