4 ms·
why write unit tests when we don't understand the microcode in the CPU? We can't have "tested" it because we don't understand said microcode. Or wait... no, m
by mreiland 12y ago
why write unit tests when we don't understand the microcode in the CPU? We can't have "tested" it because we don't understand said microcode.
Or wait... no, maybe your characterization is wrong.
Yeah... that's probably it.
- ackalker 12y agoThat's why they're called unit tests. They are supposed to test precisely one unit of functionality, while assuming everything else works as specified (using mocks if necessary). Taking into account the effects of microcode execution on the test result is in fact a kind of integration testing.
- SilasX 12y agoI think the GP's point was that you can't mock out the computer chip's opcodes.
- rbanffy 12y agoWhere exactly did I say you should understand the code down to how electrons flow through the chip's gates? I said if you do not understand what you are testing (not the compiler, not the runtime libraries, not the OS, not the instruction decode, not the microcode, not the gates), you can't say you actually tested it. You merely observed what could be a side-effect.
- mreiland 12y agoyou're drawing an arbitrary line, that was the point. We specialize and abstract for a reason. No one understands everything about everything surrounded their code, and that includes other software. Don't tell me you've personally been through the code of every single project your projects touch. You haven't and that makes you a hypocrite.
- rbanffy 12y agoA line that encompasses the object you are testing but that you don't fully understand (or that is hidden from you) and nothing more is not arbitrary. The best you can do in these circumstances is say it adheres to a spec for the cases you tested (which could, for all you know, be the only ones that yield correct results).
- mreiland 12y agoIt's an arbitrary line. Too many people come up with an opinion and then cast about for a way to make it seem valid.
- rbanffy 12y agoThis is, BTW, just what you did by claiming the line is arbitrary.
- mreiland 12y agoyes and I'm racist when I point out someone is being racist. I'm also a troll when I point out someone is trolling. do you know how I turn female? By pointing out that someone is female. It's amazing how making an observation suddenly means you've become the thing you're observing. Or not, but who am I to judge, amirite?