Software testing theoretical basis of summing up (seven) --21 fault model

1. Enter the illegal data

  1.1. Defect Causes

    Developers often to deal with illegal import of the following three techniques:

      - prevent incorrect input into the tested software. Filter out incorrect input, allowing only legal input through the interface;

      - After entering incorrect data, the software prompts an error message, refused to incorrect input;

      - Allows incorrect input into the system and processed, call the exception handler when a software failure, displays some error messages;

    In addition to the visible developers to write code for the main function, but also have to write the code to check the illegal import of these codes are often forgotten, or finish writing this part of the code, developers rarely seriously checked, resulting in the processing of illegal input often wrong;

  1.2. How to find this kind of problem

    Starting from the properties when tested input values, generally consider the following three points:

      - Input Type: Type an invalid type often result in error messages;

      - Input Length: The character, a character type too often lead error;

      - Boundary Value: Enter the data boundary value or exceeds a limit value;

  1.3 Test Methods Summary

    Applications: GUI input;

    Test Method: respectively, from the viewpoint of the input data type, length, boundary values ​​and the like;

    Test information check:

      - error messages and error to be consistent;

      - error message is empty, the user does not know why it went wrong;

      - An error message is displayed to developers debugging use, such as "Error 5-unknown data", the developer can easily find this information by type of error, but users do not understand, do not know what is wrong;

      - Testing knowledge base: remember boundary values ​​of the basic data types;

2. Enter the default value

  2.1. Defect Causes

    Once the software is used in variable, you must assign initial values, if you use these variables prior to assignment, the software will fail, correct order to use variable is: declare variables - variable assignment - use variables. Usually the default value of the variable is not correct for two reasons:

      - variable assignment to this step will often be inadvertently passing developer;

      - Developers are sometimes not sure what in the end to be assigned an initial value, just give a value, but the user does not recognize the value, in this case, the software will not fail, but the use of the user's will bring a lot inconvenient. For example, a program to print the default number of output copies is set to 2 parts, the user will cause great trouble;

  2.2. How to find this kind of problem

    Determine data application software used some of the following basic principles:

      - Find the Options button configuration panel installation screens. This data is displayed on the screen often in many parts of the application's use;

      - Now source code declaration section data (if available);

    Determining the data to be tested, or may be forced to use a default value is not used by the following operations:

      - Accept the default software displays. Sometimes software requires the user to enter a value if no value is entered, the software may fail. Then you can simply click "OK" button to accept the default values, perform this function test;

      - Type a null value. Delete the default value input field becomes empty;

      - the default value to another value, this would allow the application to run different values;

      - the input value to another value and then becomes null;

    A good software will handle more than such cases, illegal content input default to some reasonable value within the legal boundaries, or returns an error message;

  2.3 Test Method Summary

    Applications: need to have a default value of place;

    Test Methods: From the option button, the configuration panel installation configuration, start screen and the like considered, with or without forced default values ​​and the like;

    Testing knowledge base: a comprehensive understanding of the requirements specification requirements for default values; at the same time a deep understanding of the tested software industry background;

3. Enter the special character set

  3.1. Defect Causes

    Application accepts input string, if there is no special program for special programming input, then it may cause the program to hang, including the following three cases:

      - character set includes ordinary and special characters. For example, ASCII character set, including ordinary and special characters. Sometimes the application can only deal with ordinary characters, an error occurs when the input special characters;

      - implement the application programming language has a specific way to deal with some of the characters and strings. For example, C language to \ n, ++ and & Such character is used for special purposes. If these strings typed into the dialog box, error handling procedures must be carried out, or prone to error;

      - may also be used provided the application name, and the program reservation system object string collection. As long as these strings used in the program, it could lead to failure;

  3.2. How to find this kind of problem

      The operating system in which the tested software, the programming language used, character set information table listing through discussion of the test group, which characters indicate the type of data and application table as input to a test;

      According to experience, because this operation is rarely software crashes, it usually does not respond to hang;

  3.3 Test Method Summary

    Applications: in need of local character input;

    Test Methods: illegal character input according to the specific circumstances of the software under test;

    Testing knowledge base: as much as much as possible about the character sets, programming languages ​​and operating systems retain the string and its specific meaning, so that we can better resolve such deficiencies

4. Enter data buffer so that overflow

  4.1. Defect Causes

    Developers do not consider the size of the string passed to the memory buffer. If the buffer is reserved only fixed length string, the string will be input longer overwritten by other memory storage unit, causing the operating system forcibly terminates the application;

  4.2. How to find this kind of problem

    When the application allows letters, numbers, such testing is performed by GUI controls (e.g., text boxes), or by the parameters of the API call;

    The length of the input field to be tested first figure, the maximum input test string;

  4.3 Test Methods Summary

    Applications: in need of local character input;

    Test Method: Input Maximum input string or a character string longer than the maximum character string according to the specific circumstances of the software under test;

    Testing knowledge base: as much as possible and developers to discuss, to understand and determine a reasonable length of the input field;

The input data error legitimate combination

  5.1. Defect Causes

    Enter a valid combination of data generated errors:

      - Test of combination of a plurality of input values, each input value has been individually tested through, but the combination of these values ​​may affect each other due to a software failure;

  5.2. How to find this kind of problem

    First test to determine which combination of inputs, and figure out the "relationship" between them. If you have any of the following characteristics, we can think of these variables is a "relationship":

      - describes the properties and content of a single internal data structures. For example, a user input panel requires input list "row" and "column", then the tester to enter a single internal data structure "list" property "rows and columns";

      - together with a calculation, that is, a plurality of input operands of an internal calculations, these input variables each having a "relationship";

  5.3 Test Methods Summary

    Applications: dependency relationship between an input value;

    Test Method: input value may be a combination of problems;

    Testing knowledge base: attributes and content as much as possible of the internal data structures, and to explore with the developer to determine the value of the data input;

6. produce in a variety of possible input output

  6.1. Defect Causes

      Case of a single input multiple output produced have a relationship with the previous input and state of the system under test. For example, click on a word processing program "close" button, if the file is edited and has not been saved, the program prompts whether to save the file. If the file has been saved, the file directly off;

  6.2. How to find this kind of problem

      Testers must have knowledge about the system under test software business, and with a variety of program documentation, a clear input output which can be generated. We could then list a list of program input and output, and then test;

  6.3 Test Methods Summary

    Applications: same input corresponding to a plurality of outputs;

    Test method: a test input of each corresponding output;

    Testing knowledge base: a comprehensive understanding of content requirements specifications, find out the relationship between input and output;

7. output does not meet the business rules invalid output

  7.1. Defect Causes

      Sometimes developers may not be a deep understanding of the business, but also a smattering of some problems, so write software that can create problems not meet the business logic. Also in most cases developers will ignore the process did not follow the general rule of inputs, if we do not deal with these special cases for programming, the software will produce erroneous results;

  7.2. How to find this kind of problem

      Issues involved field testers should learn as much as possible;

      After sometimes include an invalid output, it is difficult to know which combinations of inputs can be forced to produce the output. In this case the test must first determine which input and output related then tested by the input combination produces unexpected results, the test input process execution order is to be noted, different results may be performed in a different order. If the output can not force generating invalid, the software will not be described shortcomings in this regard;

  7.3 Test Methods Summary

    Applications: Forces of knowledge does not meet the business context;

    Test Method: include all invalid output, and then individually tested;

    Testing knowledge base: a comprehensive understanding of content requirements specifications, familiar with the industry knowledge;

8. The result of the output attribute modification

  8.1. Defect Causes

      Output often have modifiable properties, such as color, shape, size and dimension, the user can modify these properties. In this case, the developer must be encoded, or to establish the initial default attribute values, and coding allows the user to edit these properties. When the user changes these properties, the corresponding internal variable value also changes accordingly, when processing again, these values ​​are not restored to the default value, the output attribute is forcibly changed;

  8.2. How to find this kind of problem

      The test method can be used those having editable output, modifiability function. Testers first carefully understand the output that can be generated, with particular attention to the output with editable properties. Testers task is to force each output to produce and edit their properties, and then again to force the output to produce;

  8.3 Test Method Summary

    Applications: The result output, attributes that can be modified by the user;

    Test Method: Each output force is generated, and edit its properties, then re-generate an output force;

    Testing knowledge base: a comprehensive understanding of content requirements specification, understand the output that can be generated;

9. The display screen refresh

  9.1. Defect Causes

      GUI software will usually produce refresh problem, because at the time of the GUI window covering, moved and resized, you must refresh the screen to make the object reappear. But if you frequently refresh, easy to slow down the application; if not refreshed, will affect users of the program, the user must stop working, to find ways to refresh before they can continue to work. So developers sometimes not well determine when to refresh, to what extent need to refresh the area, which vexing refresh problem occurred;

  9.2. How to find this kind of problem

    Refresh method of testing problem is to add, delete, move objects on your screen, so make certain objects reappear. If not properly and timely re-display, it creates a software defect. We can check refresh through the following methods:

      - from the starting position of the moving object. To move a little, and then increase the range of movement; first move once or twice, then move several times to ensure coverage of all areas;

      - starts from the boundary of the object covered with a little cover so that one of the objects do not cover an object;

      - the use of different types of objects. If an application supports multiple types of objects, such as text objects, graphics objects, etc., put to use these different objects mixed together;

  9.3 Test Methods Summary

    Applications: An object contained within another object, when you drag an object to be included, refresh problems that may arise;

    Test Method: increase, delete, and move objects on the screen;

    Testing knowledge base: a comprehensive understanding of content requirements specification, understand the relationship between program objects;

10. The data structure overflow

  10.1 Defect Causes

      All size data structure is capped. Data structures will gradually increase the length of the machine to fill the memory or disk space, while the other data structure having a fixed upper limit. Developers often on the content of the data structure of the encoded forget the limitations of the physical structure itself;

  10.2. How to find this kind of problem

      Determining the boundaries of the data structure, too many attempts to enter the value of the data structures. Particular attention should be limits to the data type of boundary 256,1024,32768 such as overflow test;

      For underflow tests, you can try to delete a plurality of data, for example, when the structure is empty, try to delete, or add data, attempt to remove the case when two transactions;

  10.3. Test Methods Summary

    Applications: There is an array of programs;

     Test Method: too many attempts to enter the value of a data structure, the test overflow; test for underflow may try to delete a plurality of data;

    Knowledge Test preparation: a comprehensive understanding of content requirements specifications, determine the limits of the data structure;

11. The data structure does not conform to the constraint

  11.1 Defect Causes

      During programming of the internal data structures are bound, including the size, dimension, type, shape, position and the like on the screen. Our focus is to test the properties the user can set these properties using a set of parameters to restrain. To be constrained data attribute to be checked at any time subsequent to the establishment of data entry and modification of data items. After the initialization code in the code to modify an error, modify the error in time only modify the initialization part, while ignoring changes in other parts, so that it does not completely modified, is not complete;

  11.2. How to find this kind of problem

      Confirmed candidate data, which may be modified and lists of attributes. Condition allowable range of valid values, each attribute lists the constraints and the like;

      Determining all of the editable attributes functional position;

      Initializing the data, to determine whether to change the attribute of each correctly constrained;

    If the data constraints damaged, it may cause the system to crash, or the performance of delayed response time, error message is incorrect and wrong use of data generated invalid output;

  11.3. Test Methods Summary

    Applications: there is a constraint of the internal structure of the application data;

    Test Method: destroy the internal data structure constraint;

    Testing knowledge base: a comprehensive understanding of content requirements specifications, determine all the constraints internal data structures;

12. The operator does not match the operands

  12.1 Defect Causes

      Almost operands each operator has its valid for a particular operator, when they are used in a developer, the code must be written error checking. For example: divide by zero problems;

  12.2. How to find this kind of problem

      Locate data or program includes an input (i.e., operands) is calculated (i.e., operator), the mathematical expression (i.e., a combination of operators and operands), and the operation of the graphics. Further, a plurality of operands to be combined are more prone to error. For example, characters and numbers can be used "+" operator. Character by "+" concatenated them; "+" to digital by adding. If the system attempts to characters and numbers together, that is contradictory operation, it can cause software failure;

  12.3. Test Methods Summary

    Applications: program required numerical or graphical operations;

    Test Method: For the numerical calculation considering a relationship between the defined operators and operands for graphics computing also consider the relationship between the various combinations of input data;

    Testing knowledge base: complete control of the software under test in the number of operators required for operation. Master different operators and operands have different valid and invalid ranges;

13. calls itself recursively

  13.1 Defect Causes

      Sometimes function calls itself recursively, if you do not limit the number of executions, recursive problems arise, it constantly calls itself, quickly take up machine resources, eventually overflow, the program crashes or hangs. The main reason for this problem is to generate code to developers do not guarantee an end to the cycle and recursive calls, often lack the condition is checked at the beginning or end of the loop;

  13.2. How Do You Know

      Looking in the software can use the function recursive call. Then you can make a list, indicating the software may be embedded in the list of recursive functions, then own your own quote to check whether the program can correctly handle;

  13.3. Test Method Summary

    Applications: the need for local and other objects to interact;

    Test Method: Consider an object interaction or self-replication;

    Testing knowledge base: fully grasp the needs of the software under test;

14. The computing result overflows

  14.1 Defect Causes

      When all input data are valid, and the final result of the calculation may be ineffective. All variables have the value range, sometimes developers when performing calculations forget to check these limits;

  14.2. How to find this kind of problem

      Again and again performing calculations using very large or very small, or the input data and the calculated value of the initial stress test data type value or values ​​near the boundary;

  14.3. Test Methods Summary

    Applications: The application to be executed can be derived and calculated to produce results stored therein;

    Test Method: compulsory data generating overflow or underflow;

    Testing knowledge base: fully grasp the needs of the software under test, to understand the limit calculated variables;

15. A data sharing function or associated miscalculation

  15.1 Defect Causes

      Many defects do not occur when the usually isolated function test, when combined with other functions of the individual function and the same software, it may be a lot of software defects. Such defects are often produced in two or more functions using a shared data set, and each function due to the difference data allowed range. For example, a function of a data item might be set to a specific size, but it allows other functions of the data item size may exceed the processing capacity of the first function. Developers did not take into account the data item can also be modified in other functions at, they just coding to ensure the legitimacy of the data in this function, and when using this data, there is no re-encoding range that can be used to check; but this time another function shared data is modified when re-using the data generated defect;

  15.2. How to find this kind of problem

      When the application is completed more than one function at the same time or when more than one function is in operation at the same time, this method can be used for testing. Using a calculation function impact input, the input data, or other functions. Before testing to determine which functions are interdependent or shared data:

        - The same function can be applied to each input. If these features have overlapping input field, interaction problem may exist;

        - has a similar function to produce output. If some features combine to produce a single output, it means that there is a relationship between these components, should be tested together;

        - a further feature is included in the calculation of the function. For example, to test the function of the mouse to select the object, not only to measure the function of the mouse to select text on the screen, you can also include a hyperlink text, bold, italic, symbols and graphical elements together, test the mouse to select the functions of these elements;

  15.3. Test Methods Summary

    Applications: more than one function at the same time is in operation;

    Test method: from point to face, focusing on testing a function, other functions may be connected to the features provided with this test;

    Testing knowledge base: fully grasp the needs of the software under test, for correlation between the measured functional dependence has mastered before the test, in addition to the need to share data has been mastered;

16. The file system is overloaded

  16.1 Defect Causes

      Developers may forget to write code to handle the full state of the file system, ignoring the operating system API error checking code such as CreateFile, WriteFile, etc., there is no such code, when displaying full state of the file system API calls will fail, software it will collapse without any warning of the case;

  16.2. How to find this kind of problem

      Creating full capacity or near-full capacity of the file system, and then enforced through a variety of input or output file system access operation; or open enough files, create a backup copy will be forced to open a file, thus occupying double the storage space this operation reaches a certain level, the system capacity will be reached, so the application can test the ability to handle file system overload state (generally realized by a disk quota);

  16.3. Test Methods Summary

    Applications: larger systems, run-time requires a larger space;

    Test Method: compulsory full-capacity disk system capacity is less than or equal to the required capacity of the software under test, the test run with the test tool simulation software or disk running condition;

    Testing knowledge base: fully grasp the needs of the tested software, the ability to understand the tested software handle the overload state of the file system;

17. The medium of busy or not available

  17.1 Defect Causes

      When multiple applications to concurrently access the hard disk (or other memory), an operating system to provide multiple service requests will slow down, and must be programmed to handle these delay applications, when the delay becomes long, these errors do not application response will be an error;

  17.2. How to find this kind of problem

      They are open by starting the large number of applications, and save the file to force the file system processing busy; or download a lot of files at the same time can also make the background crowded; check the software under test can correctly handle this case, the application should give an error message or wait for instructions, prompts the user being processed;

  17.3. Test Methods Summary

    Applications: running applications need to consume a lot of memory or require additional software to run simultaneously run;

    Test Method: Start the large number of programs or simulated conditions using the disk test tools;

    Testing knowledge base: fully grasp the needs of the software under test, understand the requirements of the system tested software is running;

18. The medium of damage

  18.1 Defect Causes

      The medium may cause damage to the operating system returns an error code, the error code is not processed in the application program;

      All operating systems can not detect this error, the operating system has its own error or damaged media damaged part of the operating system;

  18.2. How to find this kind of problem

      Use a damaged media, for example, scratches, dust, magnetic interference. Check the application error handling capability, the application can be processed for error or problem will tell the user, and to ensure that user data files are not lost, for the damage;

  18.3. Test Methods Summary

    Applications: Applications higher security requirements, higher requirements for disaster recovery;

    Test Method: The method for testing the application of the actual damage to the media;

    Testing knowledge base: fully grasp the needs of the software under test, understand the requirements of the system tested software is running;

19. The file name is not valid

  19.1 Defect Causes

      The operating system itself has its own file naming convention, for example, Dos 8.3 format. In Windows, file names can not exceed 255 characters, and file names can not contain / \: <> * | these eight characters, as well as AUX, COM1, COM2, COM3, COM4, ​​CON, LPT1, LPT2, LPT3,? LPT4, NUL and PRN these operating system reserved words;

      Developers use the same rule does not manage the file name in the application, when the application and the file name of the operating system naming rules are inconsistent, the problem will occur;

  19.2. How to find this kind of problem

      Save the file as the file name of the operating system does not allow, for example, the file name contains a / \: <> * | these eight characters, to test whether the application is allowed to enter a file name containing these characters;?

      Some applications do not allow the use of the input file name, for example, the use of long, containing special characters, the characters may interact as a file name, the application checks whether the identification document;

  19.3. Test Methods Summary

    Applications: All applications involving almost need to enter a file name functions;

    Test method: Enter the operating system does not allow file names and file name of the application does not allow the use of;

    Testing knowledge base: fully grasp the needs of the software under test, to understand the operating system and application requirements for file names;

20. Change file access permissions

  20.1 Defect Causes

      In the operating system can set different users have different access privileges (e.g., write, read only, etc.) for different files. The programmer must consider access to files in function to access the file, such as file access checks before each file is written. If not checked, it will cause an error. In addition,

      If the file access failure, the programmer must have a correct error code to ensure that the program can catch the error generated correctly;

  20.2. How to find this kind of problem

      Two applications open and close the same file. For example, different versions of the same application installed on the same machine, open and close the same file, or try to open another program open file in an application in a different version of the application, which may cause file access conflicts of competence;

      Open a file, modify the file permissions in the operating system. Some operating systems allow users to control high authority general user has open files;

  20.3. Test Methods Summary

    Applications: Applications require the file read and write operations;

    Test Method: modify file access or use a low-privileged user to access files;

    Testing knowledge base: fully grasp the needs of the software under test, understand the required permissions to read and write files;

21. The contents of the file damage

  21.1 Defect Causes

      Developers write code to read and write files, they also write code to call the system API to get the file pointer, and open and close the file. For some reason, these systems fail or API returns an exception return value. If developers do not have to write code to verify the returns expected return value, the application can not be processed due to abnormal failed;

  21.2. How to find this kind of problem

      Hand corrupt files. A full file from an application that has been created begin editing it, changing the file format and content;

      Use testing tools. Simulated CRC (cyclic redundancy check) error, or forced file API returns an invalid return code;

  21.3. Test Methods Summary

    Applications: need to check the file format and content of the application;

    Test Method: corrupted files or hand tool using a simulation test CRC error;

    Testing knowledge base: fully grasp the needs of the software under test, understand file permissions needed to read and write;

Disclaimer: This article is part of the contents or possible sources of finishing from the network, if infringement, please contact deleted

Guess you like

Origin www.cnblogs.com/turbogirllu/p/12069169.html