|
It is currently Mon Feb 06, 2012 3:38 am
|
View unanswered posts | View active topics
| Welcome |
|
Welcome to RHAPSODY4YOU
You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today. |
 |
|
 |
|
| Author |
Message |
|
BorgesW
|
Post subject: Unit Testing a Class Posted: Thu Jan 15, 2009 7:22 pm |
Joined: Fri Dec 05, 2008 4:55 pm Posts: 15
|
|
I'm trying to use TestConductor to unit test a class at the white-box level. For example, I have a Monitor class, and it has an attribute called "useCount" and it is Protected (by default). I also made the accessor and mutator protected because I don't want it to be accessed at all outside of the class.
I have two functions called "decrementUseCount" and "incrementUseCount" and I want to test them. For example, I want to assert that when I call decrementUseCount() ... that the useCount attribute is one less than before the call.
My question is this... does TestConductor have a way of peeking inside of a class, so that in my example, I could see the value of useCount? Maybe through its animation features?
I want to avoid embedding instrumentation or test code, because it is flight software and I'm not allowed to have non-flight code in there (e.g. code for the express purpose of testing).
Thanks,
Walter
Please let me know if I need to clarify anything.
|
|
|
|
 |
|
Farquad
|
Post subject: Posted: Thu Jan 15, 2009 11:51 pm |
Joined: Thu Sep 13, 2007 7:34 pm Posts: 397 Location: London
|
|
So are you saying that the ASSERT does work when you make the attribute public? I assume so.
It's a while since I've used TC and I know it has been enhanced over the past year or so but I suspect that its scope is restricted to the public interface of the sub-system under test. The justification would be that an attribute change not detectable through the public behaviors of the class is irrelevant.
I may be wrong though and there may be a way. Are you able to ask the question directly to support?
|
|
|
|
 |
|
BorgesW
|
Post subject: Posted: Fri Jan 16, 2009 3:02 pm |
Joined: Fri Dec 05, 2008 4:55 pm Posts: 15
|
|
Yes you do have a point... that if there is no public interface for an attribute, then why test it...
I could ask support directly, but it is often much quicker to ask on this message board! And it's not a very urgent problem. Just trying to figure out what I can and cannot do with TestConductor.
thanks
|
|
|
|
 |
|
Farquad
|
Post subject: Posted: Fri Jan 16, 2009 4:38 pm |
Joined: Thu Sep 13, 2007 7:34 pm Posts: 397 Location: London
|
|
I'm hoping to start using Test Conductor in earnest in the near future. Hopefully this part of the forum will become more active as others do so too.
Have you had any training? If so was it any good?
|
|
|
|
 |
|
BorgesW
|
Post subject: Posted: Fri Jan 16, 2009 6:34 pm |
Joined: Fri Dec 05, 2008 4:55 pm Posts: 15
|
|
I have not had any formal training on TestConductor. I've read through the tutorial that they provide, and it did a good job of explaining TestConductor at a general level. But it doesn't provide very much detail, or help on outside-the-box use.
|
|
|
|
 |
|
|
 |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|