One: Unit test
System description
(1) Functional modules: Reader management, circulation management, statistical management, query management. (2) Reader management function is mainly the basic information of readers;
(3) The functions of circulation management include library management, book management, books reservation and book Status Management; (4) Statistical management functions include collection statistics of all kinds of books and books that have been lent and borrowed books
Statistics
(5) The query management function includes the Reader information Inquiry and the book Information Inquiry and so on.
Two: Test strategy
test strategies include user interface testing, software functional testing, and software reliability testing. User Interface Testing:
Test the correctness of the output information by interacting with the user, such as entering appropriate information, including correct information and error messages.
Software function test: To test the function of the system in accordance with the user's requirements.
Software reliability test: By simulating the actual function of the library, the functional reliability test of the system is carried out in different configuration environments, and the functions of the library management system can be checked.
Three: Performance test
In the Java EE Project test, server performance is a focus of testing, and the server's flaw is also a multi-zone. Common phenomena such as CPU load in the constant growth, memory often overflow, system performance gradually decreased or even crashed. These problems are more easily exposed in the actual product line. In this regard, Jprofiler is a good test tool that monitors the operation and performance of the JVM with real-time monitoring of the system's CPU, memory, and thread.
Design Test Cases
A, the configuration of the monitoring side
Open Jprofiler, and then click Start Center to pop up the dialog box. Select the new Session option, click New Remote intergration, and click Start.
Select the on a remote computer button at platform of the remote computer: Select Windows X86.
b, the configuration of the monitored side
After modifying the server startup file, set java_opts in the Startup.bat file under Tomcat's Bin folder, as follows: Set java_opts=%java_opst%
-agentpath:f:\jprofiler_windows_7_0\jprofiler7\bin\windows\jprofilerti.dll=port=8849 Add the PATH environment variable, Add the previously copied environment variables in path.
Four: Run the test
Start Startup.bat. The Tomcat window appears prompting for the status of the connection, the monitoring side selects the configured session in Start Center, clicks the Start button, and accesses the remote service;
Observe the 5 views provided by Jprofiler.
Analyze test results
Memory Profiling: The memory view portion of Jprofiler provides a dynamic memory usage view and a view that displays information about memory allocation status. All views have several aggregation layers and are able to display existing objects and objects that are garbage collected.
Heap traversal: You can take a snapshot of the heap's state in the Jprofiler heap Walker, and you can choose to find objects of interest.
CPU Profiling: Jprofiler provides different ways to record the number of accesses to optimize performance and detail. Threads and thread groups can be selected by all views, and all views can be aggregated into different layers, such as methods, classes, packages, and so on.
VM Remote Sensing Survey technology: observing the internal state of the JVM, Jprofiler provides the following different views of the remote Sensing survey. Design Test Cases
The Selenium recording feature is implemented by the Selenium IDE. Launch the Firefox browser and click on the Tools menu in the menu bar to see the Selenium IDE submenu. Select the Selenium IDE command, pop-up window. At this point, start recording script, there is a red dot in the upper right corner, the press indicates that the recording script is being recorded, directly manipulate the browser when recording, the IDE automatically records the operation.
Writing test Scripts
Record the script. Press the Selenium IDE record button to turn it into a recording state, and then you can do the following on the page, such as logging into the book Management system, doing these actions: mouse click the user name input box and enter the user, move to the Password entry box, enter the password, click "Sign In". When viewing the Selenium IDE window, there are a few of the following in the Table tab
V: Run the test
Add a verification point. When a script is recorded, the script does not actually meet the purpose of the test, and you need to add a verification point to it. Add the following statement to the script that you just followed. <tr>
<td>verifyTextPresent</td> <td> exit System </td> </tr>
Playback scripts. After you have recorded your script, click the Play entire test suite button in the Selenium IDE window to go back and forth the script.
Analyze test results
Under normal circumstances, the recorded script can be passed smoothly during playback, but for the stability of the script, generally in some pages overloaded with some time delay, such as delay 3S or add a wait command.
Testing and debugging of library management system