Language is important..

Even for the little things.  For example at a glance which would you rather see...

[TestSetUp]
public void TestSetUp()
{
}

[TestTearDown]
public void TestTearDown()
{
}

Or this..

[TestSetUp]
public void BeforeEachTest()
{
}

[TestTearDown]
public void AfterEachTest()
{
}

Language is important.. always be on the lookout for new ways you can improve your codes
communication abilities by relying on language. BDD is a perfect example of this...

posted @ Saturday, November 08, 2008 9:09 AM

Print

Comments on this entry:

# re: Language is important..

Left by Bil Simser at 11/25/2008 2:48 PM
Gravatar
I would rather see neither. Setup and Teardown are evil and voilate the first rule of TDD, keep your tests isolated. I can't isolate my test if someone is mucking around with the system before it runs. Go on, put in your setup/teardown and let some guy come along and introduce something into it you didn't expect (and won't find because setup is buried in the top of your unit test file and you're writing test #3201 on line #854). Watch 1000 tests break for no apparent reason and see yourself spend hours trying to figure out why.

# re: Language is important..

Left by Shane Courtrille at 11/25/2008 3:12 PM
Gravatar
That's definitely a view I haven't seen expressed elsewhere. I can definitely understand where you are coming from but am curious as to your solution. While test setup should not be difficult it is duplication unless you are refactoring to test setup methods?

# re: Language is important..

Left by Bil Simser at 12/8/2008 12:50 PM
Gravatar
Refactoring tests to help with DRY is a waste of time. If your setup is that big that you need to refactor duplication, I would say there's a smell in the domain in setting up tests. No test should take more than a line or two to setup. If it doesn't it either means there's too much leakage in the subject under test, or you're testing too much at once. Try using xunit where there is no setup/teardown facilities. I think TDD developers have fallen into a lax mode where they rely on test setup to help them rather than focusing on what they're testing.

# re: Language is important..

Left by meeeeeeeee at 2/11/2009 6:50 PM
ok this is stupid give me a essay on this stuff plz

# seuseyns

Left by seuseyns at 2/13/2009 3:22 PM
seuseyns

# Soma in san diego.

Left by Soma without rx. at 7/7/2009 11:56 PM
Soma. Soma information. Generic soma. Tempra soma. Buy soma watson brand online 150 tablets. Ashes of soma lyrics.

# Viagra.

Left by Viagra patent. at 7/8/2009 4:10 PM
Taking viagra with cialis. Viagra.

# Soma.

Soma petroleum. Soma. Buy soma watson brand online 150 tablets.

# Xanax during pregnancy.

Left by Xanax. at 7/10/2009 3:51 PM
Xanax bars. Xanax prescription. Xanax. Generic xanax 2 mg no prescription.

# Viagra.

Left by Viagra. at 7/11/2009 3:43 PM
Viagra. Viagra on line. Side effects of viagra.

# Cheapest phentermine.

Left by Phentermine no prescription. at 7/12/2009 4:10 PM
Phentermine free shipping. Buying phentermine. Phentermine. Cheap phentermine. Mg buy phentermine.

# Phentermine.

Left by Phentermine online pharmacy. at 7/13/2009 4:17 PM
Cheap 37 5 phentermine. Adipexdrug addiction order phentermine online. Phentermine success story. Buy phentermine on line. Phentermine cash on delivery.

# Crushing muscle relaxer soma.

Left by Soma to florida. at 7/14/2009 4:14 PM
Buy soma tablets. Effects of soma. Aura soma products. Soma online. Soma beds.

# Compare stay erect and viagra.

Left by Viagra. at 7/15/2009 4:16 PM
Buy viagra online.

# Vicodin.

Left by Buy vicodin without script. at 7/16/2009 6:23 PM
Vicodin. Buy vicodin without script. How l ong does vicodin stay in your system.

# Bactrim Mrsa

Left by Bactrim Medication at 6/29/2010 10:15 AM
Bactrim Medication
Comments have been closed on this topic.