CSC/ECE 517 Spring 2014/oss E1405 irw

From Expertiza_Wiki
Jump to navigation Jump to search

Improve tests & investigate regex warnings for student_task

Introduction

Background

This model allows for much of the functionality the student requires to interact effectively with expertiza. Here a student is able to sign up for topics, form teams, submit assignments, review other students' work, and check his or her own scores.

Work accomplished

Objective 1: Fix existing tests

Initially, there were 26 tests with errors. Many tests required functionality or fixtures that were likely changed by people working on expertiza over the years.

Issues

Many fixtures required to correct the tests were missing, and had to be added or created. Additionally, several tests were referencing deleted elements of fixture files which were added in order to correct test functionality. Finally, there were certain elements of the code itself in the controller file which had to be corrected in order for tests to run.

Result

All tests now pass without errors, failures or deprecation warnings:

.........................

Finished in 1.235192136 seconds.

25 tests, 26 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications


Objective 2: Add additional tests

After digging into the code, it became clear that what's needed isn't more tests, but better tests. The existing tests were very obtuse and frequently broken. They are now much more maintainable.

Future work

There is no current unit test file for student_task, which means there aren't unit tests. Such tests should be added in the future in order to ensure proper functionality.

With regard to student_task_controller_test.rb, it really should be refactored more than expanded. It has reasonable test coverage, what it needs is easier to understand, more elegant tests.