Draw a control flowchart for this example using one


STQA Exercise -

Problem set 1 - Scenario: A vending machine dispenses either hot (e.g. tea or coffee) or cold drinks (e.g. water or soda). If you choose a hot drink, it asks if you want milk (and adds milk if required), then it asks if you want sugar (and adds sugar if required), then you drink is dispensed.

a) Draw a control flowchart for this example using one statement for the selection of the type of a drink (use Visio Flowchart or similar graphical editor to draw it).

b) Given the following tests, what is the statement coverage achieved (in %)? What is the decision coverage achieved (in %)?

Test 1: Cold drink

Test 2: Hot tea with milk and sugar

c) What additional tests will be needed to achieve 100% of both statement and decision coverage?

d) Prepare decision table for the above problem using Logic Gem, chose various options and comment on generated code in three languages your team is most familiar with.

e) Prepare test set to achieve 100% of the basis path coverage.

f) What would be a difference, if any, if you allow vending machine to select options in any order?

Problem set 2 - Scenario: If you are flying with an economy ticket, there is a possibility that you may get upgraded to business class, especially if you hold a gold card in the airline's frequent flyer program. If you don't hold a gold card, there is a possibility that you will get "bumped off' the flight if it is full and you check in late. The policy is specified using a flowchart below. Note that each box (i.e. statement) has been numbered.

The following three tests have already been run: t1) Gold card holder who gets upgraded to business class t2) non-gold holder who stays in economy, t3) a person who is bumped off the flight.

a) What additional tests would be needed to achieve 100% decision coverage?

b) Experiment with Logic Gem (define a complete DT) and select tests for basis path coverage

Problem set 3 - Program Control Flow Graph Coverage

Answer following questions for the code represented in Fig 4-46:

a) To achieve only statement coverage how many tests would be needed?

b) How many test cases are needed for basis path coverage (make the test plan)?

c) If we wanted to test this module to the level of multiple condition coverage (ignoring the possibility of short circuiting), how many test cases would be needed (demonstrate using DT)?

d) If this code were in a system that was subject to FAA DO/178B and was rated 1 Level A criticality, how many test cases would be needed for the first if statement alone (demonstrate using DT)?

Problem set 4 - (for teams of four or more students only): Testing Binary Search over real numbers

A Binary Search (in an array of real, floating point, numbers) function code is presented on Figure 4. Prepare a test plan to cover statements, decisions, basis bath etc. Experiment With code analysis/test coverage tools like EcIEMMA (in Eclipse) or whichever relevant ones you found useful (including on MS VS platform).

Problem set 5 - (for teams of five students only): Hexadecimal converter exercise

Which tool (s) if any you found useful in designing tests and assessing achieved test coverage.

Hexadecimal Converter Exercise

In figure 4-40, you'll find a C program that accepts a string with hexadecimal characters (among other unwanted characters). It ignores the other characters and converts the hexadecimal characters to a numeric representation. If a Ctrl-C is inputted, the last digit that was converted is removed from the buffet If you test with input strings "24ABd690BBCcc" and "ABCdef1234567890'; what level of coverage will you achieve?

What input strings could you add to achieve statement and branch cover-age? Would those be sufficient for testing this program?

Problem set 6 - (Bonus for all teams): Data Flow Graph Testing Practice and Comparison with DT

Use all the techniques and coverage criteria you learned so far, including Data Flow Testing.

Attachment:- STQA Exercises.rar

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Draw a control flowchart for this example using one
Reference No:- TGS01644561

Expected delivery within 24 Hours