CSC/ECE 517 Fall 2016/E1665. Test staggered-deadline functionality

From Expertiza_Wiki
Jump to navigation Jump to search

Introduction

Expertiza is a web application which enables students to choose a topic in an assignment, submit assignments and peer review others' work. This application also allows the instructors to add assignments to a course, and create multiple topics with varying rubrics and different deadlines for an assignment.The Expertiza project is developed on Open Source Software (OSS) and is supported by the National Science Foundation.

Background

Rspec

Rspec is a behavior-driven development tool for Ruby programmers which helps write human readable specifications that direct and validate the development of an application. RSpec is composed of multiple libraries which can be used together or independently with other testing tools like Capybara and Cucumber. There are four parts of RSpec. They are:

  1. rspec-core
  2. rspec-expectations
  3. rspec-mocks
  4. rspec-rails

Capybara

Capybara is a web-based test automation software that simulates scenarios for user stories. It can automate web application testing for behavior-driven software development (BDD). It is a gem that can be used on top of a web-based driver. It offers a user-friendly domain specific language to describe a sequence of actions executed by the web driver. It is a part of the Cucumber testing framework.

It is supported by the following web-based drivers:

  • RackTest
  • Selenium
  • Capybara-webkit

Functional Testing

Functional testing is a type of black-box testing used in quality assurance, Functional tests are done by feeding the inputs and checking the outputs giving least importance to the internal structure of the program. It describes what the system does. Functional testing verifies a program by checking it against the specification documents. There are different types of functional testing:

  • Smoke testing
  • Sanity testing
  • Regression testing
  • Usability testing

Project Description and Test Strategy

Staggered deadline means having different deadlines for different topics under the same assignment. This is a relatively new feature of Expertiza. Deadline of different topics under the same assignment may need to be different for reasons like dependency of one topic on another. The aim of this project is to write RSpec tests to test the functionality of staggered deadline using Capybara. According to the instruction, we design 3 test cases:

Initial state: Two students with different topics submit their work before the assignment's submission deadline in round 1.

Scenario 1: Change deadline of topic 1 to bring it into review stage in round 1, check if the student assigned with topic 1 can review others' work, check if the rubrics are right for round 1.

Scenario 2: Change the deadlines of both the topics to bring them into review stage in round 2, check if the students assigned with these topics can review each other's work, check if the rubrics are right for round 2.

Scenario 3: Change the deadline of both the topic to bring them into finish stage in round 2, check that the students assigned with these topics are unable to review each other.

Test Steps in UI

Our test plan is divided into the following steps:

  1. Create an assignment: Create an assignment with topic with varying rubric by round feature.
  2. Add participants to newly created assignment.
  3. Submit a Topic: Impersonate each participant, choose a topic and submit something.
  4. Change topic Deadline: Change deadline of each topic and let each topic be in different stages (like submission round 1, review round 1, submission round 2 and review round 2)
  5. View topic stage: Impersonate each participant and check their topic’s current stage on student_task#list view.
  6. Submit reviews: Participant with topic in review stage can review other participant’s work, ensuring that right rubrics are used for different topics.The reviewers can fill in the rubrics, save and submit their reviews successfully.

In order to test using the UI, type the following commands to start the server:

git clone https://github.com/517OSS/expertiza.git
bundle install
rake db:migrate
rails s

Once the Expertiza website is up, test the following:

Create an Assignment:

  1. Login as instructor 'instructor6'
  2. Click on 'Create public assignment'.
  3. Fill in the textboxes with assignment name, and assignment directory and other necessary details.
  4. Click the 'Create' button.
  5. Click on the link 'Rubrics'.
  6. Check the box 'Review rubric varies by round?'.
  7. Click on 'Save'.
  8. Click the link 'Topics'.
  9. Click on 'New topic'
  10. Fill in the Topic id, Topic name,Topic category and Number of slots.
  11. Click 'Create'.

After returning, the assignment created is listed under 'Assignments' tab.

Add Participants to Newly Created Assignment:

  1. Create a new assignment 'Assignment1665' using factories, with two review rounds and Staggered Deadline enabled.
  2. Added three participants to the newly created assignment using factories.

Submit a topic:

  1. Create a stub to Impersonate the student 'student2064'.
  2. Click on 'Assignment1665' from the task list.
  3. Click on ‘Your Work’.
  4. Fill in the textbox with the submission link.
  5. Click on ‘upload link’

On clicking the 'upload' button, the submitted link is displayed on the page.

Change Topic Deadline:

  1. Create an assignment 'Assignment1665' using factories, with two rounds of reviews, and the staggered deadline functionality enabled.
  2. Create different types of deadlines with names 'submission', 'review', 'metareview', 'drop_topic', 'signup' and 'team_formation'.
  3. Create two topics 'Topic_1' and 'Topic_2' under 'Assignment1665' using factories.
  4. Create assignment due dates for 'submission' and 'review' for two rounds using factories.
  5. Set the topic due dates to corresponding assignment due dates using factories.
  6. Change the different deadlines of one topic to different dates.

On returning, click on 'Assignments' tab, and click on 'Edit' under 'Actions'. Click on the 'Topics' tab and then click the link 'Show start/due dates'. The instructor should be able to see the changed due dates for each of the topics

View Topic Stages:

  1. Change the deadline date of topic assigned to 'student2064' to a past date and change deadline date of topic assigned to 'student2065' to a future date.
  2. Impersonate a participant 'student2064' using a stub.
  3. Click on 'Assignments' tab on top of the page.
  4. The page should display the current stage of 'Assignment1665' as 'Review'
  5. Impersonate 'student2065' using a stub.
  6. Click on 'Assignments' tab on top of the page.
  7. The page should display the current stage of 'Assignment1665' as 'Submission'

Submit Review:

  1. Impersonate 'student2064' using a stub.
  2. Click on the link 'Assignment1665'.
  3. Click on the link 'Others' work'.
  4. Select a topic to be reviewed.
  5. Click on the link 'Begin'.
  6. The student can see 'Questionnare1' for the review round 1.
  7. Fill in the response checkboxes.
  8. Click the button 'Save Review'.

On returning, the reviewer should be able to see the 'View' option for the reviews done.

Running Tests From Terminal

The test file we added is 'staggered_deadline_spec.rb'. Once the server is running, open a new terminal, navigate the cloned 'expertiza' folder. The tests can be run in the terminal using the command:

rspec /spec/features/staggered_deadline_spec.rb

Here is the result:

References

  1. Expertiza
  2. RSpec Documentation
  3. Capybara
  4. Functional Testing