CN109656821B - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN109656821B
CN109656821B CN201811512381.6A CN201811512381A CN109656821B CN 109656821 B CN109656821 B CN 109656821B CN 201811512381 A CN201811512381 A CN 201811512381A CN 109656821 B CN109656821 B CN 109656821B
Authority
CN
China
Prior art keywords
font
testing
module
font information
information
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.)
Active
Application number
CN201811512381.6A
Other languages
Chinese (zh)
Other versions
CN109656821A (en
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.)
Wondershare Technology Co ltd
Original Assignee
Wondershare 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 Wondershare Technology Co ltd filed Critical Wondershare Technology Co ltd
Priority to CN201811512381.6A priority Critical patent/CN109656821B/en
Publication of CN109656821A publication Critical patent/CN109656821A/en
Application granted granted Critical
Publication of CN109656821B publication Critical patent/CN109656821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application provides a testing method and a testing device, and relates to the field of software testing. The method comprises the following steps: classifying and sorting the text of the sample document according to the font codes and the font types to obtain font testing resources; reading font testing resources by using a module to be tested to obtain first font information; comparing the first font information with the original font information to obtain a first comparison result; inserting a preset text into the font testing resource by using a module to be tested to edit the font testing resource, and reading second font information of the preset text in the font testing resource into which the preset text is inserted; comparing the second font information with the first font information to obtain a second comparison result; and obtaining a test result of the module to be tested according to the first comparison result and the second comparison result. The font testing resource can be enriched, the time for frequently carrying out manual iteration testing is saved, and the testing work efficiency is improved.

Description

Test method and device
Technical Field
The application relates to the field of software testing, in particular to a testing method and a testing device.
Background
At present, the testing of font-matched software modules is usually an iterative testing, i.e., each testing requires repeated testing of the tested software module, and thousands of irregular characters are involved in the process. The existing mode of carrying out iterative test manually needs to consume a large amount of manpower and a large amount of time, the coverage test of the software module cannot be realized in limited time, the error rate of manual test is high, and inaccurate test results can cause adverse effects on the development or maintenance of the module.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a testing method and apparatus to solve the above problems.
In a first aspect, an embodiment of the present application provides a testing method, where the method includes:
classifying and sorting the text of the sample document according to the font codes and the font types to obtain font testing resources, wherein the font testing resources comprise original font information;
reading the font testing resource by using a module to be tested to obtain first font information;
comparing the first font information with the original font information to obtain a first comparison result;
inserting a preset text into the font testing resource by using a module to be tested so as to edit the font testing resource, and reading second font information of the preset text in the font testing resource into which the preset text is inserted;
comparing the second font information with the first font information to obtain a second comparison result;
and obtaining a test result of the module to be tested according to the first comparison result and the second comparison result.
Optionally, classifying and sorting the text of the sample document according to the font code and the font type to obtain a font testing resource, including:
classifying the text of the sample document for the first time according to the font codes, and storing the text corresponding to the font codes into the corresponding primary document;
classifying the texts in the primary document again according to the font types, and storing the texts with the corresponding font types into the corresponding secondary document;
optionally, the primary document includes a primary document identification, the secondary document includes a secondary document identification,
comparing the first font information with the original font information, including:
comparing the primary document identification in the first font information with the corresponding primary document identification in the original font information;
and comparing the secondary document identification in the first font information with the corresponding secondary document identification in the original font information.
Optionally, inserting a preset text into the font testing resource by using a module to be tested to edit the font testing resource, including:
and inserting a preset text into the secondary document of the font testing resource by using the module to be tested.
Optionally, comparing the second font information with the first font information includes:
comparing the primary document identification in the second font information with the corresponding primary document identification in the first font information;
and comparing the secondary document identification in the second font information with the corresponding secondary document identification in the first font information.
In a second aspect, an embodiment of the present application further provides a testing apparatus, where the apparatus includes:
the classification module is used for classifying and sorting the text of the sample document according to the font codes and the font types to obtain font testing resources, wherein the font testing resources comprise original font information;
the calling module is used for reading the font testing resource by using the module to be tested to obtain first font information;
the comparison module is used for comparing the first font information with the original font information to obtain a first comparison result;
the calling module is further used for inserting a preset text into the font testing resource by using the module to be tested so as to edit the font testing resource, and reading second font information of the preset text in the font testing resource into which the preset text is inserted;
the comparison module is further configured to compare the second font information with the first font information to obtain a second comparison result;
the comparison module is further used for obtaining a test result of the module to be tested according to the first comparison result and the second comparison result.
Optionally, when the classification module is configured to classify and sort the text of the sample document according to the font code and the font type to obtain the font test resource, the classification module is specifically configured to:
classifying the text of the sample document for the first time according to the font codes, and storing the text corresponding to the font codes into the corresponding primary document;
and classifying the texts in the primary document again according to the font types, and storing the texts with the corresponding font types into the corresponding secondary document.
Optionally, the primary document includes a primary document identification, the secondary document includes a secondary document identification,
when the comparing module is configured to compare the first font information with the original font information, the comparing module is specifically configured to:
comparing the primary document identification in the first font information with the corresponding primary document identification in the original font information;
and comparing the secondary document identification in the first font information with the corresponding secondary document identification in the original font information.
Optionally, when the module to be tested is used to insert a preset text into the font testing resource to edit the font testing resource, the invoking module is specifically configured to:
and inserting a preset text into the secondary document of the font testing resource by using the module to be tested.
Optionally, when the comparing module is configured to compare the second font information with the first font information, the comparing module is specifically configured to:
comparing the primary document identification in the second font information with the corresponding primary document identification in the first font information;
comparing the secondary document identification in the second font information with the corresponding secondary document identification in the first font information
Compared with the prior art, the method has the following beneficial effects:
according to the testing method and the testing device, the text of the sample document is classified and sorted according to the font codes and the font types, the documents containing different fonts can be added in an iterative mode, the sample document is converted, the range of the tested fonts is expanded, and font testing resources are enriched. The reading function and the editing function of the font testing resources of the module to be tested are respectively tested to obtain an accurate comprehensive testing result, so that the time for frequently carrying out manual iteration testing is saved, the testing work efficiency is improved, the testing result can be better fed back to the module development and maintenance, and the quality of the tested module is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments are briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a testing method provided in an embodiment of the present application;
FIG. 3 is a flowchart illustrating a sub-step of step S10 in FIG. 2;
fig. 4 is a block diagram of a testing apparatus according to an embodiment of the present disclosure.
An icon: 10-an electronic device; 20-a test device; 11-a processor; 12-a memory; 13-a module to be tested; 21-a classification module; 22-calling module; 23-comparison Module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In order to overcome the problems of the prior art, the applicant has studied to provide a solution given in the following examples.
Referring to fig. 1, fig. 1 is a block diagram of an electronic device 10 according to an embodiment of the present disclosure, where the electronic device 10 includes a processor 11, a memory 12, a module under test 13, and a testing apparatus 20. The electronic device 10 may be a Personal Computer (PC), a tablet computer, a Personal Digital Assistant (PDA), or the like, and the Operating System (OS) of the electronic device 10 may be, but is not limited to, an Android system, an ios (internet operating system) system, a Windows system, or the like.
The elements of the processor 11 and the memory 12 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The module under test 13 and the testing device 20 include at least one software function module which can be stored in the memory 12 in the form of software or firmware or solidified in the operating system of the electronic device 10. The processor 11 is configured to execute the executable modules stored in the memory 12, including the software functional modules and the computer programs included in the module to be tested 13 and the testing device 20.
The Processor 11 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP)), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The Memory 12 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 12 is used to store programs or data.
It is understood that the electronic device 10 provided in the embodiment of the present application may further include an input/output unit and a display unit (not shown in fig. 1). The input/output unit includes, but is not limited to, a keyboard, a mouse, etc., for providing a user with input data to enable user interaction with the electronic device 10. The display unit includes, but is not limited to, a liquid crystal display, a touch display, etc. for providing an interactive interface for displaying information between the electronic device 10 and a user.
Referring to fig. 2, fig. 2 is a flowchart illustrating a testing method according to an embodiment of the present disclosure, where the testing method is applied to the electronic device 10 shown in fig. 1. The specific flow of the test method will be described in detail below.
And step S10, classifying and sorting the text of the sample document according to the font code and the font type to obtain font testing resources.
In the present embodiment, the sample document may contain any text, including but not limited to chinese characters, english characters, japanese characters, etc. Characters in text may be of different font types under different font encodings (e.g., GBK, UTF-16, BIG5, GB2312, GB18030, Unicode, etc.). The font type contains font information (such as Yao font, Huawen Caiyun font, Huawen imitating Song style, Song font, Meiryo font, MSGothic font, Batang font, AdobesgStd-Light, etc.), and also contains other information such as text character size, color, bolding, italics, etc. In the existing testing process, because sample documents required by testing contain massive contents, a great deal of time is consumed for testing personnel to manually identify font codes and font types, and the processing efficiency is extremely low. In the embodiment, the sample documents are automatically classified and sorted, and are classified and sorted into the font testing resources according to the font codes and the font types, so that the processing efficiency is improved, and the subsequent testing is facilitated.
Referring to fig. 3, in detail, the step S10 includes the following sub-steps.
And a substep S11, classifying the text of the sample document for the first time according to the font code, and storing the text corresponding to the font code into the corresponding primary document.
First, the characters encoded in the same font in the sample document are classified into one class. As an alternative embodiment, the sample document may be arranged as a font document containing a plurality of primary documents, which may be folders. Each primary document corresponds to one font code and is named by the font code, and the text with the same font code is stored in the corresponding primary document.
In this embodiment, as an optional implementation manner, the sample documents may be further classified in a finer manner according to the encoding range of the font code. For example, in Unicode encoding, different encoding ranges correspond to different characters (e.g., encoding ranges 0600-06FF for arabic, encoding ranges 0980-09FF for bangladesh, etc.), and when the sample documents are classified, the characters in the same font encoding range in the sample documents are classified into one class and stored in a corresponding primary document, and the primary document is named by the corresponding font encoding and encoding ranges.
And a substep S12 of reclassifying the text in the primary document according to the font type and storing the text with the corresponding font type in the corresponding secondary document.
Second, the character documents stored in the primary document named with the font code are classified again according to the font type. The primary document may include a plurality of secondary documents, each secondary document corresponding to a font type and named by a font name, and text of the same font type is stored in the corresponding secondary document.
It should be noted that, in order to simplify the testing process and save the testing time, in this embodiment, the classification of the secondary document is performed only according to the font information included in the font type, and the font type to be described later in this embodiment also includes only the font information of the text. In other embodiments of the present application, the classification of the secondary document may also be performed according to any one or more information contained in the font type.
The font document obtained after the processing of the substep S11-the substep S12 is the font testing resource. It is understood that if other sample documents need to be introduced later, the step S10 is performed only on the newly introduced sample document, and the text with the same font code or the same font type is stored in the corresponding position in the font document, without performing the step S10 again on all the sample documents. The step can iteratively increase the documents containing different fonts, realize the conversion of the sample document and the expansion of the test font range, and enrich the font test resources.
As an alternative implementation, the original font information in the font test resource may be stored using a CSV file (Comma-Separated Values file). The original font information includes a primary document identifier of the primary document and a secondary document identifier of the secondary document, where the primary document identifier may be a document name of the primary document, that is, a name of the font code, and the secondary document identifier may be a document name of the secondary document and a name of the font type (in this embodiment, a name of the font).
Please refer back to fig. 2, after the font testing resource is obtained, step S20 is entered.
Step S20, reading the font testing resource by using the module to be tested 13, and obtaining the first font information.
In this embodiment, the module to be tested 13 is called to read the font testing resource to test the reading function of the module to be tested 13, and optionally, the module to be tested 13 is a font matching module. The reading process is as follows: firstly, reading a primary document identifier of the font testing resource by using the module to be tested 13; then, the secondary document identification of the font testing resource is read by the module to be tested 13. The first-level document identification and the second-level document identification read by the module to be tested 13 are first font information.
Step S30, comparing the first font information with the original font information to obtain a first comparison result.
In this embodiment, as an optional implementation manner, before performing the comparison, the font information stored in the CSV file may be converted into an Excel file, the font information in the Excel file is combed, unnecessary spaces or identifiers in the font code name and the font type name are removed, and the font code name and the font type name are more standard, so that the comparison result is more accurate.
In this embodiment, before comparing the first font information with the original font information, the first font information may also be stored in the CSV file, and the above step of converting the CSV file into an Excel file and performing information combing is performed. And when comparing, comparing the first font information in the Excel file with the original font information. The specific alignment process is as follows:
firstly, comparing a primary document identifier in the first font information with a corresponding primary document identifier in the original font information;
then, the secondary document identification in the first font information is compared with the corresponding secondary document identification in the original font information.
If the primary document identification in the first font information is consistent with the corresponding primary document identification in the original font information, the reading result of the font code by the module to be tested 13 is correct. If the secondary document identifier in the first font information is consistent with the corresponding secondary document identifier in the original font information, the reading result of the font type by the module to be tested 13 is correct.
And after saving the result of comparing the first font information with the original font information as a first comparison result, entering step S40.
Step S40, inserting a preset text into the font testing resource by using the module to be tested 13 to edit the font testing resource, and reading the second font information of the preset text in the font testing resource into which the preset text is inserted.
In this embodiment, a to-be-tested module 13 is used to insert a preset text into the font testing resource to edit the font testing resource, and the second font information of the preset text is read to test the font editing function of the to-be-tested module 13. Specifically, a preset text is inserted into the secondary document of the font testing resource by using the module to be tested 13, where the preset text may be a character segment randomly extracted from any text library. The predetermined text only contains character information (e.g., chinese characters, english characters, arabic characters, greek characters, etc.) and does not contain font information (e.g., font, size, color, etc.). When the preset characters are inserted into the secondary document, the module to be tested 13 converts the preset text into characters corresponding to the font codes and font types according to the specifically inserted secondary document and the primary document corresponding to the secondary document. For example, a preset text is inserted into a secondary document "song body", the primary document corresponding to the secondary document is "GBK", and if the preset text is a chinese character, the module to be tested 13 converts the preset text into "GBK" and "song body" characters. If the preset text segment is an english character, the module to be tested 13 converts the preset text segment according to a preset rule, for example, converts the preset text segment into a "timesnewman" character.
After the font testing resource is edited, the to-be-tested module 13 is further required to read the second font information of the preset text in the font testing resource into which the preset text is inserted. The reading process is similar to the above step S20, and reference may be made to the above description. And after reading, obtaining second font information of the preset text, wherein the second font information comprises a primary document identifier of a primary document into which the preset text is inserted and a secondary document identifier corresponding to the font type converted from the preset text.
After the second font information is obtained, the process proceeds to step S50.
Step S50, comparing the second font information with the first font information to obtain a second comparison result.
In this embodiment, optionally, before comparing the second font information with the first font information, the second font information may also be stored in the CSV file, and the above step of converting the CSV file into an Excel file and performing information combing is performed. And when the first font information is compared with the second font information in the Excel file, comparing the second font information with the first font information. The specific alignment process is as follows:
firstly, comparing a primary document identifier in the second font information with a corresponding primary document identifier in the first font information;
and then, comparing the secondary document identification in the second font information with the corresponding secondary document identification in the first font information.
And if the primary document identifier in the second font information is consistent with the corresponding primary document identifier in the first font information, and the secondary document identifier in the second font information is consistent with the corresponding secondary document identifier in the first font information, the editing result of the font testing resource by the module to be tested 13 is correct.
In this embodiment, if the content of the inserted preset text is different from the content of the inserted secondary document (for example, the content of the inserted secondary document is chinese characters, and the content of the preset text is english characters), after the module to be tested 13 converts the preset text according to the preset rule, the font type of the preset text may be different from the font type of the inserted secondary document. That is, the secondary document identifier in the second font information may be identified as inconsistent with the corresponding secondary document identifier in the first font information, and this part of incorrect reading result needs to be corrected to be correct to eliminate interference, so that the test result is more accurate. The correction mode may be automatic correction according to a preset rule, or may be manual correction by a tester according to an output result, which is not limited herein.
And after the result of comparing the second font information with the first font information is stored as a second comparison result, the step S60 is performed.
Step S60, obtaining a test result for the module to be tested 13 according to the first comparison result and the second comparison result.
In this embodiment, after the result of the test on the module to be tested 13 is obtained, the result may be output, so that the tester can visually check the test result. As an optional implementation manner, according to the result of the test on the module to be tested 13, the contents with incorrect reading of the font code, incorrect reading of the font type or incorrect editing (including reading an incorrect primary document and all secondary documents contained therein, reading an incorrect secondary document, editing an incorrect secondary document) are screened out, the contents are sorted and an incorrect content document is generated for output. As another optional implementation, the reading results of all the secondary documents in the same primary document can be integrated, the reading results are counted by adopting a pivot table in an Excel file, and the reading accuracy is output.
Referring to fig. 4, fig. 4 is a functional block diagram of the testing device 20 shown in fig. 1 according to an embodiment of the present disclosure. It is to be understood that the specific functions of the functional modules of the testing device 20 have been described in detail in the above embodiments of the method steps, and only the functional modules of the testing device 20 will be briefly described below.
The classification module 21 is configured to classify and sort the text of the sample document according to the font code and the font type to obtain a font test resource, where the font test resource includes original font information.
The calling module 22 is configured to read the font testing resource by using the module to be tested 13 to obtain the first font information.
The comparison module 23 is configured to compare the first font information with the original font information to obtain a first comparison result.
The calling module 22 is further configured to insert a preset text into the font testing resource by using the module to be tested 13 to edit the font testing resource, and read second font information of the preset text in the font testing resource into which the preset text is inserted.
The comparison module 23 is further configured to compare the second font information with the first font information to obtain a second comparison result.
The comparison module 23 is further configured to obtain a test result of the module to be tested 13 according to the first comparison result and the second comparison result.
In summary, the test method and the test device provided by the embodiment of the present application classify and sort the text of the sample document according to the font code and the font type, and can iteratively add documents containing different fonts, thereby implementing conversion of the sample document and expansion of the test font range, and enriching the font test resources. The reading function and the editing function of the font testing resources of the module to be tested are respectively tested to obtain an accurate comprehensive testing result, so that the time for frequently carrying out manual iteration testing is saved, the testing work efficiency is improved, the testing result can be better fed back to the module development and maintenance, and the quality of the tested module is ensured.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
If the functions of the above method steps are implemented in the form of software functional modules and sold or used as a stand-alone product, they may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element. Furthermore, the terms "first," "second," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying a relative importance of what is being referred to.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (8)

1. A method of testing, the method comprising:
classifying and sorting the text of the sample document according to the font codes and the font types to obtain font testing resources, wherein the font testing resources comprise original font information;
classifying and sorting the text of the sample document according to the font codes and the font types to obtain font testing resources, wherein the font testing resources comprise:
classifying the text of the sample document for the first time according to the font codes, and storing the text corresponding to the font codes into the corresponding primary document;
classifying the texts in the primary document again according to the font types, and storing the texts with the corresponding font types into the corresponding secondary document;
reading the font testing resource by using a module to be tested to obtain first font information;
comparing the first font information with the original font information to obtain a first comparison result;
inserting a preset text into the font testing resource by using a module to be tested so as to edit the font testing resource, and reading second font information of the preset text in the font testing resource into which the preset text is inserted;
comparing the second font information with the first font information to obtain a second comparison result;
and obtaining a test result of the module to be tested according to the first comparison result and the second comparison result.
2. The testing method of claim 1, wherein the primary document includes a primary document identification, the secondary document includes a secondary document identification,
comparing the first font information with the original font information, including:
comparing the primary document identification in the first font information with the corresponding primary document identification in the original font information;
and comparing the secondary document identification in the first font information with the corresponding secondary document identification in the original font information.
3. The method of claim 2, wherein inserting a predetermined text into the font testing resource with the module under test to edit the font testing resource comprises:
and inserting a preset text into the secondary document of the font testing resource by using the module to be tested.
4. The method of claim 3, wherein comparing the second font information to the first font information comprises:
comparing the primary document identification in the second font information with the corresponding primary document identification in the first font information;
and comparing the secondary document identification in the second font information with the corresponding secondary document identification in the first font information.
5. A test apparatus, the apparatus comprising:
the classification module is used for classifying and sorting the text of the sample document according to the font codes and the font types to obtain font testing resources, wherein the font testing resources comprise original font information;
the classification module is specifically used for performing primary classification on the text of the sample document according to the font codes and storing the text corresponding to the font codes into the corresponding primary document; classifying the texts in the primary document again according to the font types, and storing the texts with the corresponding font types into the corresponding secondary document;
the calling module is used for reading the font testing resource by using the module to be tested to obtain first font information;
the comparison module is used for comparing the first font information with the original font information to obtain a first comparison result;
the calling module is further used for inserting a preset text into the font testing resource by using the module to be tested so as to edit the font testing resource, and reading second font information of the preset text in the font testing resource into which the preset text is inserted;
the comparison module is further configured to compare the second font information with the first font information to obtain a second comparison result;
the comparison module is further used for obtaining a test result of the module to be tested according to the first comparison result and the second comparison result.
6. The testing apparatus of claim 5, wherein the primary document includes a primary document identification, the secondary document includes a secondary document identification,
when the comparing module is configured to compare the first font information with the original font information, the comparing module is specifically configured to:
comparing the primary document identification in the first font information with the corresponding primary document identification in the original font information;
and comparing the secondary document identification in the first font information with the corresponding secondary document identification in the original font information.
7. The testing apparatus of claim 6, wherein when the invoking module is configured to insert a preset text into the font testing resource by using the module to be tested to edit the font testing resource, the invoking module is specifically configured to:
and inserting a preset text into the secondary document of the font testing resource by using the module to be tested.
8. The testing apparatus of claim 7, wherein, when being configured to compare the second font information with the first font information, the comparing module is specifically configured to:
comparing the primary document identification in the second font information with the corresponding primary document identification in the first font information;
and comparing the secondary document identification in the second font information with the corresponding secondary document identification in the first font information.
CN201811512381.6A 2018-12-11 2018-12-11 Test method and device Active CN109656821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811512381.6A CN109656821B (en) 2018-12-11 2018-12-11 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811512381.6A CN109656821B (en) 2018-12-11 2018-12-11 Test method and device

Publications (2)

Publication Number Publication Date
CN109656821A CN109656821A (en) 2019-04-19
CN109656821B true CN109656821B (en) 2022-06-07

Family

ID=66114097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811512381.6A Active CN109656821B (en) 2018-12-11 2018-12-11 Test method and device

Country Status (1)

Country Link
CN (1) CN109656821B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113361239B (en) * 2021-06-01 2024-06-25 北京百度网讯科技有限公司 Document testing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136166A (en) * 2011-12-01 2013-06-05 北大方正集团有限公司 Method and device for font determination
CN103365894A (en) * 2012-03-29 2013-10-23 天津书生软件技术有限公司 Font format conversion method and device
US9148494B1 (en) * 2014-07-15 2015-09-29 Workiva Inc. Font loading system and method in a client-server architecture
CN105512096A (en) * 2015-11-30 2016-04-20 北京大学 Optimization method and device based on file embedded font

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289407B (en) * 2011-09-06 2013-12-11 北京信息科技大学 Method for automatically testing document format conversion

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136166A (en) * 2011-12-01 2013-06-05 北大方正集团有限公司 Method and device for font determination
CN103365894A (en) * 2012-03-29 2013-10-23 天津书生软件技术有限公司 Font format conversion method and device
US9148494B1 (en) * 2014-07-15 2015-09-29 Workiva Inc. Font loading system and method in a client-server architecture
CN105512096A (en) * 2015-11-30 2016-04-20 北京大学 Optimization method and device based on file embedded font

Also Published As

Publication number Publication date
CN109656821A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
US9690788B2 (en) File type recognition analysis method and system
EP3051428B1 (en) Method and system for selecting an encoding format for reading a target document
CN110741376A (en) Automatic document analysis for different natural languages
CN113569530A (en) Intelligent document typesetting method and system
US10366142B2 (en) Identifier based glyph search
CN114048129A (en) Automatic testing method, device, equipment and system for software function change
CN109656821B (en) Test method and device
CN109815243B (en) Structured storage method and device during document interface modification
US11720541B2 (en) Document content extraction and regression testing
US20190064193A1 (en) Data processing system for analyticl instrument, and data processing program for analytical instrument
US7398467B1 (en) Method and apparatus for providing spelling analysis
CN114817043A (en) Method, device and medium for extracting product test data
CN112241445B (en) Labeling method and device, electronic equipment and storage medium
CN115328898A (en) Data processing method and device, electronic equipment and medium
TWI777163B (en) Form data detection method, computer device and storage medium
CN114743012A (en) Text recognition method and device
US9916315B2 (en) Computer implemented system and method for comparing at least two visual programming language files
CN113962205A (en) Method and device for pasting spreadsheet contents, electronic equipment and storage medium
CN113791860A (en) Information conversion method, device and storage medium
US11170164B2 (en) System and method for cell comparison between spreadsheets
CN110728115A (en) Disordered code identification method and device for document content and electronic equipment
CN115934757A (en) Method and device for analyzing field blood relationship based on SQL (structured query language) and electronic equipment
WO2023089675A1 (en) Display control device, display control method, and display control program
CN115294585A (en) Method and device for extracting standard document data
CN116451710A (en) Method, apparatus and storage medium for detecting missing document translation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant