Updated: 9/4/2024
Signed in as:
filler@godaddy.com
Updated: 9/4/2024
Signed in as:
filler@godaddy.com
The goal of animalFarm_02 is to show how a test platform can operate, both visually and behaviorally. It does this without interfacing with any external “system under test”; animalFarm_02 is completely self-contained.
Let’s start by introducing the schema: we have gFarm(s) situated in gCounty(s); the farms house gAnimal(s); in this case "cows" and "chickens". When the program starts it generates an initial set of counties, farms and animals.
After starting up one of two screen displays are presented: initially a "fs" (farm summary) display shows the counties, farms, animals and product: milk and eggs. Or an "ad" (animal detail) display shows the individual animals by type (cow - c) or (chicken - x).
Note that once started the program is processing command input from the terminal: if you enter "ad" and <Enter> the animal detail display will show. If you enter "fs" and <Enter> the farm summary display will show. A basic menu is displayed all the time on the screen. Command input is "saved up" until an <Enter> is typed.
At any point in time an animal can have one of two operations performed on it "in the background": the animal can be “tended to,” or it can be “raised.”
“Tending to” (tc / tx) an animal causes it to produce according to the type of animal that it is: cows produce milk; chickens produce eggs. That’s what happens when you tend to an animal.
“Raising” an animal (rc / rx) on the other hand causes another animal of the same type to be created (which happens most of the time), or occasionally the selected animal is sent to market and eliminated from the farm. That’s what happens when you raise an animal.
You control the type and number of background processes are running at the same time. The end background command ("eb") stops them all. The program keeps track of the animals and their output, all on multiple farms in multiple counties.
Note that many background processes will be running at the same time. The function "allocateAnAnimal" locates a "free" animal and places a row lock on it before "tending" or "raising" it.
The program runs in either interactive or batch mode. If started with no command-line parameters it runs interactively; note that if run in interactive mode it can still “make a test run” of any length.
If started with command line parameters (identical to the interactive command set), the platform can be used in a CI / CD pipeline performing tests run of some specified length and with some specified set of animal tending/raising operations.
When making a test run with the start test ("st") command the operator specifies the length of the test run and the length of each cycle in that test run. The test platform then runs in cycles, counting how many animals it either creates or eliminates and how much milk or eggs are produced. At the end of the cycle it performs a verification check that (always) succeeds (this is not a real system with bugs in it). In order to occasionally fail a verification, the user can “inject” an additional animal or animal product (milk or eggs) that then causes the verification to fail.
Note that as animals are eliminated during a cycle they are not erased from the gDS data store. Instead they are marked as “Erased” under a system lock and then they are deleted at the end of the cycle, after the milk or eggs they have produced has been processed.
Copyright © 2024 Testing Complex Systems - All Rights Reserved.
Powered by GoDaddy