www.marcclifton.com
-
Marc, Just wanted to say what an awesome site you have, I check it everyday. The testing articles rock. On that note, I realize you link to a few sites for testing, but do you know of any comprehensive (starting with the ultra n00b) testing sites. The article titled "Unit Test Patterns" is top notch, and I can't think of a better argument than that for testing to become it's own engineer discipline. Again kudos on a very nice site. Thanks, John
-
Marc, Just wanted to say what an awesome site you have, I check it everyday. The testing articles rock. On that note, I realize you link to a few sites for testing, but do you know of any comprehensive (starting with the ultra n00b) testing sites. The article titled "Unit Test Patterns" is top notch, and I can't think of a better argument than that for testing to become it's own engineer discipline. Again kudos on a very nice site. Thanks, John
Erm, wow, thanks! It's not every day I get to see my name in lights!
John L. DeVito wrote:
I realize you link to a few sites for testing, but do you know of any comprehensive testing sites.
Can you elaborate--are you looking for engines like NUnit or programs that help you prepare/organize tests, or more on the idea of unit testing, or, all of the above? Marc VS2005 Tips & Tricks -- contributions welcome!
-
Erm, wow, thanks! It's not every day I get to see my name in lights!
John L. DeVito wrote:
I realize you link to a few sites for testing, but do you know of any comprehensive testing sites.
Can you elaborate--are you looking for engines like NUnit or programs that help you prepare/organize tests, or more on the idea of unit testing, or, all of the above? Marc VS2005 Tips & Tricks -- contributions welcome!
Well, I'm looking for really simply stuff, such as the most simplistic example of a function being tested. for example if I have a function that takes 2 int as parameters squares them and returns the new value, how would I write code to test the function? I'm really really new at this, everything I know about programming (which really isn't that much) is completely self taught, so the best way for me to learn is ask questions and look at examples, so if you know of any place, docs, or sites that may help me further, I'd hugely appreciate it. Thanks, John
-
Marc, Just wanted to say what an awesome site you have, I check it everyday. The testing articles rock. On that note, I realize you link to a few sites for testing, but do you know of any comprehensive (starting with the ultra n00b) testing sites. The article titled "Unit Test Patterns" is top notch, and I can't think of a better argument than that for testing to become it's own engineer discipline. Again kudos on a very nice site. Thanks, John
;)
-
;)
-
Well, I'm looking for really simply stuff, such as the most simplistic example of a function being tested. for example if I have a function that takes 2 int as parameters squares them and returns the new value, how would I write code to test the function? I'm really really new at this, everything I know about programming (which really isn't that much) is completely self taught, so the best way for me to learn is ask questions and look at examples, so if you know of any place, docs, or sites that may help me further, I'd hugely appreciate it. Thanks, John
My initial reaction was "Marc's stuff is pretty simple" but on looking at his pages again I suppose that it is getting towards the intermediate level. My suggestion is to buy or borrow - but not steal :) - a copy of Test Driven Development by Kent Beck. If you want a taster before getting hold of the book, then look at CppUnit on SourceForge, specifically the Money Example[^] This takes you through the set up of CPPunit, but then starts on a nice simple example. Follow up by googling on "Test Driven Development" and perhaps on "unit testing" for more details. Then download a testing framework (CppUnit[^] for C++, NUnit[^] for .NET, JUnit[^] for Java) and start testing! Oh, and don't forget to go back and read Marc's unit testing articles once you get a bit more familiar with the concepts Graham
-
Well, I'm looking for really simply stuff, such as the most simplistic example of a function being tested. for example if I have a function that takes 2 int as parameters squares them and returns the new value, how would I write code to test the function? I'm really really new at this, everything I know about programming (which really isn't that much) is completely self taught, so the best way for me to learn is ask questions and look at examples, so if you know of any place, docs, or sites that may help me further, I'd hugely appreciate it. Thanks, John
John L. DeVito wrote:
if I have a function that takes 2 int as parameters squares them and returns the new value, how would I write code to test the function?
Well, how would you test them yourself? Probably the first thing would be to just see how they work with a couple sample numbers. BTW, your example is a bit odd--given 2 ints that you square, do you return the sum? Let's say the equation was Sqrt(x^2 + y^2). So, if you give the test routine 3 for x and 4 for y, you would expect 5 to be returned. The next thing to ask yourself is, what kind of errors do I have to deal with? Well, one obvious one is that if you square and int, what happens when the result exceeds Int32.Max? So, you'd write a unit test to verify that the routine tests for this and throws an appropriate exception. I guess the basic idea is, write a test so you can verify that it works, then think of some failure conditions and see how it handles itself. If you haven't already, peruse the Extreme Programming[^] site. While I'm not a proponent of XP, there's a lot of useful things that they talk about. Marc VS2005 Tips & Tricks -- contributions welcome!
-
Marc, Just wanted to say what an awesome site you have, I check it everyday. The testing articles rock. On that note, I realize you link to a few sites for testing, but do you know of any comprehensive (starting with the ultra n00b) testing sites. The article titled "Unit Test Patterns" is top notch, and I can't think of a better argument than that for testing to become it's own engineer discipline. Again kudos on a very nice site. Thanks, John