afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
[personal profile] afuna
When I first did renames, I didn't have the concept of a rename token object -- I had the shop item, and then I was doing a bunch of stuff directly in DW::Rename. At some point, I rethought, and encapsulated some of that logic into a new class DW::RenameToken, and I had to do a lot of tweaks to what I had already done to accommodate it.

I'm so *absolutely grateful* that [personal profile] szabgab did such a job towards making existing tests usable, because that put tests in mind when I first started doing the renames module, and I felt obliged to take the time to wrote a few simple tests.

Now the tests are failing, and in all the ways that point out to me where my old assumptions no longer bear weight under the new/tweaked code. They have paid for themselves many times over.

Now how do we convince others to write more of these things? :-)

Date: 2010-02-07 06:17 pm (UTC)
azurelunatic: Vivid pink Alaskan wild rose. (Default)
From: [personal profile] azurelunatic
Congratulations on your latest round of safe failure!

Date: 2010-02-07 07:34 pm (UTC)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
From: [personal profile] pauamma
Now how do we convince others to write more of these things?
Good question. Offhand, what fraction of the bugs in committed and pushed code (which are for obvious reasons the ones we most want to avoid) do you think would have been spotted by appropriate tests?

Date: 2010-02-09 05:22 pm (UTC)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
From: [personal profile] pauamma
Hmm, yes. Good point. (And no, it doesn't, but I suspect the answer is along the lines of "not a lot, and the effort involved in writing an automated test to check for these bugs and prevent a regression would be out of proportion with the gain.")

Date: 2010-02-07 08:13 pm (UTC)
synecdochic: torso of a man wearing jeans, hands bound with belt (Default)
From: [personal profile] synecdochic
Now how do we convince others to write more of these things? :-)

Write out a detailed explanation of what tests are, how to write them, and why we should write them, suitable for a four-year-old child, so that new programmers who are Very Slow, aka me, know what the hell to do? :)

Date: 2010-02-07 09:05 pm (UTC)
foxfirefey: Fox stealing an egg. (mischief)
From: [personal profile] foxfirefey
This! And also post to [site community profile] dw_dev, so that more developers can go oooo.

Date: 2010-02-09 05:36 pm (UTC)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
From: [personal profile] pauamma
Hmm. One thing you can do is keep a log of the errors you fixed when you were testing your patch (and the state of your patch that had the error). Then, sit down with someone and go over that log to try to extract tests from the bug descriptions. It's usually not something you can do alone until you gain some experience, and have insight into where your blind spots are so you can write tests to probe them. That said, it's definitely something that (IMO) is worth discussing, so a dw_dev entry like foxfirefey suggested is probably a good idea.

Date: 2010-02-07 08:47 pm (UTC)
From: [identity profile] miome.livejournal.com
Reminds me of one of my favorite sayings, "if it's not tested, it's broken".