-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Component Unit Tests #99
Comments
Ideally should we make different testing branches for different subsystems or should these tests exist under one unit test branch? By the way I have some ideas to try out on sim so I think I am going to assign this to myself for now. |
I wanted to mention this page on WPILib for unit tests, we don't need to follow it but its something that caught my eye. |
I really like this!! I'll start writing some unit tests in edd |
I think we should make unit tests for different subsystems in different branches so we don't cludder up main |
Please keep simplicity in mind when writing these if you plan on using the interfaces. I want unit tests to be the simplest part of the code which anyone can understand. |
An alternative to this would be to have a second robotContainer file that contains all of the code for just testing everything and nothing that would run on the main bot. This way it would be up to date with the test of the robot and it won't be a pain to keep up to date as the subsystems get more complex. |
wrongly closed whoopies |
? Ok. What abt making all the different branches? Oh did you still want to use wpilib s junit things? @GalexY727 |
@GalexY727 Did u want to use the junits or just make some other form of testing? |
I feel like this is no longer the case, after working with them for #288, I think that for testing math, JUnits are very powerful. For general application though, sim is still da best. |
Although that math was shown to work, #288 still failed the "unit test" of running it in sim and seeing if the output was as expected. While this did come down to tuning constants, the JUnit files would be fully encapsulated in testing the entire functionality in sim. Again, not saying JUnits are worthless, but I don't think that they are necessary when we look at the other resources we have access to. |
Agreed, it's better to test via implementation then with fake data that didn't prove it would work with my implementation. But then again, I probably could've written my test differently with that In mind. I think that this is the major separating factor: to make junit tests valuable, you need to build with them in mind. Because that wasn't a concern for us, Junits prove useless for us |
User Story
With the closure of #27, we need to make sure that each and every subsystem is realisitally able to move. We are going to be getting an alpha bot very soon, and our number one priority should be to not break anything too on our first code run. I think it's possible for it to work first try, so let's find out how to get that done
Acceptance Criteria
MathUtil.clamp(value, min, max)
, with constants representing our min and max value.P
of0.01
and anI
andD
of0
. PID can really easily tell our motor to go faster than we initially intended for it to go.Thankfully, since we have sim, we are able to ask the motor what it thinks its simulated position or velocity is, which is a great start to seeing if our logic is telling it to do the right things or not.
The text was updated successfully, but these errors were encountered: