How to do a good test? (3) Functional Testing (FT)

1. Detailed introduction to functional testing:

Functional Testing (FT) is a software testing method that aims to verify whether the system's functions work normally according to the requirements specification or the way expected by the user. It focuses on the overall behavior of the system to ensure correct interaction and integration between various functional modules and components.

2. Usage scenarios:

Functional testing is suitable for the following situations:

  • For the web and mobile terminals of the online shopping system, functional testing can be used to verify the normal working of each page, module and function.
  • Functional testing can simulate users' actual usage scenarios to ensure that the system can correctly respond and handle user operations under various circumstances.
  • It helps discover and fix functional defects to provide users with a satisfactory shopping experience.

3. Common technologies and tools:

When conducting functional testing of online shopping systems, you can use the following common technologies and tools:

  • Test automation framework: such as Selenium, Appium, etc., used to automate functional testing of web pages and mobile terminals.
  • Manual testing tools: such as browser developer tools, mobile device emulators, etc., used to manually perform functional testing and check the status of pages and functions.
  • Data-driven testing: Use test data to drive the execution of test cases to cover different test situations and data combinations.

4. Specific implementation methods:

Here is how functional testing is generally implemented:

  • Requirements analysis: Understand the functional requirements and user expectations of the system to determine the scope and focus of functional testing.
  • Test plan: Develop a functional test plan, including test goals, test scope, test environment, test data, etc.
  • Test case design: Design functional test cases based on functional requirements and user scenarios, including input operations, expected results, boundary conditions, etc.
  • Test environment preparation: Build a suitable test environment, including web and mobile browsers, equipment, databases, etc.
  • Execute functional testing: Execute the designed functional test cases, including manual testing and automated testing, and record the actual results.
  • Problem management: Record and track the discovered functional defects or anomalies to ensure that the problems are repaired in a timely manner.
  • Test report: Generate functional test report, including test results, problem statistics, test coverage and other information.

5. Examples of test case design:

The following are three examples of functional test case design, targeting a certain functional module in the online shopping system.

5.1.Test case 1:

  • Test case name:add_to_cart_test
  • Test goal: Verify that adding items to the shopping cart works properly.
  • Test prerequisites: The user has logged in and the product details page has been opened.
  • Test steps:
    1. Click the "Add to Cart" button on the product details page.
    2. Check whether the added product information is displayed on the shopping cart page.
  • Expected results: The expected product is successfully added to the shopping cart, and the shopping cart page displays the added product information.
  • Actual results: Record the actual product information displayed on the shopping cart page.
  • Judgment of test results: Compare actual product information with expected results to see if they are consistent.
  • Note: You can consider adding multiple products, adding existing products and other different situations.

5.2.Test case 2:

  • Test case name:checkout_process_test
  • Test goal: Verify that the checkout process works smoothly.
  • Test prerequisites: The user is logged in and there are products in the shopping cart.
  • Test steps:
    1. Click the "Go to Checkout" button on the shopping cart page.
    2. Enter the shipping address, payment method and other relevant information.
  1. Click the "Confirm Payment" button.
  • Expected results: The expected order is successfully generated and jumps to the order confirmation page.
  • Actual results: Record the actual information on the order confirmation page.
  • Judgment of test results: Compare the actual information with the expected results to ensure that the order generation and page jump are correct.
  • Note: Different situations such as entering an invalid address and selecting an invalid payment method can be considered.

5.3.Test case 3:

  • Test case name:search_product_test
  • Test goal: Verify that the product search function works properly.
  • Test prerequisites: The user has logged in and entered the homepage of the website.
  • Test steps:
    1. Enter a keyword, such as "mobile phone," into the search box.
    2. Click the search button or press the Enter key.
    3. Check whether the search results page displays a list of products that match the keyword.
  • Expected results: The expected search results page displays a list of products containing the keyword "mobile phone".
  • Actual results: Record the actual product listing displayed on the search results page.
  • Judgment of test results: Compare the actual product list with the expected results.
  • Note: Different situations such as entering invalid keywords and empty search results can be considered.

Guess you like

Origin blog.csdn.net/holyvslin/article/details/133309947