Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulator Test Cases #163

Open
cgmc opened this issue Apr 4, 2016 · 1 comment
Open

Simulator Test Cases #163

cgmc opened this issue Apr 4, 2016 · 1 comment

Comments

@cgmc
Copy link
Contributor

cgmc commented Apr 4, 2016

This is intended as a master issue, allowing us to organise and track the various test cases that we may devise for the simulator. As such, each test case should be its own (sub-)issue, tracked as an item in the task list below.

@cgmc cgmc self-assigned this Apr 4, 2016
@cgmc cgmc added this to the Sprint #7 milestone Apr 4, 2016
@cgmc
Copy link
Contributor Author

cgmc commented Apr 4, 2016

Editing the Task List

  • Test cases should be added to the task list in the following format: - [ ] [<NAME_OF_TEST_CASE>] (https://github.com/CPSSD/robots#<ISSUE_NUMBER_OF_TEST_CASE>)
  • Test cases that are deemed to have been successfully passed by the simulator should be ticked off, and vice versa.
  • Test cases that are deemed to be infeasible, implausible or otherwise invalid should be struck through.
  • Never delete a test case from the task list.

Since edits to an issue's description do not result in a notification, please write a comment for every edit you make to the task list, detailing the change(s) you made.

Test Case Template

A test case should be defined in the following format:

  • An integer >= 3 denoting the number of walls of the room
  • A numbered list of points which conforms to the following constraints:
    • Points are to be given as two integers, in the form (x, y)
    • There must be exactly as many points in the list as there are walls of the room
    • They must be in either clockwise or anti-clockwise order
    • They must be in order (since the code takes the end-point of one line to be the start-point of the next line)
  • A point denoting the starting position of the simulated robot
  • An integer denoting the number of objects in the room
  • A numbered list of objects in the following format:
    1. (First level either blank or containing only "Object No. X")
      • (Each object must have its own second-level list)
      • An integer denoting the number of sides of the object
      • A numbered list of points, following the constraints of the equivalent list for the walls of the room
  • (Can be added later, if needs be) A task list outlining the test case's acceptance criteria, i.e. the commands the simulated robot must execute successfully in order to pass this test case. Editing the task list should be done according to the rules for editing the master issue's task list.

Marking Test Cases as Passed/Failed/Invalid

I feel we should take from the code review concept for this, i.e. the same person should not be determining the acceptance criteria, testing the simulator on those criteria and then deciding if the simulator has passed or failed, or if the test case was in some way invalid in the first place.
I propose the following:

  • Anyone can create a test case
  • Anyone can propose acceptance criteria, but there must be some form of agreement that the proposed criteria are appropriate before accepting them
  • At least two of myself, Ryan and Darragh have to agree at what point to stop adding acceptance criteria (unless the test case is re-opened later on - let's leave ourselves that option)
  • "Anyone" can test the simulator against the accepted criteria (in practice, it will likely be between myself and Ryan)
  • At least two of myself, Ryan and Darragh have to agree that the simulator has passed a particular criterion, otherwise it has failed
  • The test case's issue can't be closed until all the acceptance criteria have been passed, but once they have, anyone can close it

I am open to suggestions on this point.

@cgmc cgmc closed this as completed Apr 4, 2016
@cgmc cgmc reopened this Apr 4, 2016
@cgmc cgmc closed this as completed Apr 4, 2016
@cgmc cgmc reopened this Apr 4, 2016
cgmc added a commit that referenced this issue Apr 14, 2016
Added a square located in the centre of the room, and moved the robot
from the centre (otherwise the robot would appear inside the object).

Also, corrected errors in the object detection code.

References #164, #163.
cgmc added a commit that referenced this issue Apr 20, 2016
Previously, changing the parameters of the room required carefully
modifying a number of variables. This was awkward, so it was requested
that it be made possible to load different pre-defined rooms based on
one variable.
Initially, the code was contained in the setup function in the main
sketch, but it became immediately apparent that it would look messy and
make the main code less maintainable if left there, so a new class was
created to hold the new code.
Switching between rooms is now accomplished by passing one variable to a
function in the new class.

To create a Room object without explicitly initializing it, a default
constructor was required, so one was written.

The currentPosition variable is no longer needed, since a Room object
has the robot's current position as a member variable.

References #163, #164.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants