The Artima Developer Community
Sponsored Link

Agile Buzz Forum
On ordering testcases

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
On ordering testcases Posted: Feb 4, 2004 3:31 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: On ordering testcases
Feed Title: David Buck - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/buck-rss.xml
Feed Description: Smalltalk can do that
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From David Buck - Blog

Advertisement
The popular concensus amonst users of SUnit is that the order of testcases doesn't matter and testcases can be run in any order. I agree to an extent. The way SUnit works by default is to pick out all method names starting with "test" and execute them in any order. In most cases this works and I feel that in all cases it should work. My problem is not with the running of the testcases at all. It has to do with failure and with learning

When I write testcases, I write basic ones first to test fundamental things and gradually build up the complexity to more and more sophisticated operations. Suppose I have 50 testcases written that all pass. Now I change the code in some way and 20 of the testcases break. To find out why they broke, I'd like to debug one of them. Which one? I'd really like to debug the simplest one that broke rather than a more complex one. With SUnit, there's no easy way to tell which is the simplest.

Suppose I bring a new developer onto a project. An excellent way to have them learn the system is to get them to walk through the execution of the testcases. To do that, they need to start from the simplest tests. Which are the simplest? It's impossible to tell.

For these reasons, I frequently override the buildSuite method of SUnit and provide my own. This gives my testcases an explicit order and helps me debug them and use them as documentation.

Read: On ordering testcases

Topic: Busy busy busy... Previous Topic   Next Topic Topic: Runtime Issues

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use