Metrics
The following document provides an insight into the software metrics of the AMOGUS project.
For the backend the source code complexity and the class coupling metrics are examined. AMOGUS is a web application, therefore the web application metrics are examined as well to give an insight to the frontend.
Software testing metrics are a result from the testing described in the testplan.
1. Evaluation methods
In this section the methods used to collect the chosen metrics are described.
1.1. Source Code Complexity and Class Coupling
This projects source code complexity and class coupling are measured using the inbuilt feauture of the IDE Visual Studio 2022. To evaluate these metrics the results from the calculation of the IDE are gathered on a class level. Visual Studio aggregates the metrics of the functions of a class and provides this as a result. For the assembly level the median of the results of all classes within that assembly is calculated to exclude outliers.
1.2. Web Application Metrics
The web application metrics are measured using the built in feature Lighthouse in Google Chrome.
For this project this metric is measured in two rounds:
- Before optimizing images.
- After optimizing images.
2. Results
In this section the results of the chosen metrics are displayed.
2.1. Source Code Complexity and Class Coupling
Median of the code complexity of the overall AMOGUS project:
Code Complexity | Class Coupling | |
---|---|---|
Project AMOGUS (median) | 5 | 10 |
The following tables show the calculated source code complexity and class coupling on a class level. They are grouped by the assemblies of AMOGUS.
assembly: AMOGUS VALIDATION
Code Complexity | Class Coupling | |
---|---|---|
assembly: AMOGUS VALIDATION (median) | 1 | 10 |
RegisterValidator | 1 | 10 |
StatsValidator | 1 | 10 |
GameSessionValidator | 1 | 10 |
AddValidators | 1 | 2 |
assembly: AMOGUS INFRASTRUCTURE
Code Complexity | Class Coupling | |
---|---|---|
assembly: AMOGUS INFRASTRUCTURE (median) | 6 | 17 |
DateTimeWrapper | 3 | 4 |
UserMedalRepository | 3 | 13 |
RoleManagerWrapper | 3 | 15 |
GameSessionRepository | 5 | 15 |
TokenFactory | 6 | 21 |
DependecyInjection | 6 | 34 |
UserStatsRepository | 9 | 17 |
UserService | 9 | 18 |
UserManagerWrapper | 13 | 16 |
ApplicationDbContext | 16 | 23 |
AuthService | 22 | 38 |
assembly: AMOGUS CORE
assembly: AMOGUS BENCHMARKS
Code Complexity | Class Coupling | |
---|---|---|
assembly: AMOGUS BENCHMARKS (median) | 7 | 6 |
Program | 2 | 3 |
MentalExerciseFactoryBenchmarks | 7 | 6 |
ExerciseServiceBenchmarks | 29 | 21 |
assembly: AMOGUS API
Code Complexity | Class Coupling | |
---|---|---|
AMOGUS API | 5 | 19 |
Program | 4 | 36 |
UserController | 14 | 25 |
TeacherController | 7 | 23 |
StatsController | 8 | 19 |
InformationController | 2 | 10 |
HealthController | 1 | 6 |
GameController | 10 | 24 |
AuthController | 3 | 15 |
StreakUpdateScheduler | 5 | 14 |
SendMailServiceScheduler | 5 | 16 |
DependencyInjection | 2 | 23 |
Looking at the results of these metrics it's possible to say that the code complexety is quite high with the values ranging from 4 to 7 in the assembly level. That could be explained due to a lot of validations and condition checking.
As for the class coupling the high values could originate from a lot of utility classes (the services and repositories) being used throughout the project.
Both high values could also be because of the class level aggregation that Visual Studio does.
2.2. Web Application Metrics
The web application metrics are measured twice. The first time measuring before all the images on the page were optimized and the second measureing after optimizing the images.
I.) Landingpage
As seen in the result, the landing page of AMOGUS doesn not score as well in performance as it does in best practices and the largest contentful paint takes up to 3,5s
to build.
The main issue for the performance is statet in Lighthouse's recommendations as seen above: the images are too big. After scaling the logo, the parallax background and the badges down and changing the fileformats to svg
and webp
the performance increased. The largest contentful paint now only takes up 1,8s
instead of 3,5s
. Results after scaling images down:
In the last image it is seen that the images in the landingpage now pass the tests from Lighthouse.
The full Lighthouse test results for the landingpage can be found here:
- First results
- Second results (after scaling images down)
II.) Statistics page
The statistics page shows similar results to the landingpage.
Due to badge having a big size and high resolution the largest contentful paint takes up 3,7s
.
After scaling down the badges and changing their format, performance in loding the statistics page significantly increased:
The full Lighthouse test results for the statistics page can be found here:
- First results
- Second results (after scaling images down)
III.) How-To-Play page
Different than the previous pages was the How-To-Play page as here the perfamance was already at a good 91%
with the largest contentful paint only taking up to 1,5s
. That is the time the previous pages take after the optimizing of the images.
The How-To-Play page only has 3 images. As they are important to be seen in a good quality and the performance is already good, these 3 images are not scaled down. To optimize it their fileformat is also changed to webp
, resulting to a smlight increase in the performance:
The full Lighthouse test results for the How-To-Play page can be found here:
- First results
- Second results (after scaling images down)
2.3. Software Testing Metrics
All about the software testing metrics and the results of the testing can be found in the Test Report.