CN105117342A - Test method based on object-oriented switchboard software test cases - Google Patents

Test method based on object-oriented switchboard software test cases Download PDF

Info

Publication number
CN105117342A
CN105117342A CN201510589961.5A CN201510589961A CN105117342A CN 105117342 A CN105117342 A CN 105117342A CN 201510589961 A CN201510589961 A CN 201510589961A CN 105117342 A CN105117342 A CN 105117342A
Authority
CN
China
Prior art keywords
module
test
function
testing
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510589961.5A
Other languages
Chinese (zh)
Inventor
谷颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510589961.5A priority Critical patent/CN105117342A/en
Publication of CN105117342A publication Critical patent/CN105117342A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a test method based on object-oriented switchboard software test cases. The method includes the steps that classification is performed according to the system properties of program packaging modules, and the test cases suitable for different test methods are designed according to classification results; tests are conducted according to one or more of the test cases, and test results are obtained. In the method, classification is performed based on the system properties of the program packaging modules, and the software test cases are designed based on the classification results according to different types, so that the test cases have higher applicability, the security and high efficiency of the software tests are enhanced, and working efficiency is improved.

Description

A kind of method of testing based on OO switch software test case
Technical field
The present invention relates to communication technique field, particularly relate to a kind of method of testing based on OO switch software test case.
Background technology
In switch software performance history, switch software tests the link that is absolutely necessary.Switch software test is used for reality to export to carry out auditing and comparing with expection output, thus guarantees quality and the efficiency of developed software.
As a rule, switch software Test Engineer operates program under defined terms, for the specific input of input domain, observe the execution result of software, verify that whether this result is consistent with expected result, then do corresponding error correction and adjustment according to result, with discovery procedure mistake, weigh software quality, and whether can meet design requirement to it and assess.In test process, the selection of test case determines the validity of test, is key and the difficult point of software test.
At present, the development of switch software measuring technology is not also very ripe, and tester carries out according to intuition and experience usually when selecting test case, brings very large blindness, finally cause software later maintenance costly to test.Consider above-mentioned factor, be necessary to provide a kind of efficient and the software test of safety is machine-processed.
Summary of the invention
The technical problem to be solved in the present invention is, provides a kind of efficient and the switch software testing mechanism of safety, i.e. a kind of method of testing based on OO switch software test case.
According to some aspect of the present invention, the invention provides a kind of method of testing based on OO switch software test case, comprise: the property of system according to program package module is classified, design the test case being adapted to different method of testing according to classification results respectively; Test respectively according to one or more of described test case, obtain test result.Wherein, design according to classification results the test case being adapted to different method of testing respectively can comprise further: according to test request, select random test, partition testing and based on the three kinds of modes of one or more in the test of fault, and for different method of testings, different classification can be carried out to operation to be tested respectively, and and then obtain corresponding test case.
Compared with prior art, the invention provides a kind of method of testing based on OO switch software test case, the property of system based on program package module is classified, and according to different types, based on class, software test case is designed, thus make test case have applicability widely, enhance the safety and efficiently of software test, improve work efficiency.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of a kind of embodiment of a kind of method of testing based on OO switch software test case of the present invention.
Fig. 2 is the schematic flow sheet of a kind of embodiment in step S100 shown in Fig. 1.
Fig. 3 to Fig. 4 is the test case schematic diagram of the method for testing specific embodiment that the present invention is based on OO switch software test case.
Embodiment
Below with reference to accompanying drawing, example embodiment is described more comprehensively.Reference numeral identical in accompanying drawing will be used to refer to same or analogous parts.Although the following describe some exemplary embodiments of the present invention and feature, but when not deviating from invention thinking of the present invention, the amendment that the present invention is carried out, adjustment and other replace and realize, such as, equivalent replacement is carried out to parts shown in accompanying drawing, adds or amendment, or by replacing, resequence or adding step, should not limitation of the present invention be caused.Proper range of the present invention should be defined by claims.
According to some embodiment, the present invention proposes a kind of software test mechanism, a kind of method of testing based on OO switch software test case, inventor classifies to operation to be tested based on the property of system of operation, and according to different types, based on class, software test case is designed, thus make test case have applicability widely, and software test is safer and have more high-quality.
With reference to figure 1, there is shown the schematic process flow diagram of a kind of embodiment of method of testing of the present invention, comprising:
Step S100, the property of system according to program package module is classified, and designs the test case being adapted to different method of testing according to classification results respectively;
Step S200, tests respectively according to one or more of the test case of step S100, obtains test result.
Specifically, with reference to figure 2, step S100 comprises further: step S110, according to test request, selects different method of testings.In one embodiment, random test can be comprised, partition testing and the test three kinds of modes based on fault.For different method of testings, different classification can be carried out to operation to be tested respectively, and and then obtain corresponding test case.
Such as, for random test, be produce a series of different sequence of operation at random from one group of sequence, form minimum can cycle tests.According to the property of system of operation, the position of setting operation at this most I cycle tests can be limited, on this basis again in conjunction with other operation, obtain the test case of random test.
Again such as, for partition testing (partitiontesting), the quantity of test case required when adopting partition testing method can reduce test class.When the test case of design partition test, test operation can be treated according to testing requirement and carry out different classification, obtain different test cases.Such as, can be input class and output class by division of operations to be tested; Again such as, also operation to be tested can be divided based on state, the state that obtains changes class and the non-change class of state; Again such as, also can treat test operation based on function and divide, and then obtain the test case for difference in functionality.
Again such as, for the test based on fault, need the mistake to existing to estimate, according to the position estimated program positioned and encapsulate, and designing a model, to obtain the test case that can expose these mistakes.
According to some embodiment, also can comprise further with reference to figure 2, step S100: step S120, according to selected method of testing, program module be encapsulated, make the module encapsulated be suitable for test request.
Such as, step S120 can comprise and encapsulating according to minimum n-back test.Such as, for the reciprocal process of switch, it can be carried out the encapsulation of program module according to minimum n-back test, make each module after encapsulating to perform set-up function, and connect successively according to the order of test case, complete test.Specifically, such as, before carrying out random test, protocol interaction class method can be encapsulated as with lower module respectively according to minimum n-back test: connect module, be suitable for performing connection serial port function; Setup module, is suitable for performing communication and sets up function; Open module, is suitable for execution and opens network interface card function; Recv module, is suitable for execution and accepts message function; Send module, is suitable for performing transmission message function; Prase module, is suitable for performing analytic message function; Routeadd module, is suitable for performing the function of adding route; Routedelete module, is suitable for performing the function of deleting route; Showroute module, is suitable for performing the function of checking route; Assert module, is suitable for the function of execution result comparison; Print module, is suitable for performing print log; Close module, is suitable for performing the function of closing and connecting.
Such as, step S120 also can comprise relevant according to function or attribute is relevant encapsulates.Such as, can by program according to performing close function or the program with close attribute is encapsulated as a module, to implement partition testing.In concrete enforcement, after also can first program module being encapsulated according to minimum n-back test, then function to be correlated with or package module that attribute is relevant merges.
Such as, step S120 also the requirement that can comprise based on fault or other test case encapsulate.Such as, when detect there is print fault time, can by print relevant program and encapsulate, to position the particular location of fault.
In a kind of specific embodiment, method for testing software of the present invention is adopted to test switch protocol reciprocal process.First, protocol interaction class method is encapsulated according to most I n-back test, makes it comprise: connect module, setup module, open module, recv module, send module, prase module, routeadd module, routedelete module, showroute module, assert module, print module, close module.
Then, in the process of design test case, first according to test needs, method of testing is selected.Specifically, a kind of method of testing can be adopted, also can adopt various test, also can by same method of testing Reusability repeatedly.When adopting various test, according to test needs, can carry out successively or alternately perform method of testing.
First, for random test, according to the property of system of program package module, set the tandem of described package module, obtain the test case of random test.Such as, with reference to figure 3, due to first serial ports must be connected before other operations of application, and could serial ports be closed after completing all operations, thus, first described package module is sorted, obtain test case using Connect--setup--open as beginning and using close as ending; Then, according to the operation carrying out required for each testing, obtain the test case being used for test printing respectively: Connect--setup--open--send--print--close, and for testing the test case receiving message: Connect--setup--oepn--recv--prase--assert--close.
Then, for partition testing, in one embodiment, can do whether to change state according to program package module and divide, respectively for the test case that the package module that can change state is corresponding with the package module design that can not change state.Such as, with reference to figure 4, routeadd module or routedelete module, it has the ability of change state, and recv module, or send module, or prase module, or assert module, or print module is then corresponding to the operation that state can not change, after package module is classified, whether can change according to state, design corresponding test case respectively.In another embodiment, also whether can change according to attribute in program package module and divide.Such as can comprise using showroute, amendment showroute and not using for showroute operation and not revise showroute three types, test case corresponding to different attribute can be designed respectively according to this three types, thus as much as possible whole states of operation are tested, ensure the reliability of test.In another embodiment, also can divide based on operating the function realized, such as, operation in above-mentioned protocol interaction class can be divided into initialization operation (such as connect module, setup module, open module), message operation (such as send module, recv module, prase module), routing operations (such as routeadd module, routedelete module), results operation (such as assert module, print module), terminating operation (such as close module) etc., then be each functional category design test case respectively.
In addition, when there is set fault, also by the test based on fault, participate in program module design test case according to the execution corresponding to this fault, fault is simulated and reappears, described test case can be come out causing the program error of fault.
According to some embodiment, step S200 can comprise further: select one or more of above-mentioned test case, build test environment, perform described test case; And also can comprise further: when a fault is found, record and revise fault.
Compared to prior art, the property of system that the present invention is based on program package module is classified, and according to different types, based on class, software test case is designed, thus make test case have applicability widely, enhance the safety and efficiently of software test, improve work efficiency.
Only for purposes of illustration, herein some aspect and embodiment with reference to component description shown in accompanying drawing.But the function of shown assembly can be overlapping, and can present with the element of less or more quantity and assembly.In addition, all or part of function of shown element can coexist or distribute between the position of some local position distributions.And embodiments of the invention, feature, aspect and principle can realize in various embodiments, and be not limited to shown environment.In addition, the sequence of above-mentioned event is exemplary, and is not intended to restriction.Therefore, other method step can be used, even and if utilize said method, the certain order of event also alterable and do not deviate from scope of the present invention.And, some step may not be there is and the step of adding can be realized.
The each embodiment of the invention described above usually can within Computer Systems Organization well known in the art or on implement, the function of each embodiment of described the present invention can pass through hardware or software simulating.On software, parts can be a step, a process or wherein a part of, and it performs specific or correlation function.On hardware, parts are exactly the functional hardware unit being designed to use together with other parts.Such as, parts can use discrete electronic unit to realize, or form the part of whole circuit for such as special IC (ASIC), also exist many other may.Those skilled in the art be appreciated that the present invention also by hardware component and software part combination and realize.
After considering instructions and realizing the present invention disclosed herein, other embodiments of the present invention will be apparent to those skilled in the art.Instructions and example are only exemplary, and actual range of the present invention and spirit are indicated by claims.

Claims (9)

1., based on a method of testing for OO switch software test case, it is characterized in that, comprising:
The property of system according to test request and program package module is classified, and designs the test case being adapted to different method of testing according to classification results respectively;
Test respectively according to one or more of described test case, obtain test result.
2. the method for claim 1, is characterized in that, the described property of system according to program package module is carried out classification and comprised:
Random test, partition testing and based on one or more method of testings in the test of fault is selected according to test request;
According to selected method of testing, program module is encapsulated, make the module encapsulated be suitable for test request.
3. method as claimed in claim 2, it is characterized in that, the method for testing selected by described basis is carried out encapsulation to program module and is comprised following one or combination:
Encapsulate according to minimum n-back test;
Relevant or attribute is relevant encapsulates according to function;
Requirement based on fault or other test case encapsulates.
4. method as claimed in claim 3, it is characterized in that, the described mode (for random test) carrying out encapsulating according to minimum n-back test is: before random test, described program module is encapsulated as with lower module respectively according to minimum n-back test: connect module, is suitable for performing connection serial port function; Setup module, is suitable for performing communication and sets up function; Open module, is suitable for execution and opens network interface card function; Recv module, is suitable for execution and accepts message function; Send module, is suitable for performing transmission message function; Prase module, is suitable for performing analytic message function; Routeadd module, is suitable for performing the function of adding route; Routedelete module, is suitable for performing the function of deleting route; Showroute module, is suitable for performing the function of checking route; Assert module, is suitable for the function of execution result comparison; Print module, is suitable for performing print log; Close module, is suitable for performing the function of closing and connecting.
5. method as claimed in claim 4, it is characterized in that, the program of described program module is protocol interaction class method.
6. method as claimed in claim 2, it is characterized in that, the method for testing selected by described basis is carried out encapsulation to program module and is comprised: first encapsulate according to minimum n-back test, then encapsulates based on function or attribute or failure requirements.
7. the method as described in claim 3 or 6, it is characterized in that, describedly design the test case being adapted to different method of testing respectively according to classification results, comprising: according to the property of system of program package module, set the tandem of described package module, obtain the test case of random test.
8. the method as described in claim 3 or 6, it is characterized in that, describedly design the test case being adapted to different method of testing respectively according to classification results, comprise: do whether to change state according to program package module and divide, respectively for the test case that the package module that can change state is corresponding with the package module design that can not change state.
9. the method as described in claim 3 or 6, it is characterized in that, describedly design the test case being adapted to different method of testing respectively according to classification results, comprise: whether divide, design the test case corresponding to different attribute respectively according to attribute status if changing according to attribute in program package module.
CN201510589961.5A 2015-09-16 2015-09-16 Test method based on object-oriented switchboard software test cases Pending CN105117342A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510589961.5A CN105117342A (en) 2015-09-16 2015-09-16 Test method based on object-oriented switchboard software test cases

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510589961.5A CN105117342A (en) 2015-09-16 2015-09-16 Test method based on object-oriented switchboard software test cases

Publications (1)

Publication Number Publication Date
CN105117342A true CN105117342A (en) 2015-12-02

Family

ID=54665340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510589961.5A Pending CN105117342A (en) 2015-09-16 2015-09-16 Test method based on object-oriented switchboard software test cases

Country Status (1)

Country Link
CN (1) CN105117342A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109308263A (en) * 2018-09-29 2019-02-05 北京云测信息技术有限公司 A kind of small routine test method, device and equipment
CN111538669A (en) * 2020-04-29 2020-08-14 中国银行股份有限公司 Test case extraction method and device based on historical problem backtracking analysis

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414935A (en) * 2008-07-09 2009-04-22 北京星网锐捷网络技术有限公司 Method and system for generating test case
CN102375777A (en) * 2010-08-12 2012-03-14 盛科网络(苏州)有限公司 Object-oriented test platform
CN104239210A (en) * 2014-09-23 2014-12-24 浪潮电子信息产业股份有限公司 Object-oriented designing and compiling method of test case

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414935A (en) * 2008-07-09 2009-04-22 北京星网锐捷网络技术有限公司 Method and system for generating test case
CN102375777A (en) * 2010-08-12 2012-03-14 盛科网络(苏州)有限公司 Object-oriented test platform
CN104239210A (en) * 2014-09-23 2014-12-24 浪潮电子信息产业股份有限公司 Object-oriented designing and compiling method of test case

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐宏喆 等: "《面向对象高级技术教程》", 31 January 2012 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109308263A (en) * 2018-09-29 2019-02-05 北京云测信息技术有限公司 A kind of small routine test method, device and equipment
CN109308263B (en) * 2018-09-29 2021-10-22 北京云测信息技术有限公司 Applet testing method, device and equipment
CN111538669A (en) * 2020-04-29 2020-08-14 中国银行股份有限公司 Test case extraction method and device based on historical problem backtracking analysis
CN111538669B (en) * 2020-04-29 2023-09-22 中国银行股份有限公司 Test case extraction method and device based on historical problem backtracking analysis

Similar Documents

Publication Publication Date Title
KR101908467B1 (en) Method and apparatus for visualized network operation and maintenance
CN110995547A (en) Vehicle-mounted high-speed network testing system and method
US8332504B2 (en) Method for testing connectivity of software applications hosted on networked computers
CN109726061B (en) SoC chip verification method
CN107943008B (en) Automated diagnosis test method based on VT system
CN111427781A (en) Logic function testing method and platform compatible with simulation and entity
CN109344075A (en) Configuration method, test method, configuration server and service node device
CN109728943A (en) Fault simulator and computer interlock CAN bus communication failure test method
CN104834591B (en) Test the method for testing and system of AUTOSAR component softwares
CN114417768A (en) Digital-analog hybrid simulation method and system of Ethernet chip
Yao et al. Formal modeling and systematic black-box testing of sdn data plane
CN105117342A (en) Test method based on object-oriented switchboard software test cases
CN110209587B (en) Method and device for testing service process of security chip
EP2908498A1 (en) Integrated application generating system and method for internet of things terminal
US10613963B2 (en) Intelligent packet analyzer circuits, systems, and methods
CN102298112B (en) The method of testing of a kind of PLD and system
CN102929651B (en) Chip-array-based on-line loading system and loading method thereof
CN105323109B (en) Interconnection network simulator and method for simulating interconnection network
Berriri et al. Towards Model based Testing for Software Defined Networks.
Hwang et al. Test selection for a nondeterministic FSM
CN115129021B (en) Method and device for testing vehicle-mounted Ethernet
CN100483976C (en) Transmission method for testing computer network protocol
CN114706768A (en) I3C bus verification method and verification system
CN111431739B (en) QualNet-oriented dynamic fault setting method for simulation communication network
Kocić et al. A novel solution for an ECU simulator as a key component for automated testing and verification of a vehicle diagnostic device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151202

RJ01 Rejection of invention patent application after publication