What Unit Tests?

C

Chris Burgess

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
 
W

W.G. Ryan - MVP

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top