473,406 Members | 2,356 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,406 software developers and data experts.

What Unit Tests?

I'm starting a small application to get my feet wet with Test Driven
Development. I understand the mechanics of setting up NUnit, but I'm not
sure what types of tests I should be writing.

The app is an 'issue tracker' that pulls it's data from a SQL Server
database. The user will be able to pull a list of issues (problems that
need to be addressed), search for specific issues, update them and add new
issues.

I've got the following main classes:

User
Issue - represents a single issue's basic information (e.g. IssueID,
OpenDate, etc)
IssueCollection
IssueHistory - represents a single action item taken on an Issue
IssueHistoryCollection

I'm wondering if this type of app, where the classes themselves are mostly
getters/setters, is a good candidate for TDD. If it is, what are some good
candidates for meaningful unit tests?

Thanks!

Chris
Nov 21 '05 #1
1 1300
Chris - this is a big topic, but at a minimum, I'd write a test for every
function that I had and verify the values returned were valid. Simple
Getters and setters could be tested but I'd focus on bigger issues unless
you have the time for sure. If your accessor do any special validation
though - then they are definitely appropriate candidates. Anything that
hit's the database, does any sort of validation, value changes etc are
definitely items you want to cover although given the time, you want all of
your code covered.
"Chris Burgess" <ch***********@converse.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I'm starting a small application to get my feet wet with Test Driven
Development. I understand the mechanics of setting up NUnit, but I'm not
sure what types of tests I should be writing.

The app is an 'issue tracker' that pulls it's data from a SQL Server
database. The user will be able to pull a list of issues (problems that
need to be addressed), search for specific issues, update them and add new
issues.

I've got the following main classes:

User
Issue - represents a single issue's basic information (e.g. IssueID,
OpenDate, etc)
IssueCollection
IssueHistory - represents a single action item taken on an Issue
IssueHistoryCollection

I'm wondering if this type of app, where the classes themselves are mostly
getters/setters, is a good candidate for TDD. If it is, what are some good
candidates for meaningful unit tests?

Thanks!

Chris

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mairead O' Donovan | last post by:
From: davidkeaveny@gmail.com (CtrlAltDel) Newsgroups: microsoft.public.dotnet.datatools Subject: Unit-testing applications that use the Microsoft.Patterns.EnterpriseLibrary.Data Date: 15 Apr 2005...
38
by: Christoph Zwerschke | last post by:
In August 2001, there was a thread about the "Art of Unit Testing": http://groups.google.com/group/comp.lang.python/browse_frm/thread/aa2bd17e7f995d05/71a29faf0a0485d5 Paul Moore asked the...
72
by: Jacob | last post by:
I have compiled a set og unit testing recommendations based on my own experience on the concept. Feedback and suggestions for improvements are appreciated: ...
6
by: TB | last post by:
Hi Everyone on comp.lang.c++: I am thinking about learning a programming language and I want to decide whether it is worthwhile spending my time learning the C++ programming language. I am a...
6
by: Jeremy | last post by:
I understand what a unit test is. No problem there. What I'm wondering is what, specifically, do most of you more experienced developers mean by "writing" a unit test. Am I correct to believe...
98
by: tjb | last post by:
I often see code like this: /// <summary> /// Removes a node. /// </summary> /// <param name="node">The node to remove.</param> public void RemoveNode(Node node) { <...> }
2
by: shuisheng | last post by:
Dear All, I am using visual studipo 2005 (standard version which do not provide unit test tool) to develop some c++ code. I want to do unit test while I am coding. Anybody can suggest me an...
6
by: Michael Bray | last post by:
I've just inherited a fairly large project with multiple classes. The developer also wrote a huge number of unit tests (using NUnit) to validate that the classes work correctly. However, I don't...
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...
5
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005 Team Edition for Software Developers I've used the wizard under the Test menu to create a bunch of unit tests. When I click "Test -Start Selected Test Project...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.