CSC/ECE 517 Fall 2018 - Project E1852 Write unit tests for participant.rb

From Expertiza_Wiki
Revision as of 23:48, 2 November 2018 by Xji7 (talk | contribs) (→‎Introduction)
Jump to navigation Jump to search

Introduction

The objective for this project is to write unit tests using Rspec for participant.rb model, which is used to prepare data for participants enrolled in each course/assignment. By editing the participant_spct.rb, all class and instance methods are tested, and the path coverage is above 90% with all 97 lines covered.

Expertiza

Expertiza is an open source educational web application developed on Ruby on Rails framework. Using Expertiza, students can submit and peer-review learning objects such as articles, code, and websites. The source code is available on Github and it allows students to improve and maintain.

Behavior-DrivenDevelopment

In software engineering, behavior-driven development (BDD) is a software development process that emerged from test-driven development(TDD). The behavior-driven development combines the general techniques and principles of TDD with ideas from domain-driven design and object-oriented analysis and design to provide software development and management teams with shared tools and a shared process to collaborate on software development.

Rspec

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. It contains its own mocking framework that is fully integrated into the framework based upon JMock. The simplicity in the RSpec syntax makes it one of the popular testing tools for Ruby applications. The RSpec tool can be used by installing the rspec gem which consists of 3 other gems namely rspec-score, rspec-expectation and rspec-mock.

Problem Statement

Steps

Test Result

Reference