CSC/ECE 517 Fall 2020 - E2055 write unit tests for student task.rb

From Expertiza_Wiki
Revision as of 01:00, 20 October 2020 by Jwbumga2 (talk | contribs)
Jump to navigation Jump to search

This page provides a description of the Expertiza based OSS project.


About Expertiza

Expertiza is an open source project based on Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.

This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.


About RSpec

RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this means is that, tests written in RSpec focus on the "behavior" of an application being tested. RSpec does not put emphasis on, how the application works but instead on how it behaves, in other words, what the application actually does.Each RSpec file contains one or more tests. Each test ensures if a particular feature of our website is working properly.The output of an RSpec run will tell you exactly what features aren't working. The benefit is that tested code is unlikely to break unnoticed.The tests are run every time someone makes, or updates, a Pull Request.

DB Schema

Below are the tables that are related ti student task functionality DB Schema

Description of the current project

The following is an Expertiza based OSS project which deals primarily with the student_task.rb and student_task_spec.rb. It focuses on writing RSpec unit tests for the code affected or added. The goal of this project is to attempt to add sufficient unit tests to this part of the application and increase its path coverage to above 90 percent. The following tasks were accomplished in this project:

  • Complete the insufficient unit tests for student_task.rb.
  • Increase path coverage from only 31.91% with 30 lines covered to above 92.55% with 87 lines covered.
  • Cover edge cases.
  • High branch coverage to be achieved.

There are different tasks that a student can perform.

  • He can see all the assignments that he has been assigned to.
  • He can see details of each assignment like marks, his team, send invitation to student to join a team
  • Review other students' work

Tests Plan

  • Mock Objects to test
  • Topic name
  • Complete?
  • Incomplete?
  • Not started?
  • Revision?
  • Met reviews given
  • Teamed student
  • Get due date
  • Get peer review data
  • Get author feedback
  • Get submission data
  • Get timeline data

Line Coverage achieved

  • 94 relevant lines
  • 80 lines covered
  • 14 lines missed
  • Coverage = 85%

Issues

One major issue we encountered was reaching the goal of exceeding 90% test coverage. We seem to have converged around 85%.

Team Members

John Bumgardner, Pedro Benitez, Luke McConnaughey