The project focuses on comprehensive testing techniques for a web application following a layered architecture.
The main goals of this assignment are:
- Integration Testing: Validate web application functionalities through simulated user interactions.
- Database Testing: Ensure data integrity and validate operations using test data.
- Mock Testing: Isolate and test business logic components by mocking dependencies.
-
Integration Testing with HtmlUnit:
- Tests for inserting new addresses and customers.
- Validation of sales creation and status updates.
- Complete workflow tests from customer creation to delivery handling.
- Robustness tests including handling of invalid inputs and concurrency.
-
Database Testing with DbSetup:
- Setup and teardown of database states for reliable testing.
- Validation of constraints such as unique VAT numbers for customers.
- Tests for customer deletion, updates, and ensuring data integrity.
-
Mock Testing with Mockito:
- Mocking dependencies in the business layer to test individual components.
- Refactoring to introduce interfaces and dependency injection for better testability.
- Examples of isolated unit tests demonstrating effective use of mocks.
- HtmlUnit: For simulating browser interactions and verifying web application behavior.
- DbSetup: For setting up and tearing down database states for tests.
- Mockito: For creating mocks and stubs to isolate and test components.
- Wildfly: Application server used to deploy the web application.
- Maven: Build automation and project management tool.
To get a local copy up and running, follow these simple steps:
- Clone the repository:
git clone https://github.com/9-whiterose-9/Verification-And-Validation-for-Web-Application.git
- Open Eclipse IDE.
- Go to
File > Import...
. - Select
Maven > Existing Maven Projects
and clickNext
. - Browse to the cloned repository directory and click
Finish
.
- Right-click on the project in the Project Explorer.
- Select
Run As > Maven clean
. - After the clean process completes, select
Run As > Maven install
.
- Go to
Window > Show View > Servers
. - In the
Servers
view, right-click and selectNew > Server
. - Select
Wildfly
from the list and clickNext
. - Configure the Wildfly server runtime environment and click
Finish
.
- Right-click on the project in the Project Explorer.
- Select
Run As > Run on Server
. - Choose the Wildfly server configured earlier and click
Finish
.
- Right-click on the project in the Project Explorer.
- Select
Run As > JUnit Test
.