SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 48 | Next

Jonathan Jacky, Margus Veanes, Colin Campbell, Wolfram Schulte

"Model-Based Software Testing and Analysis with C#"

It uses no stored information, and computes no new information that
must be stored from one method call to the next. The same input always produces
the same output, so each method call is independent of all the others; the history
of previous calls doesn??™t matter. Stored information is called state, so a method
with these properties is said to be state-independent. It behaves like a mathematical
function, so it is also said to be functional.
State-independent methods are ideal subjects for unit testing. Their behavior
does not depend on context, so the tests can be very short. Moreover, each test is
conclusive in this sense: in any context, when invoked with the same arguments, the
method will always behave exactly as it did in the test. The only problem in testing a
state-independent method is choosing arguments that achieve good coverage of the
Overview 27
// Client requests one temperature sample, server responds
[Test]
[Category("ClientServer")]
public void LogOneSample()
{
const int port = 8000;
const string host = "127.0.0.1"; // localhost
string received, command = "T"; // get temperature sample
double temperature = 212;
double response;
Client client = new Client();
Server server = new Server();
server.Socket();
server.Bind(host,port);
server.Listen();
client.Socket();
client.Connect(host,port); // Connect before Accept is OK
server.


Pages:
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6