170
社区成员




Which course does this assignment belong to | 2401_Mu_SE_FZU |
---|---|
Where is the requirement for this assignment | Fifth Assignment——Alpha Sprint |
Team name | Smart Fishpond Access |
The goal of this assignment |
1. Claim Stress Test Method 2. Conduct Web Stress Test 3. Conduct API Stress Test |
Other references | Google Core Web Vitals |
Content
Stress testing is conducted using the black box testing method. In black box testing, the test object is treated as a "black box", meaning that testers do not consider the logical structure or internal characteristics of the program. Instead, they focus solely on whether the program's functions align with its function description as outlined in the requirements specification. This approach allows testers to simulate real user behaviour without caring the system's coding details. It also enables the evaluation of web page performance under stress, enhances testing efficiency, and ensures that the system can operate reliably in various complex environments. In this report, we utilize testing tools to carry out stress tests on both website and APIs.
Testing Tool: Apache Benchmark
Taking the homepage of the website, http://softwareproject.moyu-home.cn/index.html, as an example, the testing result is shown below.
Step 1 Create a new request
Open Apache Benchmark and create a new request.
Step 2 Set request parameters
Enter the following command to perform a stress test
ab -n 1000 -c 10 http://softwareproject.moyu-home.cn/index.html
Step 3 Send the request and verify the response
View the results
Total number of requests: 1000
Concurrency Level: 10
Fig. 1 Webpage stress test result
As Fig. 1 shown, during our stress testing of a web page, we utilized Apache Benchmark to conduct 1,000 requests with a concurrency of 10. The test duration was 24.577 seconds, and all requests were successful without any failures. A total of 7,081,000 bytes were transferred, out of which 6,802,000 bytes were HTML content.
The test results indicate that we processed an average of approximately 40.69 requests per second, with an average response time of 245.774 milliseconds. The minimum connection time recorded was 9 milliseconds, the maximum was 1,035 milliseconds, and the average connection time was 24 milliseconds. In analyzing the response times, we found that 50% of requests were completed within 231 milliseconds, 95% were completed within 280 milliseconds, and the longest request took 1,250 milliseconds. Taking Google's Core Web Vitals as a standard for measuring web performance and user experience, the server has demonstrated good performance under this load, showing excellent stability and efficiency.
Testing Tool:ApiPost
Testing Interface | Method | Test Time | Test Content | Test Personnel |
---|---|---|---|---|
Login | POST | 28/11/2024,23:01:32 | Log in | 832201313 |
Change | POST | 28/11/2024,23:01:34 | Forgot password | 832201313 |
Register | POST | 28/11/2024,23:03:33 | Sign in | 832201313 |
Verify | POST | 28/11/2024,23:03:37 | Verification code | 832201313 |
getDeviceLocation` | GET | 28/11/2024,23:03:39 | Obtain device location | 832201313 |
getWord | GET | 28/11/2024,23:04:07 | Speech recognition | 832201313 |
getAnswer | GET | 28/11/2024,23:04:10 | Get Response | 832201313 |
newDevice | POST | 28/11/2024,23:04:13 | Add new device | 832201313 |
data | GET | 28/11/2024,23:04:15 | Get data | 832201313 |
warnLog | GET | 28/11/2024,23:04:20 | Warning history | 832201313 |
push | POST | 28/11/2024,23:04:21 | Upload Data | 832201313 |
The result of the getDeviceLocation interface is described here as an example.
Step 1 Create a new request
Open the postman first, and then input port of the URL in the address bar, for example (http://json.moyu-home.cn/getdevicelocation), select request method (such as GET, POST).
Step 2 Set request parameters
Set the Concurrency Level 100 mode setting to select the press test duration. Set the time to 10s.
Step 3 Send the request and verify the response
Click the Stress Testing button, send the request, and then view the results.
Fig. 2 Test parameters
Fig. 2 illustrates the parameters setting of this test. Concurrency Level is 10. Test Time is 10s.
Fig. 3 API stress test result
Fig. 3 indicates that the system processed a total of 1,978 requests within 10 seconds, achieving a 100% success rate. The maximum response time reached 1,037 milliseconds, while the average response time was 492.115 milliseconds. Additionally, 50% of the requests had a response time of less than 469 milliseconds, and 95% of the requests were responded to in under 673 milliseconds.
Overall, the system demonstrates stable performance under high concurrency, with response times generally falling within an acceptable range. However, the response time still has room for optimization, which will be shown in the upcoming beta testing.