Tuesday, April 19, 2011

Keeping Fish and the Wonders of an Ever-Changing Environment

It’s been an bit of an exciting time at the TESTHEAD homestead the past few weeks. One of my hobbies outside of software testing is that I like to raise freshwater aquarium fish and make an environment where the fish can spawn. My favorite species, bar none, is Archocentrus Nigrofasciatum (that’s to show everyone I have a true fish-geek pedigree, but I’m not going to refer to them as that for the rest of this post). Most people just call them “Convict Cichlids” or “convicts” due to their distinctive blue-white coloring with black bars that stripe their bodies like, well, prison garmets of the early 20th century (hence, Convict’s).


Why are these guys my favorite fish? In general, they are Cichlids in their attitude and behavior, but they are a dwarf species, meaning they top out at about 6 inches. This is important because a 70 gallon tank can only hold so many fishes, and the smaller the fish, the more can be housed comfortably. Even with their limit in size, they have all the classic hallmarks of Cichlids in that they have all the belligerence, jealous guarding of territory, and a dimorphism that makes it easy to tell the males from the females (females have a splattering of orange scales that at times become more or less prominent. If you see orange anywhere, you know it’s a female). Additionally, getting them to spawn is fairly easy (they don’t have a reputation as “the rabbits of the fish world” for nothing!).


It’s in this mad dash to spawn that something interesting has happened. I’ve gotten used to the fact that the fish will spawn, the babies will be around for a week or two, then they will magically disappear (OK, they don’t magically disappear, the other fish eat them as their parents stop paying attention to them). This most recent time, however, something happened… the mating pair in question picked a hollow spot between a bunch of rocks that they then proceeded to hollow out even further by removing all of the gravel in the hollow and around the rocks. This made for a pretty much impenetrable bunker where the fish could spawn and the babies could hide… for a time.


After about 6 weeks, the fry were free swimming and freely visible, and able to fend for themselves, somewhat. They could swim, eat and range about independently. What they couldn’t do was fend for themselves just yet (they are still about 3/8” in length). Therefore, the parents have been working overtime to protect their area, resulting in some less than thrilled tank residents. Ultimately, I decided that the crowding and the predation needed to be limited, so I decided to “thin the herd” and relocate many of the mature adults so as to make room for the babies.


Is there a comparison to software testing here? Yep, there sure is :).


We often deal with environments that spawn new entities, and we test the environment in a tried and true manner. When things are set up correctly, the environment behaves as it always has, and little details that are below the radar and too small to see oftentimes get righted without our ever knowing they were there (or even if we do, they are gone with the next release). Bugs and baby fish are similar, in that they need an environment that is primed right. For fish it’s the right water temperature, the right PH, and a pair of attentive parents fining a sheltered space to defend. For bugs, it’ usually similar, a good environment where they can hide and can grow without interference from the outside world (and from the prying eyes of testers).


As the fish grow, they are likely to take on pressures from outside. As the bugs grow, they are less likely to stay hidden as they gobble up more system resources or risk being seen. The fish will place pressure on the other inhabitants. The bugs will place pressure on the developers and testers. Similar to both, though, is that neither will grow in a hostile environment, they need to have an environment that will be conducive to their development.


While baby fish may be desirable in the grand scheme, they can’t really be allowed to reproduce ad infinatum. For one the tank will not be able to sustain the large numbers of fish and the ammonia produced by their waste will rise to toxic levels (even with daily water changes). Thus as a point, measures have to be taken to stop the spawning of babies, usually accomplished by segregating the males from the females (my son has what we jokingly refer to as “the Ladies tank” in his room. In times of extreme pressure, we relocate all of the females into this tank. In our software environments, it’s important to also keep a close eye on the conditions that can help bugs reproduce (our browsers, our utilities, our machine stats, programs we install, etc. It would be nice to have an equivalent of a male or female convict in our machines that we could separate out to prevent bugs from appearing, but alas, there is where this metaphor breaks down. We don’t have that option.


What we do have is the ability to know as much of our systems as possible, and to check regularly for behavior that seems out of the ordinary. Much like it takes attention and vigilance to not have a surprise spawn (and often the same vigilance if we actually want to have it happen). We can do much to keep bugs at bay on our systems, but we likewise need to be sure we have checked the rocks and hollows that would be the most conducive to their breeding and flourishing.


Now if you’ll excuse me, I have some fish food to grind up :).

No comments: