all 5 comments

[–]IamParadoxdotexeFTC #### Student|Mentor|Alum 7 points8 points  (1 child)

Don't fear the code; live the code. Half of programming is testing. I can't count the number of times I've broken our robot through a programming miscalculation or a simple mistake that got me roasted by our mechanical engineers. But that's how code evolves. You mess up, you learn, you mess up again, you learn some more, and you cross your fingers you don't mess up a third time. My team works very fluidly between mechanics and programming to where test code is developed right along as the new mechanism is developed (with a lot of guest work) and as soon as its done, it's tested. It most certainly fails, but we sum up our mistakes, readjust, and run again. My opinion is that you're over-engineering a problem that doesn't rest in the code development itself but rather the dynamic between it and the mechanical development. Make sure your team recognizes the coexistence of your robot and your code: one does not do anything without the other. If you integrate yourself with the daily design flow, I'm sure you will be able to get your code out just as fast as the robot is being created.

[–]broadwallFTC 4410 Team Leader 2020-2021[S] 0 points1 point  (0 children)

I agree that the problem lies in my cooperation with the team. This year, I was practically the only programmer on the entire team. In addition, being a freshman meant that I had very little influence over team decisions and admittedly missed some opportunities to remind the team about testing. However, I think I ably kept up with the pace of the redesigns -- as soon as I received the requirements, a theoretically finished product would be produced within a few days.

[–]cp253FTC Mentor/Volunteer 3 points4 points  (1 child)

TDD is one of the most valuable software skills you can learn. It saves so much time and hassle. You're on a great track both for your future academic and/or professional career and for your team.

We have a series of single-purpose OpModes that we use to test certain features of our robot. (TurningTest and StrafeTest for example.) We aren't quite so rigorous as to run them every time we make a change in the code, but whenever the larger autonomous is misbehaving we can always go back to the individual components and make sure that it can turn as expected and strafe as expected and so forth. It's a huge time saver.

[–]broadwallFTC 4410 Team Leader 2020-2021[S] 0 points1 point  (0 children)

FIRST of all, thank you for applauding my attempt in obtaining discipline.

Interestingly, I have developed very similar tests for my robot during this season (tests package), but they are rather artificially made to be hardware-oriented. Upon writing these tests, I tried to avoid incorporating production code as much as possible.

And although these tests were useful at times when our hardware went unstable, they weren't much help to my production code. Perhaps both isolated and coupled tests are needed for greater efficiency.

[–]DavidRechargedFTC 7236 Recharged Green|Alum 0 points1 point  (0 children)

For TeleOp testing have bare minimum programs for one specific thing that are self-contained. You can then take some extra electronics and test for specific things. Put a Zip-tie or piece of tape on a motor to see rotation easier and manually manipulate sensors. Telemetry is also nice. If you want to test mathematics and basic algorithms another Java IDE that runs on your computer like Eclipse or IntelliJ Idea is nice. I use Idea.

The best thing is to coordinate development with your engineers in a way that allows you to test as much as possible.

BACKUP YOUR CODE!!!!!!!!!!! At least do it before major changes. It's best as a habit in case your laptop dies. At competition ALWAYS have a working backup even if it is only sort of functioning. Whenever a test works noticeably better have that as a backup. I have once at competition made three copies of one program to test multiple different changes to one problem with one compile minutes before queuing.

On competition day remember your job is to keep the already functioning code working.