27.07.2013 Views

2 Why We Need Model-Based Testing

2 Why We Need Model-Based Testing

2 Why We Need Model-Based Testing

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

38 <strong>Why</strong> <strong>We</strong> <strong>Need</strong> <strong>Model</strong>-<strong>Based</strong> Analysis<br />

namespace ReactiveImpl<br />

{<br />

using System;<br />

using System.Drawing;<br />

using System.Windows.Forms;<br />

public class Simulator: Form<br />

{<br />

Controller c;<br />

Button btnMessageOK, btnMessageBad, btnCommand, btnExit;<br />

public Simulator()<br />

{<br />

// Controller<br />

}<br />

c = new Controller();<br />

c.timer.Interval = Controller.PollingInterval;<br />

c.timer.Enabled = true;<br />

c.timer.Tick += new EventHandler(timer_Tick);<br />

// Panel<br />

Text = "Process Controller"; // caption<br />

btnMessageOK = new Button();<br />

btnMessageOK.Location = new Point(10,10);<br />

btnMessageOK.Size = new Size(200,50);<br />

btnMessageOK.Text = "MessageOK";<br />

btnMessageOK.Click +=<br />

new EventHandler(btnMessageOK_Click);<br />

#region Other buttons (code not shown)<br />

AutoScaleBaseSize = new Size(5, 13);<br />

ClientSize = new Size(220, 250);<br />

Controls.Add(btnMessageOK);<br />

#region Add other buttons (code not shown)<br />

// to be continued ...<br />

Figure 3.5. Process control simulator application with events (1).<br />

more free ebooks download links at:<br />

http://www.ebook-x.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!