Software Testing
REST Assured Tutorial: How to test API with Example
What is Rest Assured? Rest Assured enables you to test REST APIs using java libraries and...
Before we learn about protocol testing, let's understand:
When a computer communicates with each other, there is a common set of rules and conditions that each computer has to follow. In other words, protocols determine how data are transmitted between computing devices and over networks.
Protocol Testing is a method of checking communication protocols in the domains of Switching, Wireless, VoIP, Routing, etc. The primary goal of protocol testing is to check the structure of packets which are sent over a network using protocol testing tools. Routers and switches are used during the test to form parts of devices and products under testing.
Protocols are classified into two categories routed protocols and routing protocols
In simple terms, a router is like a bus used for transportation while routing protocols are signals on the road.
Based on the type of communication different protocols are used. Companies like CISCO, JUNIPER, ALCATEL produce networking devices like routers, modems, wireless access points, etc. that use different protocols for communication, for example, Cisco uses EIGRP, OSPF, etc. Protocol testing is nothing but checking whether EIGRP (Enhanced Interior Gateway Routing Protocol) or OSPF (Open Shortest Path First) or any other protocol is working as per respective standard.
| TCP/IP | It is used to send information in small packets over the Internet |
| UDP/ ICMP | It is used to send a small amount of information in data-packets over the internet |
| POP3 and SMTP | It is used for sending and receiving mail |
| Hypertext Transfer Protocol | It is used to transfer HTML page in encrypted form to provide security to sensitive data |
| FTP | It is used for transporting files over a network from one node to another |
* TCP/IP- Transmission Control Protocol/ Internet protocol, UDP / ICMP- User Datagram Protocol/Internet Control Message Protocol, POP3/SMTP- Post Office Protocol / Simple Mail Transfer Protocol, HTTP- Hyper Text Transfer Protocol, FTP- File Transfer Protocol
The OSI model has total of 7 layers of network communication, in which layer 2 and layer 3 are very crucial.
Protocol testing includes testing of functionality, performance, protocol stack, interoperability, etc. During protocol testing basically, three checks are done.
Protocol testing can be segregated into two categories. Stress and Reliability Tests and Functional Tests. Stress and Reliability tests cover Load Testing, Stress Testing, Performance Testing, etc. While Functional Testing includes negative testing, conformance testing, interoperability testing, etc.
Here is the sample test case for routers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Let's discuss the most important testing tools used to verify protocols
Scapy is a powerful interactive packet manipulation program. It enables you to
So basically, scapy mainly does two things: receiving answers and sending packets. You define the packets, it sends them, receives answers, matches requests with answers and returns a list of packet couples and a list of unmatched packets.
It can also handle other things as well like trace-routing, unit tests, attacks or network discovery, developing new protocols, probing, etc.
Scapy enables us to write a Python script that allows us to perform a task like sending and receiving packets or sniffing packets. For example, scapy can sniff the data packet by using a Python script. The command to open the getdit entered in the editor
#gedit scapysniff.py #!/usr/bin/env python from scapy.all import* a= sniff(count=10) a.nsummary() save, and change the mode of the file into an executable form #chmod+x scapysniff.py # ./scaotsbuff.py
It will sniff 10 packets and soon as it has sniffed 10 packets it will print the summary. Scapy also as an array of command for sending and receiving packets at the same time
Tools used for protocol testing- Wireshark. It allows to capture packets in real time and display them in human-readable form. It allows you to dig deep into the network traffic and inspect individual packets by using color coding and filters.
Wireshark captures packets that helps to determine when the session is getting established, when the exact data travel was initiated and how much data is sent each time, etc.
Wireshark has a set of rich features which includes
TCCN is a standard testing language for defining Test Scenario and their implementation for protocol testing. A TCCN test suite contains many test cases written in the TTCN programming language and it is used for testing reactive systems or behavioral testing.
For example, a coffee vending machine that gives you coffee on inserting a dollar coin but does not respond if anything less than a dollar is inserted into it. To program such machines TCCN3 language is used. In order to make the coffee machine responds when inserting a coin, we have to write TCCN-3 component that behaves as a coffee machine. It allows us to run our test before an actual coffee machine is available as a product. Once it is done we will connect the TCCN3 test suite with the external device.
The test system emits stimuli (dollar coin) and receives responses (coffee). The stimuli adapter obtains stimuli from the test system and passes them to the system under test. The response adapter waits for responses of the system under test and passes them to the test system.
TCCN3 can be used in various fields like
In TCCN we can define
TCCN can be integrated with types of systems of other languages like ASN.1, XML, C/C++. TCCN3 core language exists in text format apart from other formats like tabular, graphical and presentation.
What is Rest Assured? Rest Assured enables you to test REST APIs using java libraries and...
Training Summary SoapUI is the market leader in API Testing Tool. You can do functional, load,...
What is Test Case Template? A Test Case Template is a well-designed document for developing and...
Retesting Retesting is a process to check specific test cases that are found with bug/s in the...
To cope up with rapidly changing IT market, and its growing demands and expectations,...
What is Incremental Model? Incremental Model is a process of software development where...