Question incorporating unit testing

liptonIcedTea

Well-known member
Joined
Jan 18, 2007
Messages
89
Programming Experience
1-3
For quality purposes, my company has decided we want to incorporate unit testing into our application development. I am in charge of incorporating it into our existing application.

Is this possible? From my research, it sounds like unit testing is one of those things that you plan from the start and build into a new application. Would it extremely hard or a waste of lot of effort to make an existing application "unit test"able?
 
What I'd do is to keep testing and reviewing code and whenever you find a new bug, write a test case to expose it before you solve it. That way you'll make sure that future development does not introduce bugs you had previously found. I read that code review has a better errors found per time spent ratio tough so I'd go for that particular strategy to find the bugs and test cases to expose the bugs and build a testing framework that prevents the bugs from reappearing...

But then, I must admit I'm the only coder here so I don't have much experience with quality insurance and team work... I basically create a weekly build, have a meeting with the tester, my boss and a marketing girl and we see the changes since the previous version. I came up with that due to the frequent requirement changes that totally messed up my schedule in previous projects and were usually revealed when the project was done and the clock was against us...

As for testing and debugging, I try to code everything the most modularly I can (and use the XML comments to document the interfaces) and we see how good it works in the end. I figured I'd end up writing as much test cases as production code so it wasn't worth it at this point and I write code pretty fast and without much bugs. We'll see about adding test cases when the bug reports come in probably...

That's for a labels printing software and I worked for a Version 1 of it (I completed someone else's work but there are big architectural defects and the requirements were captured wrong...) so I know the domain and the requirements are a little more stable than before. It's a production software to be sold to a few hundred customers for like a thousand bucks a copy. The version 1 has been totally thrown out and we (I) got 8 months to finish the product. Version 1 had about 150 K lines of code, but that's mainly due to REALLY bad coding in a particular area that we will avoid this time (The tech support girl was asked to help with some code and she ended up copy pasting up to 10 K lines for a single method to print a list of items, 8 per page. She did 14 printing templates!)... I expect the current product to take about 20K lines of C# code.

This is just to give you an overview of the way I manage projects, I can't really give you the advice of doing the same as your team may differ totally. Still, I hope it helps you :)

Btw, I recommend reading Code Complete. I really liked the explanations on lots of concepts related both to management and coding.
 
Back
Top