CSC/ECE 517 Fall 2017/E1761 Test First Development Refactor assignment.rb

From Expertiza_Wiki
Revision as of 21:32, 20 October 2017 by Apatial (talk | contribs) (Created page with "== Expertiza Background == Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and edit as...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Expertiza Background

Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and edit assignments to Expertiza. Students can be assigned in teams based on their selection of the topics. The Expertiza project is supported by the National Science Foundation.


Problem Statement

This project uses assignment.rb. This is one of the most complex files in Expertiza. It contains a lot of methods that are long and hard to understand. These methods need to be broken down into simpler and more specific methods that are easier to read/understand. Also, the few instances of code duplication that exist should also be removed.


Files Involved

assignment.rb assignment_spec.rb


Plan Of Work

1. Complete the pending tests in assignment_spec.rb, and write unit tests for newly-created methods. Please finish one set of pending tests before refactoring the corresponding methods

2. Refactor scores, self.export method.

   2.1. Write failing tests first
   2.2. Split into several simpler methods and assign reasonable names
   2.3. Extract duplicated code into separate methods

3. Rename method and change all other places it is used

   3.1. Write failing tests first (not only for renamed method, but also for other methods calling renamed method)
   3.2. has_topics? →  topics?
   3.3. has_teams? →  teams?
   3.4. is_microtask? → microtask?

4. Use find_by instead of dynamic method

   4.1. Write failing tests first
   4.2. search in lines L136, L300, L315, L542, L610