Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Software testing method

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

1 basis of software testing

With the rapid development of information technology, software products have been applied to all fields of society, and the quality of software products has naturally become the focus of common concern. Both software producers and software users live in a competitive environment. In order to occupy the market, software developers must take product quality as one of the important goals of enterprises, so as to avoid being eliminated in the fierce competition. In order to ensure the smooth completion of their business, users certainly hope to choose high-quality software. Poor quality software products will not only greatly increase the maintenance difficulty of developers and the cost of users, but also lead to other liability risks, resulting in a decline in the credibility of the company, and then impact the stock market. The use of quality-defective software in some key applications (such as civil aviation booking system, bank settlement system, securities trading system, automatic flight control software, military defense, nuclear power plant safety control system, etc.) can also have disastrous consequences.

Software crisis used to be the hottest topic in the software industry and even the whole computer industry. In order to solve this crisis, software industry staff, experts and scholars have made a lot of efforts. Now people have gradually realized that the so-called software crisis is actually only a situation, that is, there are errors in the software, which lead to the cost, progress and quality of software development out of control. Mistakes are the attributes of the software and cannot be changed. Because the software is done by people, all the work done by people will not be perfect. The problem is how to avoid errors and eliminate errors that have already occurred, so as to make the error density in the program as low as possible.

1.1 the concept of software testing

Software testing is the process of executing a program in order to find errors. In other words, software testing is to carefully design a batch of test cases (that is, input data and its expected output results) according to the specifications of each stage of software development and the internal structure of the program, and use these test cases to run the program. the process of finding program errors.

Software testing is the ultimate review of software requirement analysis, design specification and coding before the software is put into operation, which is the key step of software quality assurance.

1.2 purpose of software testing

Based on different attitudes, there are two completely different testing purposes. 1. From the user's point of view, it is generally hoped that through software testing, the hidden errors and defects in the software can be exposed to consider whether the product is acceptable or not. two。 From the point of view of software developers, they hope that testing becomes a process that shows that there are no errors in software products, verifies that the software has correctly realized the requirements of users, and establishes people's confidence in software quality.

2 test cases

2.1 the concept of test cases

Test case refers to the description of the testing task of a specific software product, reflecting the test scheme, method, technology and strategy.

The content includes: test goal, test environment, input data, test steps, expected results, test script and so on, and form a document.

2.2 Classification of test cases

According to the specific types of problems and test requirements involved in the testing process, the test cases can be divided into the following:

1. Functional test case

two。 Interface test cases: suitable for interface testing in all test phases

3. Data processing test cases: suitable for data processing tests in all test phases

4. Process test cases: applicable to all procedural tests

5. Installation test cases: applicable to all installation tests

2.3 Governance of test cases

1. Write use cases: test engineers write test cases according to requirements specification, summary design, specific design and other documents.

two。 Use case review: in principle, like a program, a use case can only be passed after many modifications, and it is usually carried out once in the actual work.

3. Use case modification: after the review, you need to make changes according to the comments of the review, and there is usually no longer a review after the revision.

4. Use case: execute the test case and record it in the test case execution report.

5. Use case upgrade / maintenance: as software products are constantly modified and upgraded, the corresponding use cases also need to be upgraded and maintained. For the same project, continuous maintenance can be carried out according to changes in requirements; if it is a product, the maintenance of use cases is more important to correspond to the version of the use case and the product one by one.

2.4 preparation and use of test cases

1 Design test cases

Each specific test case will include the following specific information: programmer, approver, preparation date, version, use case type, design specification number, use case name, input description, expected results (including criteria), environmental requirements, remarks, etc.

1. "Test case name" can be a functional description that does not involve specific modules, such as "date format", "non-empty check", and so on.

two。 "input description" is the data accepted by the function module or various manipulation descriptions, such as "input illegal date format" and so on.

3. "expected result" is the normal output description that the module should have after accepting the input, such as "prompt the user to modify" and so on. It is expected that the result should correspond to the input description one by one.

4. Test cases are used to guide the execution of manipulations, but some unexpected manipulations can also lead to program errors, which are called unexpected manipulations, and can be reported first and then supplemented later.

5. The design of test cases should consider versatility and simplicity.

Test requirement

Software testing requirements are the basis for the development of test cases. The more specific and accurate the decomposition of test requirements is, the more clear the content of the tasks to be carried out is, and the more helpful it is to the design quality of test cases. The specific test requirement is also an important index to measure the test coverage. The test requirement is to calculate the denominator of test coverage. Without specific test requirements, it is impossible to calculate test coverage effectively.

The software test execution phase is composed of a series of different test types, and each test type has its own specific test objectives and supporting technology. each test type only focuses on testing one or more characteristics or attributes of the test target, and the correct test type can get twice the result with half the effort.

The existing software test analysis technology is not very mature, and the method used in the analysis of test requirements and test types is mainly based on experience, which depends on the test experience of the test designer. The test requirements and test types derived from this method often lead to inadequate test case design, low test coverage, weak test purpose, easy omission and other defects.

It can be seen that how to make a detailed analysis of the test requirements and clarify the type of test when the test is executed is an urgent problem to be solved.

In view of this, the main purpose of this method is to provide an analysis method of software testing requirements, which can obtain test requirements conveniently and in detail, and clarify the test types that need to be implemented during test execution.

1 the method of testing requirement analysis

A) list the testable development requirements in the software development requirements

B) for each development requirement listed in step a), form a testable hierarchical description of the test requirement

C) for each test requirement formed in step b), the software product quality requirements are determined from the software internal / external quality model defined in GB/T. 1-2006 "Software Engineering Product quality part 1: quality Model".

D) for the quality requirements identified in step c), analyze the types of tests that need to be implemented during test execution

E) establish the test requirements tracking matrix to manage the test requirements.

3 Software life cycle

Software life cycle (SDLC,SystemsDevelopment Life Cycle) is the life cycle from the generation of software to scrappage, during which there are stages of topic definition, feasibility analysis, overall description, system design, coding, debugging and testing, acceptance and operation, maintenance and upgrading to abandonment, etc. This time-divided thinking method is an ideological principle in software engineering, that is, step by step and step by step. Each stage should be defined, worked, reviewed, and documented for communication or reference, so as to improve the quality of the software.

3.1 definition and planning of problems

This stage is a joint discussion between the software developer and the demand side, mainly to determine the software development goal and its feasibility.

3.2 demand Analysis

In the case of determining the feasibility of software development, this paper makes a specific analysis of the various functions that the software needs to achieve. The requirements analysis phase is a very important stage, and if done well, it will lay a good foundation for the success of the entire software development project. "the only constant is the change itself." The same requirements are constantly changing and deepening throughout the software development process, so we must develop a requirements change plan to cope with this change in order to protect the smooth progress of the whole project.

3.3 Software design

In this stage, according to the results of requirement analysis, the whole software system is designed, such as system framework design, database design and so on. Software design is generally divided into overall design and specific design. Good software design will lay a good foundation for software programming.

3.4 Program coding

This stage is to convert the results of software design into program code that can be run by the computer. In the program coding, it is necessary to develop a unified, standard writing specification. In order to ensure the readability and maintainability of the program and improve the running efficiency of the program.

3.5 Software testing

After the completion of the software design, it is necessary to go through rigorous testing to find the problems existing in the whole design process of the software and correct them. The whole testing process is divided into three stages: unit testing, assembly testing and system testing. There are two main testing methods: White-box testing and black-box testing. In the process of testing, it is necessary to establish a specific test plan and test strictly according to the test plan, so as to reduce the arbitrariness of the test.

3.6 Operation and maintenance

Software maintenance is the longest lasting phase in the software life cycle. After the software development is completed and put into use, due to various reasons, the software can not continue to meet the requirements of users. In order to extend the service life of the software, the software must be maintained. Software maintenance includes two aspects: error correction maintenance and improvement maintenance.

3.7 Life cycle model

Waterfall model, rapid prototyping model, iterative model.

4 Test methods (19)

With the development of software testing technology, testing methods are more diversified and targeted; choosing appropriate software testing methods can make us get twice the result with half the effort. Here are some common software testing methods:

4.1beta test _ Beta test

Beta testing is a test carried out by multiple users of the software in the actual use environment of one or more users. Developers are usually not at the test site, and Beta testing cannot be done by programmers or testers.

4.2a Test _ Alpha Test

Alpha testing is carried out by a user in the development environment, or it can be a controlled test carried out by users within the company in a simulated actual operating environment. Alpha testing can not be done by programmers or testers of the system, but generally by the ultimate user or other staff.

The testing of the application system when the system development is nearing completion. After testing, there will still be a small number of design changes.

4.3 portability testing

It refers to testing whether the software can be successfully ported to a specified hardware or software platform.

4.4 user interface testing-UI testing

User interface, English is User Interface. Refers to the visible appearance of the software and the underlying parts (menus, dialogs, windows, and other controls) that interact with the user.

User interface testing refers to testing whether the style of the user interface meets customer requirements, whether the text is correct, whether the page is beautiful, whether the combination of text and pictures is perfect, whether the manipulation is friendly, and so on. The goal of UI testing is to ensure that the user interface provides users with appropriate access or browsing functions by testing the functionality of the object. Ensure that the user interface meets company or industry standards. Including user-friendly, user-friendly, easy-to-manipulate testing.

4.5 smoke test

The name of the smoke test can be understood to mean that it takes a short time and only one bag of cigarettes is enough. Some people think that it is a visual analogy to the basic function check of the new circuit board. After any new circuit board is welded, first power-on check, if there are design defects, the circuit board may be short-circuited and the board will smoke.

4.6 Random Test

Random tests do not have written test cases, record expected results, checklists, scripts, or instructions. The main purpose of this paper is to spot check the function and performance of the software according to the experience of the tester. Random testing is an important supplementary means to perform use case testing according to the test specification, and it is an effective way and process to ensure the integrity of test coverage.

4.7 White Box Test-structure Test-Logic driven Test

White-box testing treats the test object as an open box. When using the white box testing method for dynamic testing, it is necessary to test the internal structure and processing process of the software product, and there is no need to test the function of the software product.

The coverage standards of white-box testing are: logical coverage, circular coverage, basic path testing. The logical coverage includes sentence coverage, decision coverage, conditional coverage, decision / conditional coverage, conditional combination coverage and path coverage.

4.8 Black Box Test-functional Test-data driven Test

Black box testing is the testing of software according to the specifications of the software, which does not take into account the internal operation of the software, so the software is like a black box to users.

From the user's point of view, software testers find defects in the software by inputting and observing the output results of the software, but do not care about how the program is implemented.

4.9 regression test

A rollback test refers to retesting a previous test after a change has occurred to ensure the correctness of the change. In theory, when a new version of the software is produced, it needs to be tested back to verify that the errors previously found and fixed appear again on the new version of the software.

4.10 dynamic testing

Dynamic testing refers to running the software to verify the dynamic behavior of the software and the correctness of the running results. According to the stage and function of dynamic testing in the process of software development, dynamic testing can be divided into the following steps: 1, unit test 2, integration test 3, system test 4, acceptance test 5, regression test

4.11 Unit Test

A unit test is the smallest test; to test a function or block of code. It is typically done by programmers rather than testers, because it requires knowledge of internal programming and coding details. This work is not easy to do unless the application system has a well-designed architecture; it may also need to develop test driver modules or test kits

4.12 Integration testing

Integration testing refers to the joint testing of various parts of an application system to determine whether they can work together without conflict. Parts can be code blocks, stand-alone applications, client-side or server-side programs on the network. This type of testing is particularly relevant to client servers and distributed systems. Before general integration testing, unit testing needs to be completed.

4.13 system testing

System testing is a black box test based on the overall requirements specification of the system, which should cover all the joint components of the system. System testing is a test for the whole product system, the purpose of which is to verify whether the system meets the definition of the requirement specification, and to find out the areas that do not meet or contradict the requirement specification.

4.14 stress test

Stress testing is a basic quality assurance behavior, and it is a part of every important software testing work. The basic idea of stress testing is simple: not to run manual or automatic tests under normal conditions, but to run tests under the conditions of a small number of computers or lack of system resources. Resources for stress testing usually include internal memory, CPU availability, disk space, network bandwidth, and so on. Concurrency is generally used for stress testing.

4.15 performance test

Performance testing is a common term used when alternating load and force testing. The ideal "performance test" (and other types of tests) should be defined in the requirements document or in the quality assurance, test plan. Performance testing generally includes load testing and stress testing.

4.16 compatibility Test

Compatibility testing is to test the performance of software in a specific hardware / software / operating system / network environment. Upward compatibility, downward compatibility, software compatibility, hardware compatibility. There are many things to consider about the compatibility of the software.

4.17 Boundary condition test

A black box testing method, which is a supplement to the equivalence class analysis method. According to long-term testing experience, a large number of errors occur on the input or output boundaries. Therefore, more errors can be found by designing test cases for various boundary situations.

4.18 static test

Static testing refers to the part of the test that does not run, such as the test product specification, which is reviewed and reviewed. Static testing means to check the correctness of the program by analyzing or checking the syntax, structure, process and interface of the source program without running the program itself. Static testing finds out deficiencies and suspicions through the analysis of the static characteristics of the program, such as mismatched parameters, inappropriate loop nesting and branch nesting, unacceptable recursion, unused variables, null pointer references and suspicious calculations. Static test results can be used for further error checking and provide guidance for test case selection.

4.19 equivalence Partition Test

Equivalence partition testing is a technique for designing test cases based on equivalence classes. It is one of the typical methods of black box testing, by dividing all the possible input data fields of the program under test into several parts. Selecting a few representative data from each part as test cases can effectively reduce the number of tests, greatly improve the efficiency of software testing, and shorten the software development cycle. The purpose of equivalent class partition testing is to get better test results with a small amount of representative data in the case of limited test resources.

Effective equivalence class and invalid equivalence class: the data in the effective equivalence class represents a set of correct meaningful data that meets the requirements document. Invalid equivalence classes are just the opposite.

Here, there are still many software testing methods, and only some of the most commonly used and common testing methods are listed here. According to the different stages of the software life cycle, choose the corresponding testing methods to improve the quality of software products, so that its imperfections can be minimized to meet the needs of users as much as possible, so as to achieve better value of software products.

Note: first of all, which tests can be divided into different division rules?

1. According to whether or not to use automated tools are divided into: manual testing, automated testing

two。 According to the quality of the software, it is divided into functional testing, reliability testing, ease of use, maintainability testability testing, portability testing.

3. According to the stage, the test can be divided into: unit test, inheritance test, system test.

4. According to whether you care about the code: black box testing, white box testing

1. Basic concept

What is manual testing?

Manual testing is for people to input use cases one by one, and then observe the results, which corresponds to machine testing. It relies on people to find defects, generally using black box testing, and can be used in integrated test system testing.

What is functional testing?

Functional testing, also known as black box testing or data-driven testing, only needs to consider each function, not the internal structure and code of the software. Generally, it is triggered by the interface and architecture of the software, the test cases are written according to the requirements, and the input data is evaluated between the expected results and the actual results, so as to make the product meet the needs of users.

What is a performance test?

Performance testing is through automated testing tools to simulate a variety of anomalies, peak and abnormal load conditions to test the performance of the system.

Both load testing and stress testing belong to performance testing.

Through the load test, determine the performance of the system under various workloads, and the goal is to change the performance indicators of the system when the load test increases gradually.

Stress testing is to determine the bottleneck or unacceptable trust point of a system to obtain the maximum level of service provided.

What is automated testing?

Automated testing is a process of transforming human-driven testing into machine execution. Usually, after the test case has been reviewed, the tester executes the test step by step according to the procedures described in the test case. The actual results are compared with the expected results.

Add:

1. Prerequisites for automated testing

(1) Software requirements do not change frequently.

(2) the project cycle is long enough.

(3) Automation scripts can be reused.

two。 Prerequisites for automated testing

(1) automatic testing requirement analysis

(2) the construction of automated testing framework.

Public environment

Common method

Common object

test data

(3) automatic script writing.

(4) Test and run of script

The difference between several tests

1. The difference between manual testing and functional testing

Manual testing belongs to functional testing, which is divided according to whether or not to use automated tools, and functional testing is divided according to the six characteristics of the quality model.

two。 What is the difference between manual testing and automated testing?

Manual testing is a traditional testing method, which is manually written by testers, which requires a large amount of work and repetition, and regression testing is difficult to achieve, while automated testing uses software testing tools to achieve all or part of the testing work, management, design, execution of reports, saves a lot of testing overhead, and can complete some functional tests that cannot be completed.

3. What is the difference between functional testing and performance testing?

Functional testing only verifies the requirements, finds some errors in the functional flow or unfriendly interface, and does not involve the internal structure and code of the software, while performance testing mainly tests the pressure that the system can withstand, a large amount of data, processing speed and other aspects, is to check the application from the internal area of the program, such as concurrent testing, stress testing, etc.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report