Design

Since our application is quite simple, we decide to stop the analysis phase here, without modeling our requirements as use cases. Instead, we move on making a high-level architectural design of the web application using the classical three-tier model: presentation, application (or business) logic, and data tier. Regarding the application logic, as the following picture depicts, two components are needed. First one, called CatService is charge of all the rating actions as described in the requirements list. Second one, called CookiesServices is needed to handle HTTP Cookies, needed to implement FR5:

High-level architectural design for the application Rate my cat!

At this stage, in the development, we are able to decide the major technologies implied in the implementation our application:

  • Spring 5: This will be the foundation framework for our application. Concretely, we use Spring MVC through Spring Boot to simplify the creation of our web application. Moreover, we use Spring Data JPA using a simple H2 database to persist the application data, and Thymeleaf (http://www.thymeleaf.org/) as template engine (for views in MVC). Finally, we also use the Spring Test module to make in-container integration tests in an easy way.
  • JUnit 5: Of course, we cannot use a different testing framework than JUnit 5 for our tests cases. Moreover, to improve the readability of our assertions we use Hamcrest.
  • Mockito: In order to implement unit test cases, we will use the Mockito framework, isolating the SUT from its DOCs in several out-of-container unit tests.
  • Selenium WebDriver: We will also implement different end-to-end tests using Selenium WebDriver to exercise our web application from JUnit 5 tests.
  • GitHub: Our source code repository will be hosted in a public GitHub repository.
  • Travis CI: Our test suite will be executed each time a new patch is committed to our GitHub repository.
  • Codecov: To track the code coverage of our test suite we will use Codecov.
  • SonarCloud: To provide a complete assessment of the internal quality of our source code, we complement our test process with some automatic static analysis using SonarCloud.

The screenshot here shows the application GUI in action. It is not the main objective of this section to dig deeper in the implementation specifics of the application. Visit the GitHub repository of the application on https://github.com/bonigarcia/rate-my-cat for details about it.

Screenshot of the application Rate my cat!
The pictures used to implement this example have been downloaded from the free images gallery available on https://pixabay.com/.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.55.193