We exhibit a software defect that is not detected by
typical unit tests, but is only exposed by executing more realistic scenarios that
resemble actual application program runs. We conclude that, in order to generate
and check the realistic scenarios required for thorough testing, we will need more
automation than is provided by the popular unit testing tools.We preview our testing
techniques and show how they can detect the defect that the unit tests missed.
This chapter concerns testing methods. We also have analysis methods that can
detect errors that arise during specification or design. We demonstrate an example
that motivates our analysis methods in Chapter 3.
In this chapter, we also review some features of the technologies we use: the C#
language, the .NET framework, and the NUnit testing tool.
2.1 Client and server
Suppose we are developing a laboratory instrument system comprising a temperature
sensor connected to an embedded computer, a network, and another computer used
for data storage and analysis (Figure 2.1). This is a client/server system. The server,
a temperature-monitoring program, runs on the embedded computer. The client,
a data-logging program, runs on the other computer. The programs communicate
using the TCP/IP protocol, so the client could use the Internet to connect to a server
in a remote factory or weather station.
First we start the server program Monitor by typing a command at the embedded
computer:
Monitor 128.
Pages:
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44