heterosexuality.Test()

A friend recently mentioned events that caused people to “question the security and reliability of their heterosexuality.” This got me thinking: Good maintenance should prevent this from ever happening. If you ever end up questioning the reliability of your heterosexuality, this is a clear sign of inadequate unit testing.


First of all, we need to work out an API for sexual orientation. Orientation is really part of the broader partner selection system, which should expose something on the lines of

  class PartnerSelector {
    ....
    void AddInteraction(const Person &other, const Interaction &data);
    bool Schtupp(const Person &other);
  };

or something like that. Internally, Schtupp() should be computing some sort of score and comparing it against a threshold; this could be done using schmancy machine-learning techniques, but I suspect that the best approach is simply an old-fashioned scoring function, where various things give and remove points. A sexual orientation would then be implemented as a module which cuts scores down to zero (or at least, something small) when genders are incompatible. It would be part of the interaction-independent (i.e., only person-based) part of the score.

For maximum flexibility, it should be possible to switch the various scoring components on and off with mutators to the PartnerSelector. This can then be used for a detailed regression test.

So now, how does one test one’s sexuality? If the scoring function isn’t completely modular (which it probably couldn’t be, given the complexity of the interaction of the various components) a unittest is more or less out of the question, and a regression test is needed. The general protocol would be to set the PartnerSelector to various modes (heterosexual, drunk, sleep-deprived, etc.), run a known set of interactions through it, and evaluate what it actually ends up doing. Tests obviously shouldn’t be run in production mode, so a simulator is needed: elaborate fantasies, virtual girlfriends, IRC, and so forth. (Except for commissioning testing: see below)

A good test suite should try all of the basic modes, at least some of the combinations, and the modes that are going to be running in production. The test cases should be fairly straightforward, and for best results should be kept simple. For example, a good test for one’s hetero/homosexuality is to set just that to being active, then run various interactions with a member of the inappropriate sex. Since the expected result is simple, the interactions should be as complicated as possible so as to beat on the system; for example, dinner, complex conversations about science or philosophy, making out, being shot at, going for a long drive, and lighting a bonfire. (The combination is meant to be varied as well as increasing the stress on the system)

And so on; the design of the full test suite is a straightforward exercise, and this regtest should be run at least every few days, to make certain that other changes in the system haven’t suddenly broken one’s sexual orientation. (You might switch the one you’re running in production, but that had better be an intentional switch, and probably in its own changelist. But if getting a neat new hat causes your sexual preference to change, there is something seriously wrong going on here. Or it’s a really good hat.)

The last thing needed is full-scale commissioning testing, which a major system like this needs before it comes on-line. This means bringing up a full production system in a sandbox environment, where failures are anticipated and expected, and banging on it as thoroughly as possible. (Most people call this “college.”) This requires, for example, heavy load tests (“Full moon on the quad” is part of Stanford’s famous test suite), tests under impaired conditions (system performance should be very close to baseline no matter how much alcohol is imbibed, up to the point where other systems like unconsciousness kick in. If your tastes shift too much when you’re drunk, this is a sign to start debugging quickly) and destruction testing. (Start with the system running normally and under heavy load. Then suddenly disconnect the SO, move to a different town and change majors. Does your orientation change? Again, if so it’s time to examine the matter further) For best results, these tests should be repeated every few years or so, to make sure that performance hasn’t degraded in a way that (by random chance) production hasn’t triggered lately.

Properly followed, these instructions should keep one’s {hetero,homo}sexuality safe and sound for years to come.

Advertisements
Published in: on February 25, 2005 at 00:57  Comments (38)  
Tags: ,

38 Comments

  1. You are a very odd man. =^)

  2. You are a very odd man. =^)

  3. $$$$~!
    Brilliant! We can have the units out by Christmas, get started at once!

  4. $$$$~!
    Brilliant! We can have the units out by Christmas, get started at once!

  5. Problem is that the OS rides on a neural network, which has a tendency to reflect whatever it learns from the environment. Therefore, if sexuality, which is hardwired into the system, conflicts with the environment, then the neural net will generally align responses and behaviour in accordance to favourable response or results from the environment. Conflicts in the neural programming and the hardwired imperatives will create internal operating stress. Internal pressure and stresses caused by the overall system performing outside of design parameters (i.e. against the hardwired imperatives) eventually causes either a self-correction of the neural net (the scenario where the neural network aligns itself to the hardwired programming), or will embrace the more extreme elements of the programmed soft data and neural programming in an attempt to overcome the hardwired programming.
    So, through neural netowrk self-correction due to stresses caused by system operation beyond design specification, the neural net eventually either aligns itself to its hardwired imperatives or overcompensates in an attempt to overcome the hardwired imperatives.

  6. Problem is that the OS rides on a neural network, which has a tendency to reflect whatever it learns from the environment. Therefore, if sexuality, which is hardwired into the system, conflicts with the environment, then the neural net will generally align responses and behaviour in accordance to favourable response or results from the environment. Conflicts in the neural programming and the hardwired imperatives will create internal operating stress. Internal pressure and stresses caused by the overall system performing outside of design parameters (i.e. against the hardwired imperatives) eventually causes either a self-correction of the neural net (the scenario where the neural network aligns itself to the hardwired programming), or will embrace the more extreme elements of the programmed soft data and neural programming in an attempt to overcome the hardwired programming.
    So, through neural netowrk self-correction due to stresses caused by system operation beyond design specification, the neural net eventually either aligns itself to its hardwired imperatives or overcompensates in an attempt to overcome the hardwired imperatives.

  7. *snicker*
    You really need to post more often, Dear. There is something utterly unique about reading a discussion of programming as used for maintaining sexuality.
    I’ll need to read this again when I’m more awake.

  8. *snicker*
    You really need to post more often, Dear. There is something utterly unique about reading a discussion of programming as used for maintaining sexuality.
    I’ll need to read this again when I’m more awake.

  9. *heh* I’ve missed talking about this sort of thing with you. You should post your theory on geek dating as compared to grad students getting free food. I found that very enlightening.

  10. *heh* I’ve missed talking about this sort of thing with you. You should post your theory on geek dating as compared to grad students getting free food. I found that very enlightening.

  11. OMFGWow, hilarious beyond rational comprehension at this hour of morning on a Friday. I think I’m going to have to share this with my Queer Ethics prof, or try to work it into my term paper.
    And you’ve done a lovely job illustrating the very precarious nature of strict sexual identity, that is, if I’m grokking my Foucault and Dollimore readings properly.

  12. OMFGWow, hilarious beyond rational comprehension at this hour of morning on a Friday. I think I’m going to have to share this with my Queer Ethics prof, or try to work it into my term paper.
    And you’ve done a lovely job illustrating the very precarious nature of strict sexual identity, that is, if I’m grokking my Foucault and Dollimore readings properly.

  13. Well, that’s the point of stress-testing; a robust sexual orientation should keep working even under ridiculous levels of stress. That’s not to say that the production orientation shouldn’t change, just that it shouldn’t change unexpectedly.

  14. Well, that’s the point of stress-testing; a robust sexual orientation should keep working even under ridiculous levels of stress. That’s not to say that the production orientation shouldn’t change, just that it shouldn’t change unexpectedly.

  15. You are, of course, the resident expert on the subject of unit testing; any recommendations for how to lay out the test suite?

  16. You are, of course, the resident expert on the subject of unit testing; any recommendations for how to lay out the test suite?

  17. Well, you would need a few couples who are very far one way or the other and add in 2 or 3 of the mitigating factors one at a time. Unit tests are designed to make sure the most basic functionality works – IE: Does it turn on… or in this case, does it turn person X on?
    You would have to set up control groups of “clean” machines (people) for the unit tests and set them up in pairs. More than that is more complicated and more than what unit tests are for.
    Unit group A: So, (1)hetero pair in person, no stimulus. (2)Gay pair in person, no stimulus. (3)One hetero, one gay (same gender) in person, no stimulus. (4)One hetero, one gay (opposite gender) in person, no stimulus.
    Unit group B: Then… hmmm. Not to get too complicated.
    Add alcohol to (1) and (4) until legally drunk.
    Add sleep dep to (2) and (3) – make it 24 hours no sleep.
    Repeat Unit groups A and B in a virtual (online) setting.
    That should be enough for the basic unit testing of your program.

  18. Well, you would need a few couples who are very far one way or the other and add in 2 or 3 of the mitigating factors one at a time. Unit tests are designed to make sure the most basic functionality works – IE: Does it turn on… or in this case, does it turn person X on?
    You would have to set up control groups of “clean” machines (people) for the unit tests and set them up in pairs. More than that is more complicated and more than what unit tests are for.
    Unit group A: So, (1)hetero pair in person, no stimulus. (2)Gay pair in person, no stimulus. (3)One hetero, one gay (same gender) in person, no stimulus. (4)One hetero, one gay (opposite gender) in person, no stimulus.
    Unit group B: Then… hmmm. Not to get too complicated.
    Add alcohol to (1) and (4) until legally drunk.
    Add sleep dep to (2) and (3) – make it 24 hours no sleep.
    Repeat Unit groups A and B in a virtual (online) setting.
    That should be enough for the basic unit testing of your program.

  19. True, sexual orientation, since it’s hardwired, should keep operating. However, the neural net may have been influenced and programmed counter to the hardwired imperatives. In order to accurately test a system, you must test the hardware, software, AND the data set. Internal configurations are just as important as the external test environment. Therefore, you have to either ensure that the neural nets are not biased in a particular direction due to environmental exposure, or test the various cases of neural net programming as well as the hardwired imperatives.

  20. True, sexual orientation, since it’s hardwired, should keep operating. However, the neural net may have been influenced and programmed counter to the hardwired imperatives. In order to accurately test a system, you must test the hardware, software, AND the data set. Internal configurations are just as important as the external test environment. Therefore, you have to either ensure that the neural nets are not biased in a particular direction due to environmental exposure, or test the various cases of neural net programming as well as the hardwired imperatives.

  21. True. It’s damned hard to test the hardware platform in isolation, though, since you’d need to run commissioning tests on it before the whole software system came up, or somehow suppress brain function. (Maybe there are good drugs for that?)
    Or there’s the cheat way, which is to say that the software/hardware system is so tightly bound that it doesn’t make much sense to test the components individually, and one should just treat them as a unit. It’s a bit less satisfying that way, though.

  22. True. It’s damned hard to test the hardware platform in isolation, though, since you’d need to run commissioning tests on it before the whole software system came up, or somehow suppress brain function. (Maybe there are good drugs for that?)
    Or there’s the cheat way, which is to say that the software/hardware system is so tightly bound that it doesn’t make much sense to test the components individually, and one should just treat them as a unit. It’s a bit less satisfying that way, though.

  23. Am I the only one thinking that this would be a good interview question for a test engineer? 🙂

  24. Am I the only one thinking that this would be a good interview question for a test engineer? 🙂

  25. *laugh* It sure would be amusing to see the look on the interviewee’s face when asked about it.

  26. *laugh* It sure would be amusing to see the look on the interviewee’s face when asked about it.

  27. maybe… but the “don’t call us, we’ll call you” at the end might have an all-too-familiar ring. 😉

  28. maybe… but the “don’t call us, we’ll call you” at the end might have an all-too-familiar ring. 😉

  29. I want that hat.
    “Here dear, I got this new hat for you. Oh and this is my friend Jenny….”

  30. I want that hat.
    “Here dear, I got this new hat for you. Oh and this is my friend Jenny….”

  31. Everyone needs a hat that good.
    http://www.studiofoglio.com/girlgenius/jagershots/jagershot.004.html

  32. Everyone needs a hat that good.
    http://www.studiofoglio.com/girlgenius/jagershots/jagershot.004.html

  33. ICON LOVE!

  34. ICON LOVE!

  35. MY EYE!!!

  36. MY EYE!!!

  37. Oh my God, someone made an icon out of that. I can’t stop laughing! Darn you! Darn you like a sock! My kidneys will ache for hours. . . .

  38. Oh my God, someone made an icon out of that. I can’t stop laughing! Darn you! Darn you like a sock! My kidneys will ache for hours. . . .


Comments are closed.

%d bloggers like this: