raunak2007 / analysis-backend

0 stars 0 forks source link

Coding: Java & Backend Review Ticket #3

Open vardaansinha opened 7 months ago

vardaansinha commented 7 months ago
  1. Fibonacci Feature (Vardaan & Raunak)

Feature Purpose & Functionality: The feature utilizes different Fibonacci algorithms (recursive, iterative, memoization) to calculate and visualize their relative effiencies in terms of execution times. The backend receives user input from the frontend, generates Fibonacci series data, creates a chart using JFreeChart, and returns the chart image to be displayed on the frontend.

Use of Abstraction & Inheritance:

The program employs abstraction and inheritance by defining a common interface FibonacciAlgorithm that represents the generic structure of Fibonacci algorithms. Concrete classes (RecursiveFibonacci, IterativeFibonacci, and MemoizationFibonacci) then extend this interface, providing specific implementations for each algorithm.

Use of Data Visualization:

JFreeChart, a Java library for creating interactive charts - generates a line chart that visually represents the efficiency of different Fibonacci algorithms based on the number of terms.

Backend Code Documentation:

The code includes comprehensive comments to enhance readability and understanding for peers and Mr. Mortensen. The comments are placed to explain the purpose of methods, provide context for variables and classes (especially the parent classes being extended) and offer insights into how the program works to simplify understanding.

Current Errors & Remaining Minor Tasks:

There are unresolved references, as we need to figure out how to actually push the JFreeChart image --> frontend. Also, the frontend code needs to be completed so that the API call can be fulfilled and it'll be easy to visualize the data.

KEY COMMITS:

image

This is the bulk of the JFreeChart visualization code in the backend - this is a large body portion of the program for the Fibonacci feature.

image

This is a lot of important code - calculating the time taken for each of the algorithms and then pushing them to the JFreeCharts visualization.

carbon

This contains the code for the major calculations and measurements of the program.

  1. Sorting Features (Vishnu)

Feature Purpose & Functionality: This program is an extension of what was worked on by Vishnu and Vardaan's group in Trimester 1. The MockDataGenerator.java file generates a series of students' computer science grades based on the student inputting their commits, pull requests, issues, and repositories contributed to. Then, there are separate programs which handle the binary, bubble, and merge sorts of the data generated by the MockDataGenerator file.

The data is then visualized via JFreeChart - the x-axis is the length of the data (number of students for which the data is generated) vs. the time taken in nanoseconds. This graph is created for each type of sort used in order to compare algorithmic efficiency.

Use of Algorithms:

Through all of the sorting programs, we are using binary insertion sort, bubble sort, and merge sort algorithms.

Use of Inheritance & Abstraction:

Each of the classes within the sort program files extends the 'Sorter' class. Each of the concrete classes are inheriting common sorting functionalities from the 'Sorter' class, such as the 'benchmarkSort' algorithm.

The Sorter class is also an abstract class. It allows for a common interface for the sorting algorithms with the 'sort' method and the sorting algorithms are subclasses within the Sorter class.

Remaining Task:

Something we might want to do is instead of graphing each of the sort types and the time taken on a separate graph, we will try to put all of the sorts on the same graph with different colors so that the visualization process is a lot easier for the user - it is a lot easier to compare efficiency.

Key Commits:

image

This was the commit where the binary sort visualization was completed.

image

This was where the actual binary sorting logic was added in.

Cool Sorting Visualizations:

image

image

FRONTEND:

image

EDUCATIONAL PURPOSE:

There is going to be a feature where once a user can click each button for the visualizations, it will display a couple of characteristics about each of the types of sorts, each of the types of Fibonacci algorithms and sorting algorithms.

OVERALL REMAINING TASKS:

There are only a few things left to be done which we will address shortly.

  1. The frontend visualization is based on fetching the JFreeChart graphs. Almost ALL of our work is done in the backend, so the frontend needs minor work, perhaps some styling, and a little user input for the Fibonacci feature. The frontend for the sorting feature (the mock data generation in specific) is almost identical to what was used last trimester for some of our group members' final projects, so that job is already finished.

  2. We need to make sure that the frontend-backend connection is fully functional. This is a work in progress since the backend deployment is still a work in progress, but this should be done by the end of December 3rd (Sunday).

Ryanrob327 commented 7 months ago

1.9/2.0