You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iteration 4 #most_sold_item_for_merchant returns the most sold item spec does not match a common sense understanding of what that method would return.
Additional Detail
The Iteration 4 spec includes the following interaction pattern under the description which item sold most in terms of quantity and revenue:
sa = SalesAnalyst.new
sa.most_sold_item_for_merchant(merchant_id)
#=> [item] (in terms of quantity sold)
# or, if there is a tie, [item, item, item]
sa.best_item_for_merchant(merchant_id)
#=> item (in terms of revenue generated)
With regards to quantity, this implies that for a Merchant that sold four forks in a single invoice and seven spoons across seven invoices, the method would return the spoon. However, for this method to work, students have had to find the InvoiceItem with the highest quantity for a particular merchant (and return the fork). There only seems to cause a discrepancy in the spec on line 105 of the iteration_4_spec document (assume that the earlier examples using the merchants on line 90 and 97 are not impacted by the two different ways of making this calculation).
Recommendation
Appears that this part of the spec harness is looking to see that ties are calculated correctly. Believe that means that we will need to find another Merchant who has items tied for their best selling item based on count.
Also believe that the #best_item_for_merchant method is calculated the same way. Fewer students have indicated an issue, likely because they use the pattern they found for #most_sold when they implement `#best_item.
The text was updated successfully, but these errors were encountered:
Summary
Iteration 4
#most_sold_item_for_merchant returns the most sold item
spec does not match a common sense understanding of what that method would return.Additional Detail
The Iteration 4 spec includes the following interaction pattern under the description
which item sold most in terms of quantity and revenue:
With regards to quantity, this implies that for a Merchant that sold four forks in a single invoice and seven spoons across seven invoices, the method would return the spoon. However, for this method to work, students have had to find the InvoiceItem with the highest quantity for a particular merchant (and return the fork). There only seems to cause a discrepancy in the spec on line 105 of the
iteration_4_spec
document (assume that the earlier examples using the merchants on line 90 and 97 are not impacted by the two different ways of making this calculation).Recommendation
Appears that this part of the spec harness is looking to see that ties are calculated correctly. Believe that means that we will need to find another Merchant who has items tied for their best selling item based on count.
Also believe that the
#best_item_for_merchant
method is calculated the same way. Fewer students have indicated an issue, likely because they use the pattern they found for#most_sold
when they implement `#best_item.The text was updated successfully, but these errors were encountered: