CSC/ECE 517 Fall 2023 - E2360. View for Results of Bidding (Phase2)

From Expertiza_Wiki
Revision as of 02:54, 5 December 2023 by Schen76 (talk | contribs)
Jump to navigation Jump to search

Design Doc

1. Work Plan

Based on the project's objectives and feedback received from our mentor, we have identified specific areas for improvement:

i) Refactor variable names within methods such as "bidding_details" and variables like "Topic name" and "Bidding teams" to enhance clarity and specificity.

ii) Adjust capitalization for certain components, ensuring that only the first word is capitalized for consistency.

iii) Introduce calculations to determine percentages based on additional data, such as the total number of teams and the number of teams for each priority, within the "lottery_controller."

iv) Conduct thorough testing of the modified controller and view to ensure optimal functionality.


2. Design

To add functionality for showing the percentages of the number of teams that got their #1, #2, and #3 choices. We can follow these high-level steps:

Lottery_Controller:

i) Calculate the Total Number of Teams: Before we can calculate percentages, we need to know the total number of teams that participated in the bidding process. This will be our denominator in the percentage calculation.

ii) Calculate the Number of Teams for Each Priority: From our `bidding_details` method, we already have counts for how many teams bid on each topic as their #1, #2, and #3 choice (`@count1`, `@count2`, `@count3`). However, these counts are currently organized by topic. We would need to modify this to count how many teams got their #1, #2, and #3 choices as their assigned topic.

iii) Calculate Percentages: Once we have the number of teams that got their #1, #2, and #3 choices, we can calculate the percentages by dividing these numbers by the total number of teams and multiplying by 100.

Bidding_detail view:

i) Update the View and Display Percentages: Above the table in our previous view, we can add a section to display these percentages.

ii) Format the Display: We will use a bold heading for each percentage type and format the number to a fixed number of decimal places.

iii) Ensure Responsiveness: Make sure the display of these percentages adjusts well to different screen sizes, maintaining readability and layout consistency.


3. Test Plan

According to the given test skeleton and the features we've implemented and to be implemented. Here are the testing ideas:


Context 1: When There Are No Bids or Assigned Teams

Test 1: Check if we get empty arrays for bids and assigned teams after running the "bidding_details" method.

Test 2: Check if the percentage of teams getting their #1, #2, and #3 choices are all 0.


Context 2: When There Are Bids and Assigned Teams for the Assignment

Test 3: We would first set up a known distribution of bids across different priority levels. After executing the "bidding_details" method, the test verifies that the returned count of bids for each priority level matches the expected distribution set up in the test environment.

Test 4: Ensure that the method correctly identifies and returns the assigned teams for each topic. In this test, the setup would include an assignment with pre-assigned teams to various topics. The "bidding_details" method is then called, and the test checks whether the method accurately returns the list of assigned teams for each topic, as per the test setup.

Test 5: Check if all teams bidding on a different topic, they all get the topic they want, and the percentage of #1 is 100%, while #2 and #3 are 0s.

Test 6: Check if all teams bidding on the same topic, only one team gets the topic they want, and the percentage of #1 is (1/teams)%, while #2 and #3 are 0s.

Test 7: Check if a team is a first/second/third team to bid on some topic, that topic is finally assigned to this team. In this case, #1, #2, or #3 is a non-zero value.

Test 8: Provide mocking data and we pre-calculate the percentage value of #1, #2 and #3, check if the calculated values are the same as ours.

Relevant Links

Github Repository: https://github.com/Shreshth-Malik/expertiza

Team

Mentor

Edward F. Gehringer (efg ncsu.edu)

Members

Richard Li (rli14@ncsu.edu)

Shreshth Malik (smalik4@ncsu.edu)

Shuai Chen (schen76@ncsu.edu)