CSC/ECE 517 Spring 2024 - E2413. Testing - Answer Tagging: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 37: Line 37:




Edge Cases:  
: Edge Cases:  


When the session is undefined, access to index should be inaccessible.
: * When the session is undefined, access to index should be inaccessible.
When the session is undefined, access to create_edit should be inaccessible.
: * When the session is undefined, access to create_edit should be inaccessible.
When the session is undefined, access to destroy should be inaccessible.
: * When the session is undefined, access to destroy should be inaccessible.




''index'' : Returns all the tag prompt deployments in JSON format
''index'' : Returns all the tag prompt deployments in JSON format


Use Cases:
: Use Cases:


When there are no tag prompts deployed, a empty list should be displayed.
: * When there are no tag prompts deployed, a empty list should be displayed.
When there is 1 tag prompt deployed, 1 should be displayed.
: * When there is 1 tag prompt deployed, 1 should be displayed.
When there are tag prompts deployed with no associated assignment answer tag, tag prompts should not be displayed.
: * When there are tag prompts deployed with no associated assignment answer tag, tag prompts should not be displayed.
When there is an answer tag associated with an user_id, it should be filtered by an user_id.
: * When there is an answer tag associated with an user_id, it should be filtered by an user_id.
When there is an answer tag associated with an assignment_id, it should be filtered by an assignment_id.
: * When there is an answer tag associated with an assignment_id, it should be filtered by an assignment_id.
When there is an answer tag associated with a questionnaire_id, it should be filtered by a questionnaire_id.
: * When there is an answer tag associated with a questionnaire_id, it should be filtered by a questionnaire_id.
When there is an answer tag associated with an user_id, assignment_id, and questionnaire_id, it should be filtered by a user_id, assignment_id, questionnaire_id.
: * When there is an answer tag associated with an user_id, assignment_id, and questionnaire_id, it should be filtered by a user_id, assignment_id, questionnaire_id.
When there is no answer tag associated with a assignment_id, no tag prompts are returned for a assignment_id with no associated answer tags.
: * When there is no answer tag associated with a assignment_id, no tag prompts are returned for a assignment_id with no associated answer tags.
When there is no answer tag associated with a questionnaire_id, no tag prompts are returned for a questionnaire_id with no associated answer tags.
: * When there is no answer tag associated with a questionnaire_id, no tag prompts are returned for a questionnaire_id with no associated answer tags.


Edge Cases:
: Edge Cases:


When user_id is undefined, an empty list of tags prompts should be returned.
: * When user_id is undefined, an empty list of tags prompts should be returned.
When assignment_id is undefined, an empty list of tags prompts should be returned.
: * When assignment_id is undefined, an empty list of tags prompts should be returned.
When questionnaire_id is undefined, an empty list of tags prompts should be returned.
: * When questionnaire_id is undefined, an empty list of tags prompts should be returned.




''create_edit'' : Allow the creation or updating of an answer tag.
''create_edit'' : Allow the creation or updating of an answer tag.


Use Cases:
: Use Cases:


When a current tag is accessed, the current tag should be updated with new provided values.
: * When a current tag is accessed, the current tag should be updated with new provided values.
When a current tag is accessed by a student, the current tag should not be updated with new values.
: * When a current tag is accessed by a student, the current tag should not be updated with new values.


Edge Cases:
: Edge Cases:
When no mapping is found related to any tag_prompt_deployment for that tag (foreign key constraint), an empty list of tags prompts should be returned.
: * When no mapping is found related to any tag_prompt_deployment for that tag (foreign key constraint), an empty list of tags prompts should be returned.


===Tag Prompt Deployment Controller===
===Tag Prompt Deployment Controller===

Revision as of 00:56, 25 March 2024

E2413. Testing - Answer Tagging

This wiki page is for the description of changes made in Spring 2024, CSC/ECE 517 for the E2413 Testing - Answer Tagging assignment.



Expertiza

In accordance with the Ruby on Rails framework, Expertiza is an open source software project (OSS) led by Dr. Edward Gehringer. Expertiza gives the instructor the ability to create new and edit already existing assignments. Also, the instructor can filter a list of subjects for students to choose. In Expertiza, students can organize into different teams to work on different assignments and projects. Also, students have the capability to peer review as a way for students to evaluate each other's work. Expertiza allows submissions from a variety of document types, such as PDFs, wiki pages and URLs.

Objective

Answer tagging helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for tone and solutions. The specs mentioned need to be further developed to cover missing methods/lines. Our objective is to add to current tests and write extra tests to cover any edge cases. Also, we had to add detailed explanations for all the tests.

Controller and Spec Files

Answer Tags

Tag Prompt Deployment


Testing Implementation

Answer Tags Controller

This controller (answer_tags_controller.rb) tracks the amount of tags students has completed overall per assignment or questionnaire. The controllers' output is a JSON-formatted collection of response tags.

Methods

action_allowed? : Determines if the user has the permission to see all the tags or create_edit a tag.

Use Cases:
* When it is a student session, access to index should be allowed.
* When it is a student session, access to create_edit should be allowed.
* When it is a student session, access to destroy should not be allowed.


Edge Cases:
* When the session is undefined, access to index should be inaccessible.
* When the session is undefined, access to create_edit should be inaccessible.
* When the session is undefined, access to destroy should be inaccessible.


index : Returns all the tag prompt deployments in JSON format

Use Cases:
* When there are no tag prompts deployed, a empty list should be displayed.
* When there is 1 tag prompt deployed, 1 should be displayed.
* When there are tag prompts deployed with no associated assignment answer tag, tag prompts should not be displayed.
* When there is an answer tag associated with an user_id, it should be filtered by an user_id.
* When there is an answer tag associated with an assignment_id, it should be filtered by an assignment_id.
* When there is an answer tag associated with a questionnaire_id, it should be filtered by a questionnaire_id.
* When there is an answer tag associated with an user_id, assignment_id, and questionnaire_id, it should be filtered by a user_id, assignment_id, questionnaire_id.
* When there is no answer tag associated with a assignment_id, no tag prompts are returned for a assignment_id with no associated answer tags.
* When there is no answer tag associated with a questionnaire_id, no tag prompts are returned for a questionnaire_id with no associated answer tags.
Edge Cases:
* When user_id is undefined, an empty list of tags prompts should be returned.
* When assignment_id is undefined, an empty list of tags prompts should be returned.
* When questionnaire_id is undefined, an empty list of tags prompts should be returned.


create_edit : Allow the creation or updating of an answer tag.

Use Cases:
* When a current tag is accessed, the current tag should be updated with new provided values.
* When a current tag is accessed by a student, the current tag should not be updated with new values.
Edge Cases:
* When no mapping is found related to any tag_prompt_deployment for that tag (foreign key constraint), an empty list of tags prompts should be returned.

Tag Prompt Deployment Controller

This controller (tag_prompt_deployment.rb)

Methods
  • x

Use Cases:

Edge Cases:

  • x

Use Cases:

Edge Cases:

  • x

Use Cases:

Edge Cases:

Testing Details

Using RSpec

How to See Test Coverage
  1. Run RSpec for answer_tags_controller_spec.rb, sudo su, yum install lynx, then lynx ./coverage/index.html
  1. Run RSpec for tag_prompt_deployment_spec.rb, sudo su, yum install lynx, then lynx ./coverage/index.html

Results

answer_tags_controller.rb coverage = 100%

tag_prompt_deployment.rb coverage = 100%

Future Work

References

  1. Expertiza GitHub
  2. Project Repository
  3. Github Project Board
  4. Demo Video for Tag Prompt Deployment Controller
  5. Demo Video for Answer Tag Controller
  6. RSpec