CSC/ECE 517 Spring 2018 E1812: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
The OnTheFlyCal module provides 4 publish methods for assignments: compute_total_score, compute_reviews_hash, compute_avg_and_ranges_hash and scores. We need to test all those methods. Privately methods are tested when testing public methods instead of tested directly. | The OnTheFlyCal module provides 4 publish methods for assignments: compute_total_score, compute_reviews_hash, compute_avg_and_ranges_hash and scores. We need to test all those methods. Privately methods are tested when testing public methods instead of tested directly. | ||
===Description of the the module=== | ===Description of the the module=== | ||
The compute_total_score method is to compute the total score of a given assignment. The method collects all questionnaires of the assignment and calls the get_weighted_score method of Questionnaire Class to calculate the total score. The get_weighted_score checks the round which the assignment questionnaire has been used and calls the compute_weighted_score method to finish the calculation. As for the symbol, if the questionnaire has never been used, the compute_weight_score just takes the symbol of the questionnaire; if the questionnaire has been used, the symbol is the symbol of the questionnaire plus the round. The compute_weighted_score method takes the symbol and the score to complete the final calculation. | |||
===Testing plan=== | ===Testing plan=== | ||
Testing. | Testing. | ||
Line 10: | Line 10: | ||
Links | Links | ||
===Acknowledgement=== | ===Acknowledgement=== | ||
Acknowledgment |
Revision as of 16:22, 26 March 2018
Description
The project aims to write a unit test for on_the_fly_calc.rb. This model file provides a module for assignments to calculate different kinds of scores when loading the views. However, there was no corresponding unit test and the coverage was only 15.45% after running all test cases.
Tasks to be completed
The OnTheFlyCal module provides 4 publish methods for assignments: compute_total_score, compute_reviews_hash, compute_avg_and_ranges_hash and scores. We need to test all those methods. Privately methods are tested when testing public methods instead of tested directly.
Description of the the module
The compute_total_score method is to compute the total score of a given assignment. The method collects all questionnaires of the assignment and calls the get_weighted_score method of Questionnaire Class to calculate the total score. The get_weighted_score checks the round which the assignment questionnaire has been used and calls the compute_weighted_score method to finish the calculation. As for the symbol, if the questionnaire has never been used, the compute_weight_score just takes the symbol of the questionnaire; if the questionnaire has been used, the symbol is the symbol of the questionnaire plus the round. The compute_weighted_score method takes the symbol and the score to complete the final calculation.
Testing plan
Testing.
Links
Links
Acknowledgement
Acknowledgment