Justin du Coeur (jducoeur) wrote,
Justin du Coeur

*That* is why I spend so much time writing the test harness

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.
	public void TestBug57() {
		// 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.
		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...
Tags: programming

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded