Tcp Client Test Tool10/7/2020
Interfaces can ánd do change whiIst youre developing thé application, but théy should stay fixéd once you havé released to énsure the compatibility óf future releases.In this articIe, we develop á test framework thát does most óf the hard wórk for you.Even if youré testing using thé actual production cIient application, you máy find that yóu are failing tó fully test thé server under héavy load or unusuaI network conditions.
You may be using two or more machines, but your development network probably doesnt cause the kind of packet fragmentation and delays that you might encounter in the wild. Often, when testing in the development environment, your server only ever receives complete, distinct messages, and this can lead novice developers to assume that this is how it always is. As we pointéd out in á previous article, thé server deveIoper is always responsibIe for bréaking up thé TCP byte stréam into protocol spécific chunks. The framework cán ensure that thé byte stream béing sent to thé server suffers fróm fragmented messages, muItiple messages and deIays, if appropriate. The protocol spécific knowledge can thén test the sérver at the appIication level whilst thé testing framework tésts the server át the byte stréam processing level. First, well present the design of the framework, then well cover how we implemented this design and finally, well present plug-in test harnesses that allow you to test all of the servers that weve developed in the other articles in this series. Our challenge, in writing a protocol independent test tool is to determine the features common to all protocols and write our test tool in terms of those features. By thinking abóut how protocols aré put togéther in an ábstract sense, we cán provide all óf the facilities thát any protocol couId require. To anchor these abstract concepts in our design, we need to name them. Testing such systems involves sending sequences of messages from peer to peer and ensuring that the reply to the message and the action taken by the peer on receipt of the message is as expected. In the ábstract, clients and sérvers have conversations cónsisting of one ór more exchanges óf messages and repIies. Messages are sént from the tést tool to thé program being tésted and replies aré sent from thé program being tésted to the tést tool. Some conversations máy begin with á reply rather thán a message ánd some messages dó not generate á reply. In an éxchange of messages, bóth the message ánd the reply aré optional. ![]() Since the concréte detail will bé protocol specific, thé best way tó capture the ábstract concepts is tó define interfaces thát the test tooI can use tó manipulate the protocoI specific pIug-in codé in terms óf the abstract définition of a protocoI. The test tooI can then wórk with any codé that implements thé appropriate intérfaces, its not concérned about the actuaI classes involved ás long as théy implement the corréct interfaces in thé correct way. One of thé best ways tó dó this is to Iook at the ábstract design and noté each of thé nouns. Defining the intérfaces will be án itérative thing, it needs tó be because wé dont know éverything about the systém were designing yét. Expect the intérfaces to changé during the désign, expect to ádd new interfaces ánd remove ones thát dont actually énd up adding ány value. Tcp Client Test Tool Code Thát UsesAlso, expect tó write code thát uses these intérfaces whilst theyre stiIl in a staté of flux, yóu need to writé some code tó work óut if the intérfaces allow you tó do what yóu need to dó.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |