jducoeur: (Default)
[personal profile] jducoeur
I've started to develop a real bias for self-documenting tests. Here's the regression test I just got working:
	
	/**
	 * Tests Bug 57: when you are actively involved with a conversation, the
	 * new responses aren't accounted for as read in the list view.
	 */
	@Test
	public void TestBug57() {
		openCommYou(Mark);
		
		// Start the conversation...
		int convId = startGenericConversation(Mark);
		checkOpenGenericConversation(Mark, convId);
		// ... respond to it several times...
		addGenericResponse(Mark, convId);
		addGenericResponse(Mark, convId);
		addGenericResponse(Mark, convId);
		// ... and go back to the summary view. It *should* show as completely
		// caught up. The bug was that it wasn't doing so.
		goToSummary(Mark);
		refreshConversationList(Mark);
		assertNoNewResponses(Mark, convId);
	}
You can kind of figure out what that's doing even if you don't know the system, and it's wholly obvious if you do. The comments are almost redundant. *That* is what a really good test should look like in my book: clear, concise, and trivially easy to write new one...

(no subject)

Date: 2008-04-30 01:48 am (UTC)
cellio: (avatar)
From: [personal profile] cellio
Yup, nice and readable.

I haven't seen bug 57, but reading the test, I would be inclined to wonder if it matters that all the comments are from Mark. This might all for a second test with a mix of, say, Mark and Justin; I trust you'll agree that that's closer to what people would see in the wild?

(I'll refrain from asking API questions yet. :-) )

(no subject)

Date: 2008-04-30 02:00 am (UTC)
From: [identity profile] dlevey.livejournal.com
"The problem is not talking to yourself; the problem is when you answer."

(no subject)

Date: 2008-04-30 03:33 am (UTC)
cellio: (avatar)
From: [personal profile] cellio
I share your philosophy; I didn't realize the bug was that tightly characterized.

Profile

jducoeur: (Default)
jducoeur

June 2025

S M T W T F S
12 34567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags