This week's material won't be interesting that much for me I suspect. I have experience with JUnit and NUnit won't differ much most likely. From the other side I may do the task fast.
Let's look at videolectures:
Why do we need Unit testing: The main problem for me is to make myself DO the test units once right after I did my class and then forget about it. But I always lazy enough so I leave this for "later" which may result in nasty situations. This is the same as in case of documentation:)
There was mentioned smth about "Simplifies integration" but it was swallowed so I didn't understand. How it can simplify integration?
Let's look at that wikipedia link about unit test tools... From there I found that NUnit and JUnit are related to so-called xUnit. That means that they are basically the same systems but just implemented for different languages. And for many languages there are relevant xUnit frameworks.
Creating a simple test: what's an attribute in C#? Is [TestFixture] similar to Java's @TestFixture? I am pretty sure it's so.
Why may we need constraint-based assert model? It just does the same as "normal" model but we write slightly similar line of code. I wonder when it may be more convenient that usual style?
ExpectedException: but what if we have several test for some method of class that are put in TestMethod()? Then if the first test in TestMethod will thorow an exception the others simply won't be run! What is the solution here? Currenly I don't see any sense in such feature because usually there are plenty of tests for each method. Of course we may put try-catch block everywhere but it's not convenient.
I am not sure if I got the difference between MaxTime and TImeout. So Timeout may be applied only for complete test fixture and it measures the executing time of the whole fixture?
I watched the demo and I go for task. Oh yes, almost forgot there're some articles in Material section let's read them first...
"About software testing in general": Yes I agree it would be nice to study a separate course in Testing, But the problem is that I haven't seen such on amk.fi, pkamk.fi or at my curriculum. A section "Testing methods" is interesting for me. So which of these 3 methods works better in most cases? Another question is, who should actually test some piece of the software: the programmer, who knows best of all what his code does or other person, e.g. tester who will have a fresh look? Of course the best case is both but I think it may take to much time.
12 Unit Testing Tips for Software Engineers: http://www.readwriteweb.com/archives/12_unit_testing_tips_for_software_engineers.php- "Instead, write a test that focuses on the behaviour of the system." - well, I am not agree here. Behaviour may depend on many helper methods/classes and if for some reason behaviour method test will fail we then have to check each non-behaviour method used here in that case. But if the test will be written for helpers too then we will see immediately probably where is the problem exactly.
Task: Write a complete NUnit test classes
:(( For one hour I tried running the NUnit test but I always crashes with reporting of invalid path. I googled it and tried a plenty of different ways but all doen't help:(. I left my post in discussion forum on Moodle. I see other guys have similar problem. I will probably reinstall MonoDevelop and try again later on.
Today I did that assigment, here's the link to the screencast - http://www.youtube.com/watch?v=AwVKIrFW4DE
I did this week's assigment in several weeks! Probably I was too lazy or there were many things to do maybe.
I have studied a couple of new things about unit testing but the majority of them studied before. To be honest that week was not that interesting for me as previous one. But now I will go for the next one!
Total time spent: 4:40
|Attached files 1|
cpu-emu.zip (123.7K) - Download