views:

47

answers:

1

Hello there.

I'm writing a chat client (msn messenger style) and I've got some problems in writing the acceptance tests for the send/receive feature.

Think for instance to the user story "A user can send a message to another user".

1- Should I test if the client sw correctly interacts with the server? In this case how should I represent this interaction?

2- Should I test if the second client actually receives the message? In this case I should rely on the server to prove that my software is working fine. Is this kind of assumption correct in an acceptance test?

I would like to write my tests with concordion or fitness but every help is really appreciated.

Thank you

A: 

When you're writing an acceptance test, that should be written at the highest level, as if the user was using the software. It is typically a blackbox test. In your user story, "A user can send a message to another user", you would startup 2 clients and the chat server, send the message from one client and ensures the other received it. The story says nothing about how the server should handle it, it's just saying that a user can send a message to another user.

You do want to test the individual parts as well though, i.e. does the client correctly interact with the server. These are more integration and functional tests (and you should also have unit tests to test individual components in isolation).

Jeff Storey
I think that this method has more than one flaw. If the server or the receiver client (it can be another implementation) don't work properly my test can fail but my client implementation is still perfectly working.However I think that this solution could possibly work. In your opinion do fitnesse or concordion allow you to test something like this?
TheSENDER
If the client or server fails in an acceptance test, and the test is testing communication between two clients via the server, then the test should fail. I'm not sure what you mean by "it can be another implementation" unless you're providing a client API for people to develop clients. I'd imagine you would provide at least one client that works, so use that. As for Fitnesse/Concordion, I don't have experience with Concordion, but you should be able to use Fitnesse. http://strumtheworld.com/blog/2010/02/lessons-in-using-fitnesse-for-testing-networking-systems/
Jeff Storey