1.1 Define what is Cyclomatic complexity? What does this software metric mean? 1
ID: 3908746 • Letter: 1
Question
1.1 Define what is Cyclomatic complexity? What does this software metric mean?
1.2 Code coverage is commonly used in software testing. It is one consideration in the safety
certification of avionics equipment (https://en.wikipedia.org/wiki/Code_coverage).
Describe a few advantages/disadvantages of this software metric.
2.
a) Define black box and white box testing. What are the advantages of each approach? Why
are both necessary?
b) Why is it important to be able to partition the test space into equivalence classes? For the
following code fragment, describe 3 different test cases, and for each, describe the class of
test cases it represents. Note: The below code might or might not have any issue(s). [5 points]
public String printTriangleType (int x, y, z)
{
/* requires: The parameters are in ascending order (i.e. x <= y <= z)
effects: If x, y and z are the lengths of the sides of a triangle,
this function classifies the triangle using one of the three strings,
"scalene", "isosceles" or "equilateral". If x, y, and z do not form a
triangle, the empty string is returned. */
String r;
r="scalene";
if (x == y || y == z) { r="equilateral"; return r; }
if (x == z) { r="isosceles"; return r; }
if (x <= 0 || (x+y) <= z) { r=""; return r; }
return (r);
}
c) Compute the Cyclomatic complexity of the method. Full path coverage testing requires
that every possible path through the code be tested at least once. For the code fragment
above, how many test cases would be needed for full path coverage? Why might full path
coverage be impossible to achieve for some programs?
d) Statement coverage testing requires that all statements in the program executed at least
once. Provide a test set which has a complete statement coverage. What kinds of error might
this testing miss?
3. Requirements Engineering & Specification :
You are approached by an owner of a local restaurant to discuss an opportunity to help him
to automate an ordering system for a restaurant. This restaurant is still operated using pen
and paper methods, with little or no automation. Customers enter the facility to be greeted
by a host, who often has a “dry erase” diagram of the tables, maintained on a blackboard.
The host can see the status of the tables based on whether they or someone else physically
updates the diagram. Once seated, a waiter writes down the orders onto a piece of carbon
paper and delivers it to the kitchen for proper food preparation. The waiter then must
periodically check back to find out when the meal is ready. When the food is done, the piece
of carbon paper is saved for proper record keeping by the management. This “old fashion”
system works but yields a large amount of tab receipts, wastes a lot of time, and is simply
out-of-date. In old fashion systems, waiters must carry pads around to take orders, always
have a working pen and be sure to keep each bill organized and “synchronized” with the
proper table.
Note: You can assume anything you think is necessary for your system. Don’t go into so many
technical details. Focus on the main ideas.
1) What elicitation technique(s) will you to use to elicit the requirements of this system?
Please provide your justification(s) on why you are choosing this technique(s)
2) Identify your stakeholders. Justify your choices.
3) Draw a use case diagram for the system. Use cases shall be relevant to the business of the
system.
4) From 3, formally, write 2 non-functional requirements.
5) Formally, write 2 functional requirements.
4. Architectural design:
From the question 3, you are given the following system architecture.
In a simplified view, a manager performs the administrative work by managing any
administrative computerized aspects of the restaurant including modify the menu of the
restaurant. Manager adds items, removes items, changes their description, and updates
prices. Runs reports on the restaurant. A hostess has a view of the restaurant and assigns
available table to customers. Waiter takes order from customers and serves food when the
items are available. To make room for the next customer, waiter also cleans the table when
customer leaves the restaurant. Chef queues of upcoming orders, organized by order mostrecently
submitted. Chef prepares food and complete order by removing it from the queue.
Describe a software architecture (pattern/style) that you would use to implement this design.
Please be sure to label all inputs and outputs to all components. Be sure to describe each
component.
5. Detailed design : Using the problem described in questions 3 and 4, provide
design diagrams of your systems. (1) Please Object-oriented design (OOD) approach, please
provide a UML Class Diagram for your work. (10 points) (2) Draw an Entity-Relationship
Diagram (ERD) to illustrate the entity types, their attributes, and the relationships among the
entity types. (3) draw a sequence diagram showing the actions performed in [1] Greeting and
seating customers and [2] Placing and receiving food order (10 points). Please clearly state
any assumption(s) you used.
Explanation / Answer
Please Note: As per Chegg Answering Guidelines, I have answered the first question. Please Post Separate for Separate Questions.
1.1 Define what is Cyclomatic complexity? What does this software metric mean?
Answer)
Cyclomatic complexity is used to determine and measure the complexity of a software program. Cyclomatic complexity being a software metric is used for qualitative measure through the linear independent paths of the program in the program source code. The Cyclomatic complexity of a program will be the number of linear independent paths in the source code of the program module.
Cyclomatic complexity = E - N + 2*P
where E is the number of edges
N is the number of nodes
P is the number of nodes having exit points
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.