CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm question response.rb

From Expertiza_Wiki
Revision as of 20:31, 5 November 2018 by Jtgill (talk | contribs)
Jump to navigation Jump to search

Problem Statement

There are currently no test cases for vm_question_response.rb. We seek to create unit tests for this model with a coverage of at least 90%.

Team

Matt Leader (mfleader@ncsu.edu)

Jonathan Gill (jtgill@ncsu.edu)

Files Involved

app/models/vm_question_response.rb

spec/models/vm_question_response_spec.rb


Testing Plan

We first went through each method of the VMQuestionResponse class and determined whether the method was a command, or query and whether the method was incoming, outgoing, or sent-to-self. For each method we will write tests for valid and invalid inputs as well as edge cases.

Here is an outline of our implementation strategy:

describe VMQuestionResponse do

 context 'when initialized with a valid assignment questionnaire'

  it 'adds reviews'

  context 'when given a team'

   it 'displays the members of the team'

  context 'when given a list of valid questions'

   it 'can calculate the max score for the questionnaire'

  it 'has the round value of the given questionnaire'

 context 'is initialized with an AuthorFeedbackQuestionnaire'

  it 'adds reviews'

  it 'adds answers'

  it 'get the number of comments greater than 10 words'

 context 'is initialized with a TeammateReviewQuestionnair'

  it 'adds reviews'

 context 'is initialized with a MetaReviewQuesionnaire'

  it 'adds reviews'

Testing Implementation

Results

Links/Resources