frc-frecon / frecon

An API for building scouting apps for FRC competitions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests

rye opened this issue · comments

Test suites are great. They eliminate the gruntwork required for checking if something fixes something. Instead of having to click around on a website, we can simply write some code to check our code. Then, as we make changes, we can simply check to see if these tests pass or not.

In general, I'd say there are a few different approaches that we need to check:

  • First of all, we need to check the behavior of individual functions and classes given parameters. If parameters are completely incorrectly-formatted, the functions should probably capture that and whine. Tests can test that.
  • Second, we should check the return types of individual functions and classes. All functions should be tested to see how they respond to different inputs.
  • Third, we should check the database connections, to ensure that stuff is checked before it gets shoved places.
  • And fourth, we should check response handlers. They should handle all errors, and should be able to respond, even with critical failures, in JSON so that we don't need to connect to the Pi or BBB to solve problems.

The biggest roadblock for this is selecting a system and actually getting it done. However, I think the benefits will be relatively large. If the test suite mirrors the functionality of the API and is kept up-to-date, it will provide a clear image of how well things are going. Likewise, on webca, we could script testing JavaScript and HTML placement and such. For comparison, GitHub themselves use tests to check wording and phrasing of their blog posts. Perhaps we should consider adopting testing.

I've created the test branch for starting on this, as I feel the response will be positive.

We'll need to add some dependencies to get this to work. Namely rspec, guard, and guard-rspec, it seems.

Duplicate of #19?

Ahahaha lol I should probably check things. I'm closing this one and CC'ing this to the other one.