3 ms·
Depending on the capabilities of a debugger, developers might have test failures drop them into an interactive debugger that allows reloads/re-execution of code
by jlg23 8y ago
Depending on the capabilities of a debugger, developers might have test failures drop them into an interactive debugger that allows reloads/re-execution of code units.
Debuggers can be I instrumented to do a lot of dev-only logging for you.
I do write tests and assertions, but if those fail, I am dropped into a debugger (if prog is executed interactively), I can immediately inspect the state of my program and more often than not fix the problem on the fly.
- mirceal 8y agoI think that, while this might work, the approach to managing state and writing the tests is not ideal. For one, your tests should be fast (ie you should be able to rerun them with almost 0 time penalty and see the results instantly). Second, if it’s easier to stop the flow and look at the state / modify the state than looking at what the state should be via the test setup it’s possible that the abstractions you’re using are not quite right and/or the code is tightly coupled.
- jlg23 8y ago> I think that, while this might work, the approach to managing state and writing the tests is not ideal. I strive to not manage state but to write purely functional code, it makes life so much easier - see your second point as an example :)