Unit testing
Test levels: why should we care?
Submitted by Ainars Galvans on Wed, 09/01/2008 - 16:59. general software testing | unit testingPerl Unit Testing... and there's Test::More... optional set_up & tear_down
Submitted by Antony Marcano on Wed, 23/05/2007 - 16:50. unit testingIt's funny... people ask me why I like testing... This is an excellent example... small, digestible but makes the point...
I often find it more challenging to test something rather than make something...
Remember my first post on Perl Unit Testing ?
Well, I was getting fed up of being forced to have a set_up and tear_down in every test - whether I needed them both or not!
Perl Unit testing... Test::More and Test::Group
Submitted by Antony Marcano on Tue, 01/05/2007 - 07:49. unit testingIn a previous post on Perl Unit Testing I illustrated one way of improving the readability of Test::More tests.
Subsequently, I remembered that Perl allows you to remove clutter by selectively not using parenthesis. This makes the tests read even more cleanly if omitted from the frist and last lines:
test 'foo can't be demoralised' , sub {
$foo->set_bar( HIGH );
throws_ok ( sub {
$foo->set_bar( LOW );
} ,
qr/Should not let others lower the bar/ ,
'Should not allow lowering of bar');
ok( $foo->is_high_achiever ,
'Should still be a high achiever' );
};
All I have done is remove two parenthesis but it makes the code much easier on the eye... IMHO
Rija Menage then found two very similar CPAN modules:...
Perl Unit Testing... Test::More (or less) like XUnit
Submitted by Antony Marcano on Mon, 23/04/2007 - 22:28. unit testingI've spent some time working with a client that does extensive development in Perl. They also use Test::More as their test framework. It wasn't my role to evaluate the use of Test::More, not to mention that there was already a significant investment in using it. So, I dived straight in.
Now, having never written any Perl before and being used to XUnit frameworks (specifically NUnit and JUnit), I was used to a very different style of writing tests.
Test::More, unlike many XUnit Frameworks, is a self-sufficient script that requires no test-runner. I've found that many of unit tests written using Test::More were long sequences of method calls and assertions separated by comments. For example...
AgitarOne - generating JUnit Tests... but there is a price to pay...
Submitted by Antony Marcano on Fri, 17/11/2006 - 13:39. test driven development | unit testing"If only you could use it to turn its observations into JUnit Tests. What a great way to plug any gaps you might have left in your own tests!?!?!?" I thought. I envisaged the team writing their code Test-Driven and then using Agitator to plug any gaps they might have left.
JUnitPerf, try it!
Submitted by hclark on Thu, 27/07/2006 - 21:27. java | JUnit | performance testing | unit testingMike Clark is credited with this gem. No relation.
http://www.clarkware.com/cgi/blosxom/2003/
Integrating Unit Testing Into A Software Development Teams Process
Submitted by webmaster@testdriven.com (Links) on Wed, 15/02/2006 - 07:48. test driven development | unit testingquality achieved by the team ranged from 38% to 267% fewer defects.
Temporal Anomalies in the DateTime Continuum
Submitted by Antony Marcano on Tue, 10/01/2006 - 22:35. C# | test driven development | unit testingabout an interesting problem with a unit test. He explains the problem and identifies the appropriate solution. Despite this, there are still several interesting problems with the test.
h2. Living in the Here and DateTime.Now!
The test was a unit test for a Class called Range :
