Location>code7788 >text

ChatGPT Best Practices for Test Case Generation (IV)

Popularity:534 ℃/2024-12-19 20:48:54

 

An external review of test cases should also normally be conducted. Inform project team members of the location where the completed functional and security test case sets based on Baidu's keyword search business are stored. It is necessary to reserve a certain amount of time for the project team's R&D and product personnel to read them, so as not to take up too much time to familiarize themselves with the contents of the relevant test cases in the project team's test case review meeting. In the project team test case review meeting, the relevant personnel actively review the test cases and put forward the following points.

1) For the test cases TC008, TC019 and TC023, the product staff clarified the characters of the search input box, i.e., whether it is Chinese or English characters, the maximum number of input characters is 100, whether it is Chinese characters, English characters or a mixture of Chinese and English characters, the front and back ends need to do the check, if the front-end input is more than 100 characters, the first 100 characters will be automatically intercepted. If the front-end input exceeds 100 characters, the first 100 characters will be automatically intercepted.

2) For the test case TC016, the product staff clarified the requirements, i.e., the SQL injection statement will be filtered and processed as ordinary text, and at the same time, the back-end developers also clarified the existence of users table.

3) For test case TC023, the product staff clarified the requirement that there is no limit to the number of search results.

 

Limited to space, the author only lists a few review comments, the test team for the product staff and R & D staff put forward the review of the comments made by the relevant test cases to amend the problem, the formation of the new Baidu keyword search business based on the functionality of the security test case set, as shown in Table 3-2.

a meter (measuring sth)3-2 New set of functional and security test cases based on Baidu's keyword search business

Test No.

test objective

pre-conditions

test step

Expected results

TC001

Test for legal keywords in search input box

Users open Baidu search page

1. Enter a valid keyword in the search input box (e.g. "test")

2. Click on the search button

Displays the search results page.

TC002

Test for multiple legal keywords in search input box

Users open Baidu search page

1. Enter multiple valid keywords in the search input box (e.g. "software testing methods")

2. Click on the search button

Displays the search results page.

TC003

Test for search input box containing special characters

Users open Baidu search page

1. Enter special characters in the search input box (e.g. "#$%^")

2. Click on the search button

Displays an error message alert.

TC004

Basic Keyword Search - No relevant results

Users have entered the Baidu search page

1. A keyword is entered into the search box, but the system is unable to find relevant results (e.g., "unknown keyword").

2. Click the Search button.

Display the appropriate notification to the user (e.g. "No relevant results found").

TC005

Basic Keyword Search - Cancel Search

Users have entered the Baidu search page

1. Enter a valid keyword in the search box (e.g. "test").

2. Cancel the search operation before it is executed.

The search operation is canceled and the use case ends.

TC006

Basic Keyword Search - Multiple Searches

Users have entered the Baidu search page

1. Enter a valid keyword in the search box (e.g. "test").

2. Click the Search button.

3. Repeat steps 1 and 2 several times.

Search results are displayed correctly and search history is retained.

TC007

Basic Keyword Search - Boundary Value Testing

Users have entered the Baidu search page

1. Enter a very small keyword (e.g., "a") in the search box.

2. Click the Search button.

Displays a page of search results related to the keyword.

TC008

Basic Keyword Search - Boundary Value Testing

Users have entered the Baidu search page

1. Enter an extremely long keyword (exceeding the character limit, e.g., "a" * 101) in the search box.

2. Click the Search button.

1. The search box automatically intercepts the first 100 characters. 2. Display the first 100 characters of the search results page. 3.

TC009

Search Suggestion Display Test

Users open Baidu search page

Enter some of the keywords in the search input box (e.g. "measure")

Displays a list of search suggestions.

TC010

Search suggests multiple partial keyword tests

Users open Baidu search page

Enter multiple partial keywords in the search input box (e.g. "software measurement")

Displays a list of search suggestions.

TC011

Validation against search results

The user enters a legitimate keyword and clicks the search button

Check the search results page

Displays relevant search results.

TC012

Next Page Button Test

The user enters a legitimate keyword and clicks the search button

Click on the Next Page button

Displays the next page of search results.

TC013

Previous Button Test

The user enters a legitimate keyword and clicks the search button

Click on the previous page button

Displays the search results from the previous page.

TC014

Sort Tests by Relevance

The user enters a legitimate keyword and clicks the search button

Select Sort by Relevance

Results are sorted by relevance.

TC015

Sort Tests by Time

The user enters a legitimate keyword and clicks the search button

Select to sort by time

Results are sorted by time.

TC016

SQL Injection Attack Test

User enters malicious SQL query in search input box (e.g., "'; DROP TABLE Users --")

Checking search results or page behavior

Filters and displays plain text.

TC017

XSS Attack Test

The user enters the keyword containing the XSS script in the search input box (e.g., "<script>alert('XSS Attack')</script>")

Checking search results or page behavior

Filters and displays plain text.

TC018

Minimum Boundary Value Test for Search Input Box

Users open Baidu search page

Enter a space in the search input box

Displays search suggestions or search history.

TC019

Maximum boundary value test for search input box

Users open Baidu search page

Enter a long string in the search input box that exceeds the character limit (e.g., 101 characters, Chinese characters, or a mix of both).

Displays the first 100 characters of the search results page.

TC020

Search for suggested minimum boundary value tests

Users open Baidu search page

Enter a character in the search input box (e.g., "a").

Displays a list of search suggestions.

TC021

Search for suggested maximum boundary value tests

Users open Baidu search page

Entering multiple characters in the search input box is not enough to display search suggestions (e.g.: "abcde")

The list of search suggestions is not displayed.

TC022

Minimum Boundary Value Test for Search Results

The user enters a legitimate keyword and clicks the search button

Check the search results page

Displays relevant search results.

TC023

Maximum boundary value test for search results

The user enters a legitimate keyword and clicks the search button

Enter a keyword so that the number of results exceeds the limit (e.g., more than 1,000 results).

Displays the search results page.

Test case review and improvement is an ongoing process. As projects evolve, requirements change and new features are added, test cases must be constantly updated and optimized. This requires not only a high degree of agility and adaptability on the part of the test team, but also an in-depth understanding of the business and technology.