Details: After enter parameters to process prediction, an java.lang.ArrayIndexOutOfBoundsException is thrown Reproducible steps 1. Enter "1" to select "Office Box Prediction" in [System Home] 2. Enter "1" to select "Start New Prediction" in [Office Box Prediction] 3. Enter invalid keyword (e.g. "tomJai") to process recommendation Expected results: - At step (3), error message indicating invalid parameters should be shown - After error message prompted, either (1)terminate new prediction and go back to [Office Box Prediction] home, or (2)prompt to ask user entering parameters again Actual results: - At step (3), java.lang.ArrayIndexOutOfBoundsException is thrown and the program is interrupted Detailed console output: >> Enter genre, director, leading actor, leading actress and budget of new movie to predict box office (seperate by comma): tomJai >> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 >> at movieRating.PredictSys.doNewPrediction(PredictSys.java:24) >> at movieRating.PredictSys.enter(PredictSys.java:65) >> at movieRating.Main.main(Main.java:24)
Root cause - Checking for validation of input is missing in PredictSys::doNewPrediction() How to fix - Added PredictSys::checkParameter() to check validation of parameter, prompt to ask user entering parameter again if invalid Expected behavior - If invalid parameter is input, accurate error message indicating instruction to input correct parameter should be shown - After error message, prompt to ask user entering parameters again Potential affected areas - PredictSys Affected versions - >=v3 Test cases 1. Enter "1" to select "Office Box Prediction" in [System Home] 2. Enter "1" to select "Start New Prediction" in [Office Box Prediction] 3. Enter invalid keyword (e.g. "tomJai") to process recommendation Test result - At testing step(3), error message "Please input the exact number of data as specified!" is shown - After error message, enter message is prompted to ask user entering parameters again