News for hackers. Stuff that matters.
Re:Software Testing Anti-patterns by amelius on Sunday April 22, 2018 @06:35AM (#16895568)
In cases where manual testing is the only option, is it an anti-pattern to let the testing be done by the person who developed the code?

As a developer, I feel that others should test my code. Is that reasonable?

Re:Software Testing Anti-patterns by tempodox on Sunday April 22, 2018 @06:59AM (#16895620)
Manually testing your own code is liable to tunnel vision. So yes, having others do it is safer. There are even production standards that make this mandatory.
Re:Software Testing Anti-patterns by dankohn1 on Sunday April 22, 2018 @09:35AM (#16896096)
Why would manual testing be the only option?

As an example, we wanted to automate the test for browser-based OAuth connections to GitHub and authorizing an app there.

Here is the test that does so: https://github.com/coreinfrastructure/best-practices-badge/b...

Re:Software Testing Anti-patterns by kalecserk on Sunday April 22, 2018 @09:36AM (#16896099)
I have been working with teams that heavily use automated tests for over 16 years now and, at least on my experience, making others test your code would lead to untestable code and delegation of responsibility.

Even for manual tests, the test spec should make part of the change request and be reviewed appropriately.

Cheers!

Re:Software Testing Anti-patterns by mic47 on Sunday April 22, 2018 @06:57AM (#16895617)
Why should other test your code?
Re:Software Testing Anti-patterns by ben-schaaf on Sunday April 22, 2018 @07:07AM (#16895640)
Same reason you don't review your own code, or pair program by talking to yourself.
Re:Software Testing Anti-patterns by stinos on Sunday April 22, 2018 @07:19AM (#16895670)
This seems a bit of a false generalization to me. For a long time I've been the sole developer on multiple large-ish applications. So of course I review my own code, and I write my own tests. And yes as another commenter mentions: if you don't pay attention this can lead to tunnel vision, and yes it can be hard to be consistent about it.

I discovered those drawbacks fairly early, so quickly made it a habit to be super-strict and critical about pretty much every single line of code I write (both with regards to style, functionality, how it adheres to the standard practices etc).

What I also do consistently is review older code: if I have to add a function to existing code, it happens more often than not that I'll re-read and review the surrounding bits. Often to come up with better code. If time permits, else I take note and go back to it later.

In practice it turns out that if I haven't touched code for months, reviewing it is almost the same as reviewing someone else's code, i.e. starting with a clean slate. Which is also why I'll sometimes write something, commit it, but not yet merge it to production. Then a week or so later I'll come back and review every bit again.

Re:Software Testing Anti-patterns by ben-schaaf on Sunday April 22, 2018 @08:10AM (#16895830)
Oh, I completely agree, though I wouldn't call writing code carefully and methodically a "code review" if that makes sense.

I personally find that me a couple months down the track is pretty much another person anyway. In a sense you're not reviewing your own code, you're letting it be reviewed by future you. But if you're in a team with multiple developers, having someone else review your code would be more efficient.

Re:Software Testing Anti-patterns by _asummers on Sunday April 22, 2018 @09:46AM (#16896144)
I tend to review my code with a reviewer hat, not with the author hat, before I open the PR. Find all the places where I'd call myself out for lazy names, poor abstractions, missing docs, etc. then go in and fix those. Repeat until satisfied, then open PR.
Re:Software Testing Anti-patterns by rb808 on Sunday April 22, 2018 @04:59PM (#16898547)
> In practice it turns out that if I haven't touched code for months, reviewing it is almost the same as reviewing someone else's code,

I really like this idea, haven't heard it before but it makes complete sense, thank you.

Re:Software Testing Anti-patterns by koolba on Sunday April 22, 2018 @07:12AM (#16895649)
> ... or pair program by talking to yourself.

Who says I don’t?

https://en.m.wikipedia.org/wiki/Rubber_duck_debugging

Re:Software Testing Anti-patterns by icebraining on Sunday April 22, 2018 @09:12AM (#16896010)
It's not pair programming, though, even if can have some of its advantages.
Re:Software Testing Anti-patterns by mic47 on Sunday April 22, 2018 @07:13AM (#16895653)
You can solve this by test plan: You write into test plan what you have tested, and others in code review can suggest/require to test other things you missed.

In my previous job this worked quite well.

Re:Software Testing Anti-patterns by icebraining on Sunday April 22, 2018 @09:15AM (#16896022)
That's fair enough; I think when people are talking about manual testing, they're thinking about the decision of what should be tested, not the actual button pressing. But it's a distinction worth making.
Re:Software Testing Anti-patterns by rasjani on Sunday April 22, 2018 @08:58AM (#16895967)
Yellow rubber duck makes pair programming way more socially awkward ;)