1. Technical Field
The present disclosure relates to a testing device and a testing method for testing network function of a to-be-tested device.
2. Description of Related Art
Generally, when an external computer tests an electronic device for network functionality, the IP address of the electronic device in the local area network (LAN), formed by the external computer and the electronic device, is entered manually and the testing instruction is manually inputted a number of times, which is complicated and time consuming.
Therefore, there is room for improvement in the art.
Many aspects of the embodiments can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the embodiments. Moreover, in the drawings, like reference numerals designate corresponding parts throughout two views.
The disclosure is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at “least one.”
The testing device 10 includes an obtaining module 11, a first determining module 12, a testing module 13, a comparing module 15, an accumulating module 17, a second determining module 18, and a prompting module 19.
The obtaining module 11 obtains a count of feature information from the external device 30 at a predetermined time interval. In the embodiment, the feature information is a private internet protocol (IP) address ranging from 10.0.0.0 to 10.255.255.255 in binary number, and the time interval is adjustable.
The first determining module 12 determines whether the obtained count is more than a first predetermined value. When the obtained count is more than the first predetermined value, the to-be-tested device 20 accesses the LAN and the first determining module 12 extracts the feature information relating to the to-be-tested device 20 and generates a testing signal. In the embodiment, the first predetermined value is 2.
The testing module 13 generates a testing instruction for controlling the to-be-tested device 20 to execute the testing instruction in response to the testing signal, and receives feedback information from the to-be-tested device 20 after the to-be-tested device 20 executes the testing instruction. In the embodiment, the testing instruction is formatted in a predetermined internet control message protocol (ICMP) package; the testing instruction includes a “ping” character string and the IP address of the to-be-tested device 20, the feedback information includes a response time, response content, and a time to live (TTL).
The comparing module 15 compares the received feedback information with standard information. When the received feedback information matches the standard information, the comparing module 15 generates a control signal to indicate that a network function of the to-be-tested device 20 is successful one time. When the received feedback information does not match the standard information, the comparing module 15 generates a first prompting signal to indicate that the network function of the to-be-tested device 20 has failed.
The accumulating module 17 accumulates the number of success times and generates a first determining signal in response to the control signal. Each of the success times indicates that the network function of the to-be-tested device 20 is successful.
The second determining module 18 determines whether the number of the success times exceeds a second predetermined value in response to the first determining signal. When the number of the success times exceeds the second predetermined value, the second determining module 18 generates a second prompting signal. When the number of the success times does not exceed the second predetermined value, the second determining module 18 generates a testing signal. In the embodiment, the second predetermined value can be manually set.
The prompting module 19 outputs first prompting information for indicating that the network function of the to-be-tested device 20 is in a normal state in response to the first prompting signal, and outputs second prompting information for indicating that the network function of the to-be-tested device 20 is in an abnormal state in response to the second prompting signal. The prompting module 19 forms a visual interface 19 (as
In step S201, the obtaining module 11 obtains a count of feature information from the external device 30 at a predetermined time interval. In the embodiment, the feature information is a private internet protocol (IP) address ranging from 10.0.0.0 to 10.255.255.255 in binary number, and the time interval is adjustable.
In step S202, the first determining module 12 determines whether the obtained count is more than a predetermined value. If the obtained count is more than the predetermined value, a testing signal is generated for indicating that the to-be-tested device 20 accesses the LAN and the procedure goes to S203. If the obtained count is no more than the predetermined value, the procedure returns to S201.
In step S203, in response to the testing signal the testing module 13 generates a testing instruction for controlling the to-be-tested device 20 to execute the testing instruction. In the embodiment, the testing instruction is formatted in a predetermined internet control message protocol (ICMP) package; the testing instruction includes a “ping” character string and the IP address of the to-be-tested device 20.
In step S204, the testing module 13 further receives feedback information from the to-be-tested device 20 after the to-be-tested device 20 executes the testing instruction. In the embodiment, the feedback information includes a response time, response content, and a time to live (TTL).
In step S205, the comparing module 15 compares the received feedback information with standard information. If the feedback information matches the standard information, a first control signal is generated for indicating that the network function of the to-be-tested device 20 is successful one time and the procedure goes to S207. When the feedback information does not match the standard information, a first prompting signal is generated and the procedure goes to S206.
In step S206, in response to the first prompting signal the prompting module 19 outputs first prompting information for indicating that the network function of the to-be-tested device 20 has failed. In the embodiment, the first prompting information is a term “FAIL”. In the other embodiment, the first prompting information can be video signal, audio signal, or text information for example.
In step 207, in response to the first control signal the accumulating module 17 accumulates a number of success times and generates a determining signal.
In step S208, in response to the determining signal the second determining module 18 determines whether the number of the success times exceeds a second predetermined value. If the number of the success times exceeds the second predetermined value, a first prompting signal is generated and the procedure goes to S209; if the number of the success times does not exceed the second predetermined value, the testing signal is generated and the procedure goes to S203.
In step S209, in response to the second prompting signal the prompting module 16 outputs second prompting information for indicating that the network function of the to-be-tested device 20 is in a normal state. In the embodiment, the second prompting information is a term “PASS”. In the other embodiment, the second prompting information can be video signal, audio signal, or text information for example.
In use, the testing device 10 automatically generates testing instruction and tests the network function of the to-be-tested device 20 repeatedly. Therefore, the testing operation is improved.
It is to be understood, however, that even though information and advantages of the present embodiments have been set forth in the foregoing description, together with details of the structures and functions of the present embodiments, the disclosure is illustrative only; and changes may be made in detail, especially in the matters of shape, size, and arrangement of parts within the principles of the present embodiments to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
2013102094117 | May 2013 | CN | national |