CSC/ECE 517 Fall 2017/E1752 Refactor assignments controller

From Expertiza_Wiki
Revision as of 23:31, 27 October 2017 by Sli41 (talk | contribs) (add more points to refactoring)
Jump to navigation Jump to search

Introduction

Expertiza is an open source webapp built on Ruby on Rails stack. It provides a platform to students with various features like peer-reviewing projects, submitting work, form teams, viewing grades etc. The project is being built and maintained by students and faculty at NCSU.

About Assignments Controller

The file assignments_controller.rb handles the logic behind Expertiza assignments and enables the creation and managements of assignments by instructional staff.

About Software Testing

Software testing is a process of examining a program or application with the intent of finding the software bugs. In software developemnt, it is usually definated as the process of validating and verifying that a software program or application or product meets the specified business and technical requirements.

Additionaly, software is tested to:

  • Detect and rectify and errors made during the development phase,
  • Ensure customer satisfaction in the application,
  • Ensure the quality of the software product and
  • Optimize the performance of the system,

RSpec Testing

RSpec is a 'Domain Specific Language' (DSL) testing tool written in Ruby to test Ruby code. It is a behavior-driven development (BDD) framework which is extensively used in the production applications. The basic idea behind this concept is that of Test Driven Development(TDD) where the tests are written first and the development is based on writing just enough code that will fulfill those tests followed by refactoring.

The Expertiza project makes extensive use of RSpec to test the various components of the application.

Testing actions perfomed

  • Creating new tests for each method,
  • Testing the each method and making sure the tests pass.

About Refactoring

Refactoring of computer software or code is the process of restructuring existing software code without changing its external behavior or performance of the software application. Refactoring improves nonfunctional attributes of the software. Refactoring aids in code readability and keeps the code well maintained and easy to understand.

Refactoring actions perfomed

  • Formatting the code for readability and convention;
  • Breaking down large chunks of code in to smaller manageable chunks;
  • Extract methods out of blocks of codes to remove code duplications using DRY principle;
  • Rename existing methods with meaningful names for better readability without change on external functionality.

Additional Links

Github project repo
Project Video Demo

References

Rspec Documentation
Better Specs
Expertiza Wiki
Expertiza NCSU

Team

Shijie Li
Amey Deshmukh
Philip Musyoki