471,350 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

Re: Creating a unit test in vs2008 for an object that holds strings?

Alain Boss wrote:
If you only use some getters/setters on this class i wouldn't spend much
time on unit tests.
Believe it or not, but I have actually seen getters and setters
being wrong after too much copy paste (it was not C# but that does
not really matter).

As a consequence I am paranoid enough to even make unit tests
for that type of class.

Arne
Jun 27 '08 #1
3 1535
Arne Vajhøj wrote:
Alain Boss wrote:
>If you only use some getters/setters on this class i wouldn't spend
much time on unit tests.

Believe it or not, but I have actually seen getters and setters
being wrong after too much copy paste (it was not C# but that does
not really matter).

As a consequence I am paranoid enough to even make unit tests
for that type of class.

Arne
Well, i have seen setters in legacy code that are longer than my arm
too. In this case Unit tests are definitely called for.

alain
Jun 27 '08 #2
Arne Vajhøj wrote:
Alain Boss wrote:
>If you only use some getters/setters on this class i wouldn't spend
much time on unit tests.

Believe it or not, but I have actually seen getters and setters
being wrong after too much copy paste (it was not C# but that does
not really matter).
These bugs should be found by the unit tests for the consumer classes.
>
As a consequence I am paranoid enough to even make unit tests
for that type of class.

Arne

Jun 27 '08 #3
Ben Voigt [C++ MVP] wrote:
Arne Vajhøj wrote:
>Alain Boss wrote:
>>If you only use some getters/setters on this class i wouldn't spend
much time on unit tests.
Believe it or not, but I have actually seen getters and setters
being wrong after too much copy paste (it was not C# but that does
not really matter).

These bugs should be found by the unit tests for the consumer classes.
Usually will.

And if the consumer class is done by the same team at the same
time, then no big deal.

But another team taking a drop finding the bug 3 months later
will not be pleased.

Arne
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by shuisheng | last post: by
176 posts views Thread by nw | last post: by
1 post views Thread by rich_sposato | last post: by
1 post views Thread by Richard Lewis Haggard | last post: by
6 posts views Thread by Vyacheslav Maslov | last post: by
2 posts views Thread by =?Utf-8?B?QXJtaW4gR2FsbGlrZXI=?= | last post: by
3 posts views Thread by =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.