boggler's Shortform Feed

post by boggler · 2018-03-18T22:29:18.173Z · LW · GW · 6 comments

For thoughts that fail to qualify to blog-post status. Thank you for the inspiration Hazard and zlrth.


Comments sorted by top scores.

comment by boggler · 2018-03-18T22:27:34.414Z · LW(p) · GW(p)

Noting: I feel trepidation towards testing my code. I believe this is because I suspect that my code has bugs and bugs are equated to debugging (i.e. work). Yet, once I get over my trepidation and test my code with all the supplied test cases, I become giddy and want to test everything. I believe this is because I feel that my code is free of bugs and every test is then a testament to what I've created. Has anyone else experienced something similar?

Replies from: Hazard, habryka4, PeterBorah
comment by Hazard · 2018-03-18T22:57:50.768Z · LW(p) · GW(p)

Though I don't often get super excited about testing, I have noticed that the number of false positives (I anticipate it being difficult, but it's not that hard) is higher than I want it to be.

comment by habryka (habryka4) · 2018-03-18T23:24:25.611Z · LW(p) · GW(p)

Yep, I love testing when I've just done it a bunch, and hate testing when I haven't done it recently. I think a large part is just that testing actually requires a very different thinking style than coding, and I hate context-switches.

comment by PeterBorah · 2018-03-19T00:02:39.465Z · LW(p) · GW(p)

Hmm, maybe this is part of the motivation for test-first programming? Since I was originally trained to do test-first, I don't have this problem, because there are always already tests before I write any code. And I pretty much always know my code works, because it wouldn't be done if the tests weren't passing yet.

Replies from: boggler
comment by boggler · 2018-03-19T01:56:05.080Z · LW(p) · GW(p)

Although, I haven't explicitly done test-first programming, it appears as though it could be a great way to remove the trepidation. I do, however, often work on problem sets for school which come with pre-written tests, and I find myself mildly anxious before I run those tests on my code. Perhaps, the problem here is that I have internalized that code is "done" when the last line is written, as opposed to the test-first paradigm where "done" necessitates passing all the tests.

How do you feel in that space between completing your last line of code and running your first test?

Replies from: PeterBorah
comment by PeterBorah · 2018-12-17T20:34:12.124Z · LW(p) · GW(p)

This reply is extremely late, but I'm annoyed at myself for not having responded at the time, so I'll do it now in case anyone runs across this at some point in the future:

I guess I feel a little trepidation or edge-of-my-seat feeling when I first run a test (I have surprisingly often ended up crossing my fingers), but I try to write tests in a nice modular way, so that I'm never writing more than ~5-10 lines of code before I can test again. I feel a lot more trepidation when I break this pattern, and have a big chunk of new code that hasn't been tested at all yet.