Go to Post While you look at it as punishment, I look at it as a challenge. - Daniel_LaFleur [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-10-2012, 14:21
BigJ BigJ is online now
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Unit Testing FRC Project

Hi all,

I was wondering if anyone has had experience with unit testing their FRC project in netbeans.

I'm not sure how much JUnit is supported by Java ME, but if it does I imagine it could be done by excluding the test folders from the build.xml Ant targets that build the jar for the robot.

I was wondering if anyone else had done this and could describe their project set-up and modifications. I figure asking if anyone did it first is preferable to fording out and trying to hack everything out on my own.

Thanks,

Josh
Reply With Quote
  #2   Spotlight this post!  
Unread 04-01-2013, 09:14
Azrathud's Avatar
Azrathud Azrathud is offline
Computer Nerd
AKA: Bryce Guinta
FRC #2945 (BANG)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Colorado
Posts: 24
Azrathud is on a distinguished road
Re: Unit Testing FRC Project

I too, am wondering the same. I hope everyone will forgive this bump.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-01-2013, 14:21
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Unit Testing FRC Project

All I've been able to do is port the program to a desktop app and unit test from there. But that lacks a lot of testing functionality. I'm hoping someone who would know sees this thread.
__________________
All opinions are my own.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-01-2013, 14:27
nathan_hui nathan_hui is offline
Registered User
AKA: Nathan Hui
FRC #2473 (CHS Robotics)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Cupertino, CA
Posts: 228
nathan_hui will become famous soon enoughnathan_hui will become famous soon enough
Send a message via AIM to nathan_hui
Re: Unit Testing FRC Project

By unit testing, I presume you refer to the process of writing a script to run a particular function or section of code through multiple scenarios and grade it's performance. If that's the case, you could, and may want to, do such testing without the use of JUnit. In my extremely limited knowledge of JUnit, there is frankly little that I can do with JUnit that I cannot do with my own custom program, and quite a bit that I would rather not have to run through JUnit.

What testing functionality are you looking for that JUnit gives you?
Reply With Quote
  #5   Spotlight this post!  
Unread 04-01-2013, 14:38
BigJ BigJ is online now
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Unit Testing FRC Project

Quote:
Originally Posted by nathan_hui View Post
By unit testing, I presume you refer to the process of writing a script to run a particular function or section of code through multiple scenarios and grade it's performance. If that's the case, you could, and may want to, do such testing without the use of JUnit. In my extremely limited knowledge of JUnit, there is frankly little that I can do with JUnit that I cannot do with my own custom program, and quite a bit that I would rather not have to run through JUnit.

What testing functionality are you looking for that JUnit gives you?
JUnit is just the standard unit testing framework for Java. You write functions in classes that JUnit automatically recognizes how to run and use different assertions to make sure the code ran the way you intended. Properly used, this promotes robustness in the software's functionality, early recognition of edge-case bugs, proper software design to keep the modules easily testable, and most importantly protects against quality regression (that a new code change breaks something else that you didn't intend to change).

There is probably a version out there for Java ME so that's not likely to be the problem. The auto generated build scripts for the FRC stuff are just very complicated and dense (since they are intended to be managed by netbeans). I was mainly wondering if any teams had gone down this road already so they could share how they configured their project.

As an update, I have yet to undergo this investigation myself, so apologies to the other 2 posters.

(Note: I explained unit testing so much for anyone that happens to stumble along this thread in the future )
Reply With Quote
  #6   Spotlight this post!  
Unread 04-01-2013, 22:42
Azrathud's Avatar
Azrathud Azrathud is offline
Computer Nerd
AKA: Bryce Guinta
FRC #2945 (BANG)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Colorado
Posts: 24
Azrathud is on a distinguished road
Re: Unit Testing FRC Project

Quote:
Originally Posted by BigJ View Post
...
This isn't exactly what you're looking for I think, but It's quite awesome. You can add instances of commands (you need to use a command-based approach for this to work well) to the SmartDashboard and test them out individually.

Couple that with the test method/option, and you could have a very nice way to debug/unit test your robot.

Last edited by Azrathud : 05-01-2013 at 02:36.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi