This document describes the unit testing of the SCHEMESTATION addressing system. The purpose of the unit testing is to show that the data structures held by the addressing system remain consistent in all conditions, the addressing system is capable of saving and searching addresses, and that it remains stable in erraneous conditions. The requirements for the addressing system are specified in Addressing module specification.
A special test program will be set up to test the module inside out. It will perform all operations: adding, setting, deleting and searching entries, initializing and shutting down the system, saving and reading the system from the disk. Moreover, the addressing system module will be flooded with both erraneous requests and inreasonably large amounts of entry additions.
Each function will be separately tested considering the following aspects:
The addressing unit interface is tested as follows:
A separate testing program will be written that mainly does the testing. It consists of the following stages:
A vast number of random agent entries are added to the system using addr_addentry. The number has to be big enough to initiate hash table resizing. The consistence is verified using addr_dumpaddrsystem. The consistence of the system is ensured after the address table rehashing has occurred. In the stress test phase, the amount of address is raised to the limit - the purpose is to ensure that adding several tens of thousands of agents can be done.
Some random addresses (of each type - local, remote and special) are generated, and they are compared to each other. It is ensured using addr_dumpaddr, that if and only if the addresses/specifiers are identical, a true value is returned.
Entries are sought using addr_entrybyspec and addr_entrybyaddr. It is manually verified (using addr_dumpaddrsystem) that the results are consistent.
The system is saved to disk using addr_savetodisk (which calls addr_saveentry and mess_savemessage). The system is then deleted and reread from the disk using addr_readfromdisk (which calls addr_readentry and mess_readmessage). The consistence of the system before and after the disk operation is ensured using addr_dumpaddrsystem.
The added entries are deleted using addr_removentry, and it is ensured that no memory allocation bug occur, and no entries remain in the system.
The addressing system is shut down using addr_shutdownaddrsystem. It is ensured that all entries will be deleted and that no memory leaks occur (using Efence-malloc library).
The addressing system testing included a 1-3 call test for each function, and a stress test, whose purpose was to unveil the memory leaks and defects in performance. The plan for addressing system testing [SCHEMESTATION Addressing System Unit Testing Plan] was followed quite closely.
In stress test phase, we added and removed 50 000 addressing entries in the system twice.
The stress test along with the memory allocation library written espacially for finding memory leaks in SCHEMESTATION source, was enough to reveal few memory minor leaks in the system. One of these could have had some notable influence in the reals system after a long period of usage.
All test concerning the semantics of the functions were succesfully passed.
There was a more serious bug that was not found in the per module testing; fortunately it was found in intergration testing. The bug cause malfunction of the entire system under certain conditions. The bug has now been terminated by mr. Antti Huima.
subject | status | result | comments |
Do the functions implement the semantics defined in the spec? | done | passed | An uninitialized variable detected - this might have caused problems in some situations |
Do the functions survive calls with illegal arguments? | partly done | - | - |
Stress test - enormeous number of addressing entries | done | passed | A little memory leak found and fixed. Performance seems satisfactory |
name | status | result | comments |
addr_addresstoasc | done | success | |
addr_deliver_messages | done | success | |
addr_dumpentry | done | success | |
addr_entriesbyaddr | done | success | |
addr_entrybyspec | done | success | |
addr_freeentry | done | success | |
addr_hashvalue | done | success | |
addr_hexdump | done | success | |
addr_push_message | done | success | |
addr_readentry | done | success | |
addr_resizehash | done | success | |
addr_spechashvalue | done | success | |
addr_spectoasc | done | success | |
addr_writeentry | done | success |