473,249 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,249 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 1611
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
1
by: yashgt | last post by:
Hi, I have installed Visual Studio 2005 Team Edition for Developers, on my Windows XP PC. The exact VS version is 8.0.50727.42. I created a simple Windows application in VB .NET and add a button...
5
by: shuisheng | last post by:
Dear All, I was told that unit test is a powerful tool for progamming. If I am writing a GUI code, is it possible to still using unit test? I have a little experience in using unittest++. But...
176
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write...
1
by: rich_sposato | last post by:
I released version 2.0 of C++ Unit Test Library. You can download it from SourceForget.Net at http://sourceforge.net/projects/cppunittest/ .. I wrote this unit test library because other unit...
1
by: Richard Lewis Haggard | last post by:
I'm having trouble creating unit tests for some of the projects in my solution. The unit test doesn't seem to recognize that there are classes and methods in some of the projects in a solution and...
6
by: Vyacheslav Maslov | last post by:
Hi all! I have many many many python unit test, which are used for testing some remote web service. The most important issue here is logging of test execution process and result. I strongly...
3
by: alag20 | last post by:
Hi, I have been using Visual Studio 2005 for quite some time. Though I know that if you create an app, you can write click and say Create unit tests. But I cant see this option on my copy of Visual...
2
by: =?Utf-8?B?QXJtaW4gR2FsbGlrZXI=?= | last post by:
Hi I've got an unexpected error in a unit test. I want to test a activity from Windows Workflow Foundation (WF). First, I executed the test outside of the activity just in the test-init...
3
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I have setup UnitTests that go thru a SQL Server Table Sequentially using the UntTest Property for DataSource. What if I need to use 2 tables - I have a Parent child table that I need to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...

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.